This section provides a sample of enabling the NTP server function using the edit-config method.
Operation |
XPATH |
|---|---|
edit-config |
/ietf-system:system/huawei-ntp:ntp-server |
Data requirement
Item |
Data |
Description |
|---|---|---|
IPv4 NTP server function |
true |
Enables the IPv4 NTP server function. |
IPv6 NTP server function |
false |
Disable the IPv6 NTP server function. |
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">
<huawei-ntp:ntp-server xmlns:huawei-ntp="urn:huawei:params:xml:ns:yang:huawei-ntp">
<huawei-ntp:ipv4-enable>true</huawei-ntp:ipv4-enable>
<huawei-ntp:ipv6-enable>false</huawei-ntp:ipv6-enable>
</huawei-ntp:ntp-server>
</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="1"> <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="1">
<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>