NTP
| URL | GET | POST | PATCH | PUT | DELETE |
|---|---|---|---|---|---|
| /rest/v1/rpc/clock-datetime | N | Y | N | N | N |
| /rest/v1/running/ntp-global | Y | N | Y | N | N |
| /rest/v1/running/ntp-keys/{key-id} | Y | Y | N | N | Y |
| /rest/v1/running/ntp-servers/{address} | Y | Y | N | N | Y |
| /rest/v1/rpc/ntp-synchronize | N | Y | N | N | N |
| /rest/v1/rpc/show-ntp | N | Y | N | N | N |
Examples
Section titled “Examples”NTP synchronize
Section titled “NTP synchronize”POST HTTPS://{switch IP}/rest/v1/rpc/ntp-synchronize{ "server": "192.0.0.1"}Show ntp information
Section titled “Show ntp information”POST HTTPS://{switch IP}/rest/v1/rpc/show-ntpModify global ntp.
Section titled “Modify global ntp.”PATCH HTTPS://{switch IP}/rest/v1/running/ntp-global{ "enabled": "false", "authentication": "true", "fast-jump": "false", "vrf": "mgmt"}Update NTP global configuration
Section titled “Update NTP global configuration”PATCH HTTPS://{switch IP}/rest/v1/running/ntp-global[{ "op": "add", "path": "source-interface", "value": ["Loopback0"]},{ "op": "remove", "path": "source-interface/Mgmt0"}]Create a NTP key.
Section titled “Create a NTP key.”POST HTTPS://{switch IP}/rest/v1/running/ntp-keys{ "key-id": 3, "type": "sha256", "key-value": "password"}Create a NTP server.
Section titled “Create a NTP server.”POST HTTPS://{switch IP}/rest/v1/running/ntp-servers{ "address": "10.250.0.2", "key-id": 1}Properties Descriptions
Section titled “Properties Descriptions”NTP global
Section titled “NTP global”Tree Diagrams
+--rw ntp-global | +--rw enabled? | +--rw authentication? | +--rw fast-jump? | +--rw vrf? | +--rw source-interface*Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| ntp-global | M | Path-only node, has no configurable value. | |
| Global configuration of ntp | |||
| enabled | O | ”true" | |
| "false” | (sub-property of ntp-global) | ||
| The NTP state. | |||
| Default value: “true” | |||
| authentication | O | ”true" | |
| "false” | (sub-property of ntp-global) | ||
| The NTP authentication state. | |||
| Default value: “false” | |||
| fast-jump | O | ”true" | |
| "false” | (sub-property of ntp-global) | ||
| Configure NTP synchronous step mode to fast jump. | |||
| vrf | O | ”mgmt" | |
| "default” | (sub-property of ntp-global) | ||
| NTP can be enabled only in one VRF at a time. In this revision, it is either default VRF or Management VRF. | |||
| Default value: “default” | |||
| source-interface | O | Ethernet name | |
| Link-aggregation name | |||
| Vlan1..4094 | |||
| Loopback0..199 | |||
| ”Mgmt0” | (sub-property of ntp-global) | ||
| This is the interface whose IP address is used as the source IP address for generating NTP traffic. User is required to make sure that the NTP server is reachable via this IP address and the same IP address is reachable from the NTP server. The source interface should be in the same VRF as the VRF NTP is enabled in. |
NTP servers
Section titled “NTP servers”Tree Diagrams
+--rw ntp-servers | +--rw ntp-server* [address] | +--rw address | +--rw key-id?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| ntp-servers | M | Path-only node, has no configurable value. | |
| address | M | A.B.C.D | |
| XX:XX:XX:XX:XX:XX:XX:XX | (sub-property of ntp-servers) | ||
| This server address is a simple ntp server address, It is only used to synchronize the time with the server. | |||
| key-id | O | 0..4294967295 | (sub-property of ntp-servers) |
|NTP keys
Section titled “NTP keys”Tree Diagrams
+--rw ntp-keys +--rw ntp-key* [key-id] +--rw key-id +--rw type +--rw key-valueTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| ntp-keys | M | Path-only node, has no configurable value. | |
| NTP authentication key configuration | |||
| key-id | M | 0..4294967295 | (sub-property of ntp-keys) |
| The key-id is used to identify the key, and the key-id is unique. | |||
| type | M | ”md5" | |
| "sha1" | |||
| "sha256" | |||
| "sha384" | |||
| "sha512” | (sub-property of ntp-keys) | ||
| The type is used to store the key encryption type, and the key encryption type is md5 by default. | |||
| key-value | M | string | (sub-property of ntp-keys) |
| The value is used to store the encrypted key value. |
ntp-synchronize
Section titled “ntp-synchronize”Tree Diagrams
+---x ntp-synchronize | +---w input | | +---w server | | +---w unprivileged? | +--ro output | +--ro text?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| ntp-synchronize | M | Path-only node, has no configurable value. | |
| Synchronize the time with the ntp server. | |||
| server | M | A.B.C.D | |
| XX:XX:XX:XX:XX:XX:XX:XX | (sub-property of input) | ||
| The server address is used to synchronize the time with the server. | |||
| unprivileged | O | ”true" | |
| "false” | (sub-property of input) | ||
| The unprivileged is used to determine whether the user has the right to synchronize the time. | |||
| Default value: “false” | |||
| text | RO | string | (sub-property of output) |
show-ntp
Section titled “show-ntp”Tree Diagrams
+---x show-ntp | +--ro output | +--ro text?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-ntp | M | Path-only node, has no configurable value. | |
| Display NTP info. | |||
| text | RO | string | (sub-property of output) |
clock-datetime
Section titled “clock-datetime”Tree Diagrams
+---x clock-datetime +---w input +---w YMD +---w HMSTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| clock-datetime | M | Path-only node, has no configurable value. | |
| Set the system clock date and time. | |||
| YMD | M | string | (sub-property of input) |
| HMS | M | string | (sub-property of input) |