The <delete-config> operation deletes the <startup/> configuration database or deletes configuration data from the <candidate/> configuration database.
If the <delete-config> operation is successful, the server sends an <rpc-reply> element containing an <ok> element. Otherwise, the server sends an <rpc-reply> element containing an <rpc-error> element.
Delete the <startup/> configuration database:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <delete-config> <target> <startup/> </target> </delete-config> </rpc>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <ok/> </rpc-reply>
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <delete-config> <target> <nc-ext:candidate xmlns:nc-ext="urn:huawei:yang:huawei-ietf-netconf-ext"/> </target> </delete-config> </rpc>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <ok/> </rpc-reply>
This operation requires two-phase commitment. That is, a commit packet needs to be delivered to commit the configuration to the <running/> database.
After the <delete-config> operation is performed to delete configuration data from the <candidate/> database, if the commit operation is directly delivered, the configuration information of the device is deleted. As a result, the NETCONF session is disconnected. If you need to reconnect to the device, you must reconfigure the login information.