The <copy-config> operation saves the data in <source/> to <target/>.
Currently, only Huawei YANG files can be imported or exported.
The <copy-config> operation is closely related to the current device configuration. This operation is only used to import data for an unconfigured device and export device configuration data. It is not used to modify the current device configuration.
Table 1 describes the mapping between <source/> and <target/>.
<source/> |
<target/> |
Remarks |
---|---|---|
<startup/> |
<url/> |
If <source/> does not exist or the URL is unreachable, an error message is displayed, and packets cannot be delivered. |
<candidate/> |
<url/> |
If the URL is unreachable, an error message is displayed, and packets cannot be delivered. |
<running/> |
<startup/> |
If <startup/> exists, its content is overwritten. |
<candidate/> |
- |
|
<url/> |
If the URL is unreachable, an error message is displayed, and packets cannot be delivered. |
|
<url/> |
<candidate/> |
If the URL is unreachable, an error message is displayed, and packets cannot be delivered. |
<config/> |
<candidate/> |
- |
RPC request
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <copy-config> <target> <url>file:///eee.xml</url> </target> <source> <running/> </source> </copy-config> </rpc>
RPC reply
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <ok/> </rpc-reply>
RPC request
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <copy-config> <target> <url>ftp://root:root@10.1.1.1/abc.xml</url> </target> <source> <candidate/> </source> </copy-config> </rpc>
RPC reply
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <ok/> </rpc-reply>
Use SFTP to copy remote configuration data to the <candidate/> database in URL mode.
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <copy-config> <target> <candidate/> </target> <source> <url>sftp://root:root@10.1.1.1/abc.xml</url> </source> </copy-config> </rpc>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <ok/> </rpc-reply>