<copy-config>

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/>.

Table 1 <copy-config> operation mappings 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/>

-

The protocols and formats supported by <url/> are as follows:
  • FTP. Format: <url>ftp://123:123@10.1.1.1/abc.xml</url>
  • SFTP. Format: <url>sftp://123:123@10.1.1.1/abc.xml</url>
  • HTTP. Format: <url>http://10.1.1.1:8080/abc.xml</url>
  • HTTPS. Format: <url>https://10.1.1.1:8080/abc.xml</url>
  • File. Format: <url>file:///abc.xml</url>
  • HTTP domain name Format: <url>http://host:20180/abc.xml</url>
  • HTTPS domain name. Format: <url>https://host:20180/abc.xml</url>
Save the configuration data in the <running/> configuration database to the local eee.xml file:
  • 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>
Use FTP to save the configuration data in the <candidate/> configuration database to a remote path specified by the URL:
  • 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.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >