Only authenticated users are allowed to access the API. Authentication is done by sending a Basic HTTP Authorisation header.
All names aren't allowed to contain spaces, slashes or colons.
Time configuration
The following PolicyKit permissions are defined:
org.opensuse.yast.modules.yapi.time.read
org.opensuse.yast.modules.yapi.time.write
Select the timezone and region settings. Available options for time configuration are: manual and network time protocol synchronization.
Get the list of the current time configuration.
CURL example:
curl -u <user> https://<hostname>:4984/time.xml
Result: Example
Change the system time configuration manually. Value 'hwclock' is read-only. When setting the date and time you need to provide the value 'config' in the request parameters with the further details. The field 'config' must have value 'manual'. Entries 'time' and 'date' are mandatory. The date format must be in the format DD/MM/YYYY.
CURL example - manual time and date configuration:
curl -u <user> -X POST --data @time_manual_post_request.xml -H "Content-Type: text/xml" https://<hostname>:4984/time.xml
Body: Example
Result: Example
Change the system time configuration by providing an ntp server. Value 'hwclock' is read-only. When setting the date and time you need to provide the value 'config' in the request parameters. The field 'config' must be set to 'ntp_sync'.
CURL example - ntp configuration:
curl -u <user> -X POST --data @time_ntp_post_request.xml -H "Content-Type: text/xml" https://<hostname>:4984/time.xml
Body: Example
Result: Example
Get the list of all available timezones and regions.
CURL example:
curl -u <user> https://<hostname>:4984/time/timezones.xml
Result: Example