ConfD User Community

How can i use replace operation for the list defined in yang model

Hi All,
I have the list like defined below
grouping route-target-set {
description
"Extended community route-target set ";
list rts {
key “rt” ;
description
“List of route-targets” ;
leaf rt {
type rt-types:route-target;
description “Route target extended community as per RFC4360”;
}
}
I want to replace one value in the list with another value of rt.
Can i use the “replace” operation on it ?

If you set the replace operation on “rts”, it will replace the whole configuration under “rts” with the new config. If this is what you want then it should work.

If “rts” has more than one instance, and you only want to replace one of them, then you will have to delete the instance and create another instance.

An example (This is based on the ConfD example: $CONFD_DIR/examples.confd/cdb_subscription/iter_c):

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"  message-id="1">
 <edit-config>
<target>
  <running/>
</target>
<config>
    <root xmlns="http://tail-f.com/ns/example/root"
            xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
        <node-b>
            <rf-head nc:operation="remove">
                <dn>3</dn>
            </rf-head>
            <rf-head nc:operation="replace">
                <dn>5</dn>
            </rf-head>
        </node-b>
    </root>
</config>
  </edit-config>
</rpc>