Change timezone on BIG-IP via API using CURL command

I’m learning about the iControl REST api, via the F5 ‘Getting Started with BIG-IP Programmability’ course, but I’m having trouble with some fairly basic commands. For example, setting the system timezone.

Here’s the command I’ve come up with:

curl -sk -u admin:admin73 -X PUT -H 'Content-Type:application/json' -d '{ "time-zone":"America/New_York" }' https://192.168.73.31/mgmt/tm/cm/device/bigip73.f5trn.com

However, when I run this command, I get back this error:

{
  "code": 400,
  "message": "one or more properties must be specified",
  "errorStack": [],
  "apiError": 26214401
}

The choice of ‘cm/device/bigip73.f5trn.com’ as the path to the collection is straight from the lab documentation, but does seem strange to me since setting the timezone via tmsh is done via /sys/ntp.

Is there a problem with the lab material, or am I just missing something?

Your syntax looks OK. However I always perform GET to understand the structure first. API document may not match exactly as response may be different due to different code.

curl -sk -u admin:admin73 -X GET https://192.168.73.31/mgmt/tm/cm/device/bigip73.f5trn.com

​Did you try something like this :

curl -sk -u admin:admin73 -X PUT  -d ‘{“value”:“America/New_York”}’ https://192.168.73.31/mgmt/tm/sys/db/ntp.timezone

It worked for me.