cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2437
Views
1
Helpful
4
Replies

IOS XR 9000 Netconf-yang Help

olaf.debree
Level 1
Level 1

Hi All,

I thought i would post this here as it did not receive much feed back on he support forum....perhaps the wrong place for an api question

I'm wondering if some one may assist with netconf-yang on IOS-XR 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

1 Accepted Solution

Accepted Solutions

yawming
Cisco Employee
Cisco Employee

We can do the no shutdown operation as follows:

*****************************

Jan 19, 2016: 19:20:39:287770

*****************************

NETCONF SEND

------------

<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

<edit-config>

<target><candidate/></target>

<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">

<interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg">

<interface-configuration>

<shutdown xc:operation="delete"/>

<active>act</active>

<interface-name>HundredGigE0/4/0/0</interface-name>

</interface-configuration>

</interface-configurations>

</config>

</edit-config>

</rpc>

corresponding config change:

RP/0/RP0/CPU0:fretta53#show configuration commit changes last 1

Building configuration...

!! IOS XR Configuration version = 6.0.1.14I

interface HundredGigE0/4/0/0

no shutdown

!

end

View solution in original post

4 Replies 4

yawming
Cisco Employee
Cisco Employee

We can do the no shutdown operation as follows:

*****************************

Jan 19, 2016: 19:20:39:287770

*****************************

NETCONF SEND

------------

<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

<edit-config>

<target><candidate/></target>

<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">

<interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg">

<interface-configuration>

<shutdown xc:operation="delete"/>

<active>act</active>

<interface-name>HundredGigE0/4/0/0</interface-name>

</interface-configuration>

</interface-configurations>

</config>

</edit-config>

</rpc>

corresponding config change:

RP/0/RP0/CPU0:fretta53#show configuration commit changes last 1

Building configuration...

!! IOS XR Configuration version = 6.0.1.14I

interface HundredGigE0/4/0/0

no shutdown

!

end

Thanks yawchen, this works perfectly!!

Is it actually documented anywhere?

Thanks again

Olaf

Olaf,

You should take a look at YDK to dramatically simplify model-driven automation.  Here are some pointers you may find useful:

https://developer.cisco.com/site/ydk/

NANOG 68 Ok We Got YANG Data Models Now What - YouTube

Plus, there's a community dedicated to the APIs:

YANG Development Kit (YDK)

HTH!

Thank you, i tried it and it actually works, but couldn't guess it anyway.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: