Forum Discussion

rob_carr_76748's avatar
rob_carr_76748
Icon for Nimbostratus rankNimbostratus
Feb 08, 2018

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?

2 Replies

  • BF42's avatar
    BF42
    Icon for Nimbostratus rankNimbostratus

    ​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.