Make configuration changes — <edit-config>
An example of how to use the <edit-config>
RPC to modify the candidate datastore.
You can add, modify, replace or delete the configuration. You can make multiple <edit-config>
RPCs if you wish.
Depending on the precise parameters that you use in your request, the operation may terminate on an error, or continue.
Note that <edit-config>
will affect only the part of the configuration that you explicitly reference. You should not use it to replace the whole
configuration — for that, use <copy-config>
instead.
A <default-operation>
set to replace
will only replace the configuration where you provide a replacement, and
nowhere else.
In this example, we set the description on a loopback interface. Note that the operation
attribute must use the namespace of the
<config>
operation.
<edit-config>
RPC.<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<candidate/>
</target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<interfaces xmlns="urn:vyatta.com:mgmt:vyatta-interfaces:1">
<loopback xmlns="urn:vyatta.com:mgmt:vyatta-interfaces-loopback:1">
<tagnode>lo</tagnode>
<description xc:operation="merge">Set from NETCONF</description>
</loopback>
</interfaces>
</config>
</edit-config>
</rpc>
]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
]]>]]>