YaST REST Service Documentation

System time

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.

Overview

Time configuration

PolicyKit Access Rights

The following PolicyKit permissions are defined:

org.opensuse.yast.modules.yapi.time.read

org.opensuse.yast.modules.yapi.time.write

Time

Select the timezone and region settings. Available options for time configuration are: manual and network time protocol synchronization.

GET /time

Get the list of the current time configuration.

CURL example:

curl -u <user> https://<hostname>:4984/time.xml

Result: Example

POST /time

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

POST /time

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 /time/timezones

Get the list of all available timezones and regions.

CURL example:

curl -u <user> https://<hostname>:4984/time/timezones.xml

Result: Example