cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
566
Views
0
Helpful
2
Replies
Highlighted

Getting containers from capabilities IOS-XE with RESTCONF

Hey all,

 

Long time lurker first time poster here.

 

I'm doing my DevNet Associate training and have come up against a brick wall when trying to determine how to generate the full URIs to GET/POST (more GET at this point! ha) on IOS-XE when using RESTCONF. I have queried the YANG capabilities using /restconf/data/netconf-state/capabilites and have returned a large list. When trying to query any of them I get an error - 'uri keypath not found'. I know from my training material that there is a URI for /restconf/data/ietf-interfaces:interfaces which returns data. However, without knowing that ietf-interfaces has a container of :interfaces, how would I generate a URI, for example for ietf-ipv4-unicast-routing or /Cisco-IOS-XE-acl? 

 

I know of YANG Catalog and I have been able to locate both of those capabilities, but am wondering how do/would you or I determine the full URI? I.e. would you go to YANG catalog and find the module and locate the capabilities - or is there a way to determine it via a query?

 

Really apreciate the assit here.

 

~Jonny

2 REPLIES 2
Highlighted
VIP Collaborator VIP Collaborator
VIP Collaborator

Hi 

Dont think you get containers from capabilities with restconf .. could be wrong .. but I have not seen any doc.

Use pyang or yang explorer to load/explore the yang model from yang catalogue on github to see the containers.

check out the uri construction section in these presentations - 

https://www.netacad.com/sites/default/files/images/careers/Webinars/DevNet/devnet_session_7_networkprogrammability_yang_netconf_restconf.pdf

 

https://www.ciscolive.com/c/dam/r/ciscolive/apjc/docs/2016/pdf/DEVNET-1081.pdf

 

 

Highlighted

Thanks. Both of those PDFs are really useful! I think you're right, there probably isn't an easy way to see what containers exist to query. For now I'm sticking to using YANG-Explorer. Cheers for the reply.
Content for Community-Ad