Leaf-list values cannot be re-ordered using "name" XML attribute in edit-config RPC
getting Error while adding a POLICY with insert -before-after through RPC XML
Use "value" XML attribute instead of "name" in the XML tag of the leaf-list whose entry has to be re-ordered using edit-config RPC. Example: <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6"> <edit-config xmlns:nc='urn:ietf:params:xml:ns:netconf:base:1.0'> <target> <candidate/> </target> <test-option>test-then-set</test-option> <config> <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"> <routing-instances> <instance> <name>RI-FCR-SV-7170</name> <protocols> <bgp> <group> <name>EXTERNAL-PEER</name> <neighbor> <name>111.1.1.6</name> <export insert="before" value="REMOVE-LOCAL-COMMUNITY" >REJECT-BOGON-PRIV-S</export> <import insert="before" value="REJECT-KNOWN-PUBLIC" >REJECT-BOGON-PRIV-S</import> </neighbor> </group> </bgp> </protocols> </instance> </routing-instances> </configuration> </config> </edit-config> </rpc>
NOTE. The above workaround does not work under 'apply-groups' hierarchy
https://gnats.juniper.net/web/default/1802486#external_tab