cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
1032
Views
0
Helpful
3
Replies

IOS XR 9000 Netconf-yang

olaf.debree
Level 1
Level 1

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

3 Replies 3

a.ala
Level 1
Level 1

I tried <shutdown>false</shutdown> but got rpc bad tag error !

Fredrik Lonnman
Level 1
Level 1

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"/>

 

nicmcl
Cisco Employee
Cisco Employee

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