URL
- The <edit-config> operation commits the configuration file in a specified path to the <candidate/> or <running/> configuration database.
- The <copy-config> operation copies configuration data in the <candidate/> or <running/> configuration database to a file in a specified path.
- The SFTP or FTP protocol is used to query files on an SFTP or FTP server. The path format is ftp://user name:password@IP address of the SFTP or FTP server/file directory/file name.
- The file protocol is used to query local files. The path format is file:///file directory/file name.
The HTTP or HTTPS protocol is used to search for files on an HTTP or HTTPS server. The path format is http (or https)://IP address (or DNS) of the HTTP or HTTPS server:port number/file directory/file name.
The file name is a string of case-sensitive characters starting with an underscore (_) or a letter. It only supports underscores, digits, and letters. The dot (.) can only be used in the file name extension, and only one dot is supported. The file name cannot contain more than 256 characters, including a path.
For the <copy-config> operation, if the file specified in the <url> element does not exist, the file is directly created. If the file exists, it is overwritten.
For the <edit-config> operation, the file specified in the <url> element must exist.
The HTTP or HTTPS protocol supports only the <edit-config> operation in a YANG model.
Copy data in the <running/> configuration database to the local abc.xml file:
RPC request:
<?xml version="1.0" encoding="UTF-8"?> <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <copy-config> <target> <url>file:///abc.xml</url> </target> <source> <running/> </source> </copy-config> </rpc>
RPC reply:
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <ok/> </rpc>
Commit data in the config.xml file on the FTP server to the <candidate/> configuration database:
RPC request:
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <edit-config> <target> <candidate/> </target> <url>ftp://root:root@10.1.1.2/config.xml</url> </edit-config> </rpc>
RPC reply:
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <ok/> </rpc>
Commit data in the config.xml file on the HTTP server to the <candidate/> configuration database:
RPC request:
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <edit-config> <target> <candidate/> </target> <url>http://192.168.1.1:8080/config.xml</url> </edit-config> </rpc>
- RPC reply:
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <ok/> </rpc>