ā01-12-2016 02:58 PM
Hi all,
I'm wondering if some one may assist with netconf-yang on IOS-XRv version 6, Cisco documentation seems to be very limited here.
<edit-config> and <commit> seem to work well but i am having trouble with basic things like "no <command>".
Example: "no shutdown" for an interface. the "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"; yang file state that the existence <shutdown> tag will shut the desired interface. So the following XML works fine on an admin up interface.
<edit-config>
<target>
<candidate />
</target>
<config>
<interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg">
<interface-configuration>
<active>act</active>
<interface-name>GigabitEthernet0/0/0/1</interface-name>
<InterfaceModeNonPhysical>0</InterfaceModeNonPhysical>
<shutdown/>
</interface-configuration>
</interface-configurations>
</config>
</edit-config>
There seems to be no reference to how to enable "no shut" the interface. I would except the below
<edit-config>
<target>
<candidate />
</target>
<config>
<interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg">
<interface-configuration>
<active>act</active>
<interface-name>GigabitEthernet0/0/0/1</interface-name>
<InterfaceModeNonPhysical>0</InterfaceModeNonPhysical>
</interface-configuration>
</interface-configurations>
</config>
</edit-config>
This is accepted by the router and committed but the interface admin state does not change
Thanks in advance
ā05-19-2023 07:12 AM
I tried <shutdown>false</shutdown> but got rpc bad tag error !
ā05-19-2023 01:16 PM
To explicitly negate the shutdown node, which I suspect is a leaf of type "empty" - which is why <shutdown>false</shutdown> doesn't work, you'd need to send the node with a delete function, something like:
<shutdown xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete"/>
ā01-12-2024 02:56 PM
Delete will work once, if you try to run it again it will complain because the shutdown statement is "false"
The right way to do it is <shutdown xc:operation="remove"/> as it will ignore the shutdown statement if it's not already present in the config. (thanks to my co-worker for the help on this !)
Hope it helps
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide