This section describes provides a sample of configuring NTP using the edit-config method.
Operation |
XPATH |
---|---|
edit-config:create |
/ietf-system:system/ntp |
Data Requirements
Item |
Data |
Description |
---|---|---|
NTP status |
true |
Configure the NTP server. |
NTP server name |
t1 |
|
NTP server address |
10.1.1.1 |
|
NTP server port number |
1025 |
|
Specifying the type as NTP server |
server |
|
Indicating that the device sends a burst of packets when receiving a response of an unreachable server |
true |
|
Specifying the remote server as the preferentially selected server |
true |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <sys:system xmlns:sys="urn:ietf:params:xml:ns:yang:ietf-system" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="replace"> <sys:ntp> <sys:enabled>true</sys:enabled> <sys:server> <sys:name>t1</sys:name> <sys:udp> <sys:address>10.1.1.1</sys:address> <sys:port>1025</sys:port> </sys:udp> <sys:association-type>server</sys:association-type> <sys:iburst>true</sys:iburst> <sys:prefer>true</sys:prefer> </sys:server> </sys:ntp> </sys:system> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="35"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="36"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-message>parse rpc config error.</error-message> </rpc-error> </rpc-reply>