Need of self closed config identifier in edit-config

asked 2017-05-25 12:24:38 -0700

babukt gravatar image

updated 2017-05-25 21:43:34 -0700

In case edit-config either POST/PUT requests, I could two edit-config setconf rpc's are issued.

First RPC : edit-config with self closed config identifier before locking target candidate config database

Second RPC : edit-config with the config in PUT/POST body after lock candidate config database

My question here is what is the need for first rpc ?

Please see below example to add interfaces config:

POST URI:

http://10.209.1.9:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/bag0r_odl/yang-ext:mount/configuration:configuration

Body:

<interfaces xmlns="http://yang.abc.net/yang/1.1/jc/configuration/junos/17.3">
        <interface>
            <name>ge-0/0/1</name>
            <unit>
                <name>0</name>
                <family>
                    <inet>
                        <address>
                            <name>11.1.1.1/30</name>
                        </address>
                    </inet>
                </family>
            </unit>
        </interface>
    </interfaces>

Netconf rpc requests from ODL controller towards netconf device:

<rpc message-id="m-0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config>
<source>
<running/>
</source>
<filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
<configuration xmlns="http://yang.abc.net/yang/1.1/jc/x.y">
<interfaces/>
</configuration>
</filter>
</get-config>
</rpc>
]]>]]>
May 26 00:37:33 [NETCONF] - [3975] Outgoing: <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.abc.net/junos/17.3D0/junos" message-id="m-0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
May 26 00:37:33 [NETCONF] - [3975] Outgoing: <nc:data>
May 26 00:37:33 [NETCONF] - [3975] Outgoing: </nc:data>
May 26 00:37:33 [NETCONF] - [3975] Outgoing: </nc:rpc-reply>
May 26 00:37:33 [NETCONF] - [3975] Outgoing: ]]>]]>
May 26 00:37:33 [NETCONF] - [3975] Incoming: <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rpc message-id="m-1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<lock>
<target>
<candidate/>
</target>
</lock>
</rpc>
]]>]]>
May 26 00:37:33 [NETCONF] - [3975] Outgoing: <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.abc.net/junos/17.3D0/junos" message-id="m-1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
May 26 00:37:33 [NETCONF] - [3975] Outgoing: <nc:ok/>
May 26 00:37:33 [NETCONF] - [3975] Outgoing: </nc:rpc-reply>
May 26 00:37:33 [NETCONF] - [3975] Outgoing: ]]>]]>
May 26 00:37:33 [NETCONF] - [3975] Incoming: <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rpc message-id="m-2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<candidate/>
</target>
<config>
<configuration xmlns="http://yang.abc.net/yang/1.1/jc/x.y"/>
</config>
</edit-config>
</rpc>
]]>]]><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rpc message-id="m-3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<candidate/>
</target>
<default-operation>none</default-operation>
<config>
<configuration xmlns="http://yang.abc.net/yang/1.1/jc/x.y">
<interfaces xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
<interface>
<name>ge-0/0/1</name>
<unit>
<name>0</name>
<family>
<inet>
<address>
<name>11.1.1.1/30</name>
</address>
</inet>
</family>
</unit>
</interface ...
(more)
edit retag flag offensive close merge delete