Network Time Protocol (NTP)

Resource Summary for NTP

HTTP Method
Resource
URL (BaseURL)
GET
POST
PUT
DELETE

NTP server

/api/v1/global/ntp/servers

Y

Y

NA

N

/api/v1/global/ntp/servers/{ntp-server}

Y

N

N

Y

Collection of active servers

/api/v1/global/ntp/servers/active

Y

N

N

Y

NTP status

/api/v1/global/ntp/status

Y

N

N

N

NTP Server Collection Resource

History

 

Release
Modification

IOS XE 3.10

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties

Property
Type
Required for POST and PUT
Description

kind

string

Mandatory

Object type. Always “collection#ntp-server”

ntp-servers

array

Mandatory

Array of ntp server objects

ntp-servers [ ].kind

string

Mandatory

Array object type. Always “object#ntp-server”

ntp-servers [ ].ip-address

string

Mandatory

CIDR format: x.x.x.x/nn or name

JSON Representation

{
"kind": "collection#ntp-server",
"items": [
{ JSON object with kind "object#ntp-server" }
]
}

Create NTP Server

Resource URI

Verb
URI

POST

/api/v1/global/ntp/servers

Example

JSON Request

POST /api/v1/global/ntp/servers
 
Content-Type: application/json
Accept: application/json
 
{
"ip-address": "173.25.25.25"
}

Example

JSON Response

201 Created
Location: http://host/api/v1/global/ntp/servers/173.25.25.25

Retrieve All NTP Servers

Resource URI

Verb
URI

GET

/api/v1/global/ntp/servers

Properties for Retrieve All

Property
Type
Description

Hostname

string

NTP server hostname. Either an IP address or a hostname must be configured. Read-only once the resource is created.

Example

JSON Request

GET /api/v1/global/ntp/servers
Accept: application/json

JSON Response

200 ok
 
Content-Type: application/json
 
{
"kind": "collection#ntp-server"
"items": [
{
"kind": "object#ntp-server",
"ip-address": "173.25.25.25"
},
{
"kind": "object#ntp-server",
"ip-address": "173.25.25.26"
},
]
}

Retrieve a NTP Server

Resource URI

Verb
URI

GET

/api/v1/global/ntp/servers/{ntp-server-id}

Example

JSON Request

GET /api/v1/global/ntp/servers/172.25.25.25
Accept: application/json

JSON Response

200 Ok
 
Content-Type: application/json
{
"kind": "object#ntp-server",
"ip-address": "172.25.25.25"
}

Delete a NTP Server

Resource URI

Verb
URI

DELETE

/api/v1/global/ntp/servers/{ntp-server-id}

Example

JSON Request

DELETE /api/v1/global/ntp/servers/172.25.25.25
Accept: application/json

JSON Response

204 No Content

NTP Status

History

 

Release
Modification

IOS XE 3.10

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties

Property
Type
Description

kind

string

“object#ntp-status”

synchronized

boolean

“false” if system is not synchronized to any NTP peer, “true” otherwise.

stratum

number

NTP stratum of this system.

reference

string

IP address of peer that the system is synchronized to. For IPv4 address, the address format is x.x.x.x

Other possible values:

INIT (initial state) when unsynchronized

LOOP – Sync to local clock

STEP – clock stepped

DOWN – unspecified stratum case

nominal-freq

number

Nominal frequency of system hardware clock (in Hertz).

actual-freq

number

Measured frequency of system hardware clock (in Hertz).

precision

string

Precision of the clock of this system (in Hertz).

reference-time

number

Reference time stamp in hex UTC.

clock-offset

number

Offset of the system clock to synchronized peer. It is in ms.

root-delay

number

Total delay along path to root clock. It is in ms.

root-dispersion

number

Dispersion of root path. It is in ms.

peer-dispersion

number

Dispersion of synchronized peer. It is in ms.

ntp-uptime

number

The uptime of the NTP entity, (i.e., the time since ntp was (re-)initialized not sysUptime!). The unit is timeticks (1/100 of seconds). “xx:xx:xx UTC”

resolution

number

The time resolution in integer format, where the resolution is represented as divisions of a second—for example, a value of 1000 translates to 1.0 ms

