Showing results for 
Search instead for 
Did you mean: 





I've been playing with RESTCONF/YANG and a few other product APIs recently, but I'm really struggling with the documentation for the Switches / Routers, and in particular, understanding what YANG models are implemented for what device/IOS.


If I go here for example - - it tells me there are loads of YANG models available for the CSR1K, which conveniently is what's available in the Always-On Sandbox.  I know this is a NETCONF list, but as I understand it, YANG models are independant from the Protocol I'm using, so if they're available for NETCONF they should be available for RESTCONF (right?)


I started with the ubiquitous URI that seems to be in all the documents, just to make sure I'm barking up the right tree - - and it works perfectly, returning a nice list of interfaces, addresses, descriptions, and so on.


Now if I want to switch to using a different resource, say 'Cisco-IOS-XE-cdp' (identified as being a valid resource by the NETCONF Capability URL above) via this URI - - all I get is an error message.  Even if I try this - - or this - - all I ever get back is;


    "errors": {
        "error": [
                "error-message": "uri keypath not found",
                "error-tag": "invalid-value",
                "error-type": "application"


The same seems to be true for just about whatever I try, and I can't believe trial and error is the best way to work out what is, or is not, available for use.


I thought I was on to something when I found this seemingly helpful response on GitHub - - but the skills / knowledge to follow this through so I can actually work out what Cisco models are implemented and how to access them seems to be escaping me.


Is this actually a hard thing to do?  Surely it shouldn't be....  Can some kind person please spell it out for me, using really small words as I'm no Dev, how do you determine what YANG models and Data Classes are available for what product, and how do you query them using RESTCONF?


Thank you!!!

Jayesh Singh
Cisco Employee

Hi Richard,

Checkout this beautiful book on network programming which explains different data modelling and programmimg techniques to automate IOS XE devices.


Let me know if this is helpful. Meanwhile, I will also try out stuffs you have mentioned and see if I can add more to this.




I have checked the book.
I'm beginner into this, would you provide me an example how to use a sample example using RESTCONF (would be good if it uses ydk-py) in IOS RELEASE XE 16.09?

Late answer, but as this post popped up when I was looking at the same issue, so others might benefit:
gives you a nice list of supported YANG models. Works on the platforms I work with.


This is late I know, but did you ever find a satisfactory answer to your question in a way that made sense? I've been trawling programmability guides, command reference documents, forums, and have found the information to be contradictory and patchy.

In my opinion, the main problem with netconf-yang is grouping. For example, I have https://{{ip}}:{{port}}/restconf/data/Cisco-IOS-XE-eigrp-oper. In the yang model (Cisco-IOS-XE-eigrp-oper), there are many gripping with containers and only one container without grouping named "eigrp-oper-data". When I try https://{{ip}}:{{port}}/restconf/data/Cisco-IOS-XE-eigrp-oper:eigrp-oper-data its working fine but using any other container for example "nbr-sw-ver" returns error 404.

Recognize Your Peers
Content for Community-Ad