---
title: NTP
slug: aidc/ntp
createdAt: 2025-12-29T10:34:40.373Z
---

## <font color="#1d50a2">URLs Summary</font>

| **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/&#x7B;key-id}     | Y       | Y        | N         | N       | Y          |
| /rest/v1/running/ntp-servers/&#x7B;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          |

## <font color="#1d50a2">Examples</font>

### <font color="#1d50a2">NTP synchronize</font>

```json
POST HTTPS://{switch IP}/rest/v1/rpc/ntp-synchronize
{
    "server": "192.0.0.1"
}
```

### <font color="#1d50a2">Show ntp information</font>

```json
POST HTTPS://{switch IP}/rest/v1/rpc/show-ntp
```

### <font color="#1d50a2">Modify global ntp.</font>

```json
PATCH HTTPS://{switch IP}/rest/v1/running/ntp-global
{
    "enabled": "false",
    "authentication": "true",
    "fast-jump": "false",
    "vrf": "mgmt"
}
```

### <font color="#1d50a2">Update NTP global configuration</font>

```json
PATCH HTTPS://{switch IP}/rest/v1/running/ntp-global
[{
    "op": "add",
    "path": "source-interface",
    "value": ["Loopback0"]
},
{
    "op": "remove",
    "path": "source-interface/Mgmt0"
}]
```

### <font color="#1d50a2">Create a NTP key.</font>

```json
POST HTTPS://{switch IP}/rest/v1/running/ntp-keys
{
    "key-id": 3,
    "type": "sha256",
    "key-value": "password"
}
```

### <font color="#1d50a2">Create a NTP server.</font>

```json
POST HTTPS://{switch IP}/rest/v1/running/ntp-servers
{
    "address": "10.250.0.2",
    "key-id": 1
}
```

## <font color="#1d50a2">Properties Descriptions</font>

### <font color="#1d50a2">NTP global</font>

**Tree Diagrams**

```plaintext
  +--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.<br />Global configuration of ntp                                                                                                                                                                                                                                                                                     |
| enabled          | O            | "true"<br />"false"                                                                        | (sub-property of ntp-global)<br />The NTP state.<br />Default value: "true"                                                                                                                                                                                                                                                                                     |
| authentication   | O            | "true"<br />"false"                                                                        | (sub-property of ntp-global)<br />The NTP authentication state.<br />Default value: "false"                                                                                                                                                                                                                                                                     |
| fast-jump        | O            | "true"<br />"false"                                                                        | (sub-property of ntp-global)<br />Configure NTP synchronous step mode to fast jump.                                                                                                                                                                                                                                                                             |
| vrf              | O            | "mgmt"<br />"default"                                                                      | (sub-property of ntp-global)<br />NTP can be enabled only in one VRF at a time. In this revision, it is either default VRF or Management VRF.<br />Default value: "default"                                                                                                                                                                                     |
| source-interface | O            | Ethernet name<br />Link-aggregation name<br />Vlan1..4094<br />Loopback0..199<br />"Mgmt0" | (sub-property of ntp-global)<br />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. |

### <font color="#1d50a2">NTP servers</font>

**Tree Diagrams**

```plaintext
  +--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<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX | (sub-property of ntp-servers)<br />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)<br />                                                                                                             |

### <font color="#1d50a2">NTP keys</font>

**Tree Diagrams**

```plaintext
  +--rw ntp-keys
     +--rw ntp-key* [key-id]
        +--rw key-id
        +--rw type
        +--rw key-value
```

**Table of Properties**

| **Name**  | **Required** | **Type/Range**                                              | **Description**                                                                                                                   |
| --------- | ------------ | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| ntp-keys  | M            |                                                             | Path-only node, has no configurable value.<br />NTP authentication key configuration                                              |
| key-id    | M            | 0..4294967295                                               | (sub-property of ntp-keys)<br />The key-id is used to identify the key, and the key-id is unique.                                 |
| type      | M            | "md5"<br />"sha1"<br />"sha256"<br />"sha384"<br />"sha512" | (sub-property of ntp-keys)<br />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)<br />The value is used to store the encrypted key value.                                               |

### <font color="#1d50a2">ntp-synchronize</font>

**Tree Diagrams**

```plaintext
    +---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.<br />Synchronize the time with the ntp server.                                                              |
| server          | M            | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX | (sub-property of input)<br />The server address is used to synchronize the time with the server.                                                       |
| unprivileged    | O            | "true"<br />"false"                         | (sub-property of input)<br />The unprivileged is used to determine whether the user has the right to synchronize the time.<br />Default value: "false" |
| text            | RO           | string                                      | (sub-property of output)                                                                                                                               |

### <font color="#1d50a2">show-ntp</font>

**Tree Diagrams**

```plaintext
    +---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.<br />Display NTP info. |
| text     | RO           | string         | (sub-property of output)                                          |

### <font color="#1d50a2">clock-datetime</font>

**Tree Diagrams**

```plaintext
    +---x clock-datetime
       +---w input
          +---w YMD
          +---w HMS
```

**Table of Properties**

| **Name**       | **Required** | **Type/Range** | **Description**                                                                     |
| -------------- | ------------ | -------------- | ----------------------------------------------------------------------------------- |
| clock-datetime | M            |                | Path-only node, has no configurable value.<br />Set the system clock date and time. |
| YMD            | M            | string         | (sub-property of input)                                                             |
| HMS            | M            | string         | (sub-property of input)                                                             |

