-
Notifications
You must be signed in to change notification settings - Fork 3
get_date_time
Alberto Gonzalez edited this page Jun 19, 2017
·
2 revisions
Returns the date/time, timezone, and NTP server configuration for the specified system.
GET /api/date-time/?sid={sid}
Host: <server host name>
Accept: application/json
AuthToken: <authentication token returned from authenticate>
Optional filters include:
200 success
| Index | Value | Type | Returned |
|---|---|---|---|
| year | current year | long | always |
| month | current month | long | always |
| day | current day | long | always |
| hour | current hour | long | always |
| minute | current minute | long | always |
| second | current second | long | always |
| tz | current timezone | string | always |
| tzOffset | offset in seconds from GMT | int | always |
| ntp | array of ntp settings | array | always (empty if not defined) |
The NTP array returned is:
| Index | Value | Type | Returned |
|---|---|---|---|
| enabled | using NTP | boolean | always |
| local | is local time source being used? | boolean | always |
| sync | sync clock with ntp server before starting ntpd or not | boolean | always |
| servers | array of ntp servers as strings | array of strings | always (empty if none defined) |
GET /api/date-time/?sid=1
Host: <server host name>
Accept: application/json
AuthToken: 8a00sjerhterqerjlqkjlk443l4j56869h4f_)(fjdkasHHHHHkdal324
{
"year": 2014,
"month": 9,
"day": 26,
"hour": 4,
"minute": 26,
"second": 4,
"tz": "Australia/Adelaide",
"ntp": {
"enabled": true,
"local": true,
"sync": false,
"server": [
"0.centos.pool.ntp.org",
"1.centos.pool.ntp.org",
"2.centos.pool.ntp.org"
]
}
}