system.time

Summary

Resource Operation Description
System-Time GET /api/app/v1/sys/time/clock Get system time
  PUT /api/app/v1/sys/time/clock Set time
  GET /api/app/v1/sys/time/ntp Get NTP information
  PUT /api/app/v1/sys/time/ntp Set NTP
  PUT /api/app/v1/sys/time/ntp/sync Sync NTP
  GET /api/app/v1/sys/time/timezone Get system timezone
  PUT /api/app/v1/sys/time/timezone Set system timezone
  GET /api/app/v1/sys/time/timezone/list Get all timezone info

Details

GET /api/app/v1/sys/time/clock

Get system clock time.

New in version 1.0.

Response Headers:
 
Status Codes:
Accepted Authorization:
 

admin, audit

Example 1 - Request: Get system time:

GET /api/app/v1/sys/time/clock HTTP/1.1
Accept: text/html

Example 1 - Response: Get system time:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "clock": "2017-05-09  14:12:49"
}
PUT /api/app/v1/sys/time/clock

Manually set system clock time. You can configure time, date, or both.

New in version 1.0.

Query Parameters:
 
  • date (optional) – Format - yyyy/mm/dd
  • time (optional) – Format - hh:mm:ss
Response Headers:
 
Status Codes:
Accepted Authorization:
 

admin

Example 1 - Request: Set time:

PUT /api/app/v1/sys/time/clock?time=01:02:03 HTTP/1.1
Accept: text/html

Example 1 - Response: Set time:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "Success"
}

Example 2 - Request: Set date:

PUT /api/app/v1/sys/time/clock?date=2017/05/10 HTTP/1.1
Accept: text/html

Example 2 - Response: Set date:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "Success"
}

Example 3 - Request: Incorrect date format:

PUT /api/app/v1/sys/time/clock?date=05/10/2017 HTTP/1.1
Accept: text/html

Example 2 - Response: Incorrect date format:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Reason": [
    "Invalid date value. Format: yyyy/mm/dd"
  ],
  "Status": "Failure"
}
GET /api/app/v1/sys/time/ntp

Get system NTP information.

New in version 1.0.

Response Headers:
 
Status Codes:
Accepted Authorization:
 

admin, audit

Example 1 - Request: Get NTP information:

GET /api/app/v1/sys/time/clock HTTP/1.1
Accept: text/html

Example 1 - Response: Get NTP information:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "server": [
    "time1.google.com"
  ],
  "status": "on"
}
PUT /api/app/v1/sys/time/ntp

Set NTP on a system. You can also enable or disable NTP on a system.

New in version 1.0.

Note

NTP must be enabled to set NTP servers

Query Parameters:
 
  • status (optional) – Use to enable/disable NTP (on or off)
  • server (optional) – list of NTP servers, comma seperated
Response Headers:
 
Status Codes:
Accepted Authorization:
 

admin

Example 1 - Request: Disable NTP:

PUT /api/app/v1/sys/time/ntp?status=off HTTP/1.1
Accept: text/html

Example 1 - Response: Disable NTP:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "Success"
}

Example 2 - Request: Set NTP server when NTP is enabled:

PUT /api/app/v1/sys/time/ntp?server=time1.google.com%2Ctime2.google.com HTTP/1.1
Accept: text/html

Example 2 - Response: Set NTP server when NTP is enabled:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "Success"
}

Example 3 - Request: Set NTP server when NTP is disabled:

PUT /api/app/v1/sys/time/ntp?server=time1.google.com%2Ctime2.google.com HTTP/1.1
Accept: text/html

Example 3 - Response: Set NTP server when NTP is disabled:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Reason": "Could not save NTP server settings. The server parameter cannot be used when status is set to 'off'.",
  "Status": "Failure"
}
PUT /api/app/v1/sys/time/ntp/sync

Sync NTP

New in version 1.0.

Note

NTP must be enabled to sync

Response Headers:
 
Status Codes:
Accepted Authorization:
 

admin, audit

Example 1 - Request: Sync NTP:

PUT /api/app/v1/sys/time/ntp/sync HTTP/1.1
Accept: text/html

Example 1 - Response: Sync NTP:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "Success"
}

Example 2 - Request: Attempt to Sync Disabled NTP:

PUT /api/app/v1/sys/time/ntp/sync HTTP/1.1
Accept: text/html

Example 2 - Response: Attempt to Sync Disabled NTP:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Reason": "The status of NTP service is off.",
  "Status": "Failure"
}
GET /api/app/v1/sys/time/timezone

Return system timezone.

New in version 1.0.

Response Headers:
 
Status Codes:
Accepted Authorization:
 

admin, audit

Example 1 - Request: Get system timezone:

GET /api/app/v1/sys/time/clock HTTP/1.1
Accept: text/html

Example 1 - Response: Get system timezone:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "clock": "2017-05-09  14:12:49"
}
PUT /api/app/v1/sys/time/timezone

Set timezone

New in version 1.0.

Note

use the GET /api/app/v1/sys/time/timezone/list call to get a list of timezones

Query Parameters:
 
  • zone (optional) – Zone information
  • index (optional) – Index of timezone from timezone info
Response Headers:
 
Status Codes:
Accepted Authorization:
 

admin

Example 1 - Request: Set system timezone to Central Time with zone parameter:

PUT /api/app/v1/sys/time/timezone?zone=Central%20Time HTTP/1.1
Accept: text/html

Example 1 - Response: Set system timezone to Central Time with zone parameter:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "Success"
}

Example 2 - Request: Set system timezone to Central Time with index parameter:

PUT /api/app/v1/sys/time/timezone?index=9 HTTP/1.1
Accept: text/html

Example 2 - Response: Set system timezone to Central Time with index parameter:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "Success"
}

Example 3 - Request: Attempt to set system timezone to vague Central instead of Central Time:

PUT /api/app/v1/sys/time/timezone?zone=Central HTTP/1.1
Accept: text/html

Example 3 - Response: Attempt to set system timezone to vague Central instead of Central Time:

HTTP/1.1 400 BAD REQUEST
Content-Type: application/json

{
  "Data": [
    {
      "timezone": "America/Chicago",
      "zone": "(GMT-06:00) Central Time(US & Canada)",
      "zone_index": 9
    },
    {
      "timezone": "America/Swift_Current",
      "zone": "(GMT-06:00) Central America",
      "zone_index": 12
    },
    {
      "timezone": "Africa/Algiers",
      "zone": "(GMT+01:00) West Central Africa",
      "zone_index": 33
    }
  ],
  "Reason": "Found more then one timezone with 'Central'",
  "Status": "Failure"
}
GET /api/app/v1/sys/time/timezone/list

Return a list of all timezones and data.

New in version 1.0.

Response Headers:
 
Status Codes:
Accepted Authorization:
 

admin, audit

Example 1 - Request: Get timezone data:

GET /api/app/v1/sys/time/clock HTTP/1.1
Accept: text/html

Example 1 - Response: Get timezone data (full response not shown):

HTTP/1.1 200 OK
Content-Type: application/json

{
  "timezone_list": [
    {
      "timezone": "Pacific/Fiji",
      "zone": "(GMT+12:00) Fiji, Kamchatka, Marshall Is.",
      "zone_index": 84
    },
    {
      "timezone": "Pacific/Kwajalein",
      "zone": "(GMT+12:00) Eniwetok, Kwajalein",
      "zone_index": 85
    },
    {
      "timezone": "Pacific/Enderbury",
      "zone": "(GMT+13:00) Nuku'alofa",
      "zone_index": 86
    }
  ]
}