NTP-Netconf
此内容尚不支持你的语言。
Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /ntp-global | Y | merge, delete | — |
| /ntp-servers/{address} | Y | merge, replace, create, delete | — |
| /show-ntp | — | — | Y |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage NTP configurations on AsterNOS devices.
Modify NTP Global Configurations
Section titled “Modify NTP Global Configurations”Request example to modify Kdump-tools configurations via edit-config.
<config> <top> <ntp-global operation="merge"> <vrf>default</vrf> <source-interface>eth0</source-interface> </ntp-global> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0d9c9ea3-cb6b-4db2-976f-b9dda15b4be1"> <ok/></rpc-reply>Get NTP Global Configurations
Section titled “Get NTP Global Configurations”Request example to retrieve NTP global configurations via get-config with subtree filter.
<filter type="subtree"> <top> <ntp-global/> </top></filter>Response example
<data> <top> <ntp-global xmlns="http://asterfusion.com/ns/yang/asternos-ntp"> <vrf>default</vrf> <source-interface>eth0</source-interface> </ntp-global> </top></data>Create NTP Server
Section titled “Create NTP Server”The NTP server is specified by its hostname or IP address, it can be a public NTP server address or a local NTP server, like: ‘ntp.example.com’ or ‘192.168.1.1’.
Request example to create NTP server via edit-config.
<config> <top> <ntp-servers operation="create"> <ntp-server> <address>pool.ntp.org</address> </ntp-server> <ntp-server> <address>192.168.1.1</address> </ntp-server> </ntp-servers> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:df5299b4-8762-4219-8acb-57c2549a3fdf"> <ok/></rpc-reply>Delete Single NTP Server
Section titled “Delete Single NTP Server”Request example to delete single NTP server via edit-config.
<config> <top> <ntp-servers> <ntp-server operation="delete"> <address>192.168.1.1</address> </ntp-server> </ntp-servers> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5e1e8349-d8e4-4d20-a8e5-89fa83712aee"> <ok/></rpc-reply>Delete All NTP Servers
Section titled “Delete All NTP Servers”Request example to delete all NTP server via edit-config.
<config> <top> <ntp-servers operation="delete"> </ntp-servers> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:70c89d24-6af6-4cd0-b4a8-b20f635779d3"> <ok/></rpc-reply>Get All NTP Server
Section titled “Get All NTP Server”Request example to create NTP server via get-config with subtree filter.
<filter type="subtree"> <top> <ntp-servers/> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:864dfd12-0da9-42be-8753-061261a37b05"> <data> <top> <ntp-servers xmlns="http://asterfusion.com/ns/yang/asternos-ntp"> <ntp-server> <address>192.168.1.1</address> </ntp-server> <ntp-server> <address>pool.ntp.org</address> </ntp-server> </ntp-servers> </top> </data></rpc-reply>Show NTP Status
Section titled “Show NTP Status”Request example to get NTP status via rpc show-ntp
<show-ntp/>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:1f493334-1c53-4739-91a1-129bac3c83e6"> <data xmlns="http://asterfusion.com/ns/yang/asternos-ntp"> MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 192.168.1.1 4 6 17 16 -5986us[ -17ms] +/- 356ms </data></rpc-reply>Properties Descriptions
Section titled “Properties Descriptions”Global configuration of ntp
Section titled “Global configuration of ntp”Tree Diagram
module: asternos-ntp +--rw ntp-global +--rw vrf? string +--rw source-interface? stringTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| ntp-global | M | Path-only node, has no configurable value. Global configuration of ntp | |
| vrf | O | None | 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 PortChannel name VLAN name Loopback name | 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 Diagram
module: asternos-ntp +--rw ntp-servers +--rw ntp-server* [address] +--rw address unionTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| ntp-servers | M | Path-only node, has no configurable value. | |
| ntp-server | M | Path-only node, has no configurable value. List of address sets of the ntp server | |
| address | O | An IPv4 address without a zone index. This type, derived from the type ipv4-address, may be used in situations where the zone is known from the context and no zone index is needed. An IPv6 address without a zone index. This type, derived from the type ipv6-address, may be used in situations where the zone is known from the context and no zone index is needed. | NTP server (IPv4, IPv6, or hostname) |
Show Ntp
Section titled “Show Ntp”Tree Diagram
module: asternos-ntp
rpcs: +---x show-ntp +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-ntp | O | ||
| data | O | A table that show information of NTP |