Datastores
AsterNOS datastore provides a rpc similar to standard NETCONF copy-config.
copy-config rpc support following combines:
- copy configuration data from one datastore to another datastore.
- copy configuration data from datastore to uri.
- copy from uri to uri.
- copy from uri to datastore is not supported.
uri can be file, http, https, scp, sftp, ftp.
- file is a local file on the device.
- http, https, scp, sftp, ftp are remote resource.
- if uri is scp/sftp/ftp, username and password are required in format: protocol://username:password@/path/to/resource.
- if uri is http/https, we assume that uri can be accessed by AsterNOS device.
Copy-config from Running to Startup
Section titled “Copy-config from Running to Startup”Request example to get copy running config to startup config via rpc copy-config
<copy-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <target> <startup/> </target> <source> <running/> </source></copy-config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f50e44bb-af8d-48f9-95be-66f7c82bffd1"> <ok/></rpc-reply>Copy-config from scp to file
Section titled “Copy-config from scp to file”Request example to copy remote file via scp to local file via rpc copy-config
<copy-config> <source>scp://user_admin:password@192.168.18.18:/home/user_admin/config_db_leaf123.json</source> <target>file:///home/admin/config_db_leaf123.json</target></copy-config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:d4a406bd-cc39-487f-a6ff-9ad38885cc51"> <ok/></rpc-reply>You can find config_db_leaf123.json in /home/admin/ after rpc is executed.