last-update

number

Indicates when the clock was last updated in milliseconds. The value is 0 if it’s never been updated.

loop-filter-state

string

The clock state: NSET(never set), FSET(drift set from file), SPIK(Spike), FREQ(Drift being measured),CTRL(normal controlled loop), UNSP(unspecified), UNKN (unknown)

drift

number

The frequency offset between the local clock hardware and the authoritative time from the NTP servers. The value is X seconds per second.

System-poll-interval

number

The value is in seconds.

JSON Representation

{
"kind": "object#ntp-status",
"synchronized": {boolean},
"statum": {number},
"reference": "{ipaddress}",
"nominal-freq": {number},
"actual-freq": {number},
"precision": {number},
"reference-time": {number},
"clock-offset": {number},
"root-delay": {number},
"root-dispersion": {number},
"peer-dispersion": {number},
"ntp-uptime": {number},
"resolution": {number},
 
"loop-filter-state": "{string}",
"drift": {number},
"system-poll-interval": {number},
"last-update": {number}
}

Retrieve NTP Status

Resource URI

Verb
URI

GET

/api/v1/global/ntp/status

Example

JSON Request

GET /api/v1/global/ntp/status
Accept: application/json

JSON Response

200 Ok
 
Content-Type: application/json
{
"kind": "object#ntp-status",
"synchronized": true,
"statum": 4,
"reference": 192.168.13.57,
"nominal-freq": 250.0000,
"actual-freq": 249.9990,
"precision": 2**19,
"reference-time": AFE2525E.70597B34,
"clock-offset": 7.33,
"root-delay": 133.36,
"root-dispersion": 126.28,
"peer-dispersion": 5.98,
"loop-filter-state": "FSET",
"drift": 0.0,
"system-poll-interval": 8,
"ntp-uptime": 0,
"last-update": 0
}

NTP Associations

History

 

Release
Modification

IOS XE 3.10

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties

Property
Type
Description

kind

string

Must be collection#ntp-server-active

peer-info

string

Can be one or more of the following:

  • “Synchronized to this peer”
  • “Almost synchronized to this peer”
  • “Peer selected for possible synchronization”
  • “Peer is a candidate for selection”
  • “Peer is statically configured”

Items

array

List of NTP servers’ run-time information

Items-kind

string

Must be object#ntp-server-active

address

ipaddress

Address of peer.

Ref-clock

ipaddress

Address of reference clock of peer.

Stratum

number

Stratum of peer.

when

number

Time since last NTP packet was received from peer.

poll

number

Polling interval (in seconds).

reach

number

Peer reachability (bit string, in octal).

delay

number

Round-trip delay to peer (in milliseconds).

offset

number

Relative time of peer clock to local clock (in milliseconds).

dispersion

number

Dispersion

JSON Representation

{
"kind": "collection#ntp-server-active",
"items": [
{
"kind": "object#ntp-server-active",
"address": "{ipaddress}",
"peer-info": "{string}",
"ref-clock": "{ipaddress}",
"stratum": {number},
"when": {number},
"poll": {number},
"reach": {number},
"delay": {number},
"offset": {number},
"dispersion": {number}
}
]
}

Retrieve NTP Server Run-time Information

Resource URI

Verb
URI

GET

/api/v1/global/ntp/servers/active

Example

JSON Request

GET /api/v1/global/ntp/servers/active
Accept: application/json

JSON Response

200 Ok
 
Content-Type: application/json
{
"kind": "collection#ntp-server-active",
"items": [
{
"kind": "object#ntp-server-active",
"address": "172.31.32.2",
"peer-info": "peer is statically configured",
"ref-clock": "172.31.32.1",
"st": 5,
"when": 29,
"poll": 1024,
"reach": 377,
"delay": "4.2",
"offset": "-8.59",
"dispersion": "1.6"
},
 
{
"kind": "object#ntp-server-active",
"address": "192.168.13.57",
"peer-info": "peer is statically configured. Peer selected for possible synchronization"
"ref-clock": "192.168.1.111",
"st": 3,
"when": 32,
"poll": 128,
"reach": 377,
"delay": "7.9",
"offset": "11.18",
"dispersion": "3.6"
}
]
}