cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2180
Views
10
Helpful
4
Replies

ios-xe-mgmt.cisco.com - YANG data model RO/RW via postman

Jason Wang
Level 1
Level 1

Hi, has anyone been able to use postman and configure anything on the ios-xe-mgmt.cisco.com always on sandbox besides loopback interfaces/physical interfaces? I'm trying to learn how to read the YANG data models provided here: and then write a postman "Get" or "Put" to retrieve information. Maybe I'm not understanding how to properly put in the JSON syntax or the URL. I was able to get some of Cisco-IOS-XE:native to work, but I haven't been able to get anything else such as EIGRP, OSPF, NTP, DHCP. I'm wondering if anyone has any working postman collections they can share. thanks

 

I've been able to "Get" "Put" hostname with the following parameters:

URL

https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-native:native/hostname

Body

{
"Cisco-IOS-XE-native:hostname": "csr1000vPUT"
}

 

Get with:

URL:https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-native:native/ip/domain

though I'm unsure where "IP" comes in and why it's required in the URL

 

Some examples of ones I've tried and failed

Get

URL: https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-ntp:config-ntp-grouping

URL:https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-ntp:server

URL:https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-ethernet:config-interface-ethernet-member-link-lacp-grouping

4 Replies 4

The sandboxes are not locked down by admin permissions, so you shouldn't have any issues there. There are a few options. You could use Yang Explorer https://github.com/CiscoDevNet/yang-explorer is quite old and no longer formally maintained. The RESTCONF support in there was pre-RFC8040. Now that our devices support standard RESTCONF, this won't work, if you are looking to use RESTCONF. What I do is use tools like ANX (https://github.com/cisco-ie/anx) and pyang (https://pypi.org/project/pyang/) to get the tree structure, and then Postman to make my queries.

 

I am not aware of Postman collection for XE, if there is one it would linked here the https://explore.postman.com/team/ciscodevnet

 

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Thank you. I didn't know about ANX.

I actually found a video here   : that gave me a huge hint.

I don't think any of the Hank Preston videos (great learning tool btw) explained how exactly you can get the exact schema syntax. He just mentioned that you can "get it from the device" or from here : like you mentioned. The lesson for me was trying to fortunate the URLs was impossible. I was starting with "https://{{host}}:{{port}}/restconf/data/ietf-interfaces:interfaces" and trying to substitute a different module/leaf here and there and kept getting 404 not found.

 

I was trying to guess what to put into the URL in "Get"

If you do a "https://{{host}}:{{port}}/restconf/data/ietf-yang-library:modules-state" you'll get the list of schemas and you simply copy and paste them and sub out {{host}} and {{port}}. You actually have to include the date as well

Once you have a "Get" it'll be a lot easier to make a "Put" and constructing what change you want to make.

actually i take that back. I haven't been able to make any other changes aside from the loopback/gigabit interface and then hostname. I'm not sure why the following URI calls don't work. I looked up the yang data model using pyang and I thought these would work:

https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-ntp:server

https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-logging:hosts

 

 

 

Hey Jason, i see you have posted in the devnet support teams space. I would keep this conversion to the team room, as this is not an issue with the sandbox per se which engineering could help with, as I believe the sandbox being mentioned is functioning correctly. If you are watching Hank's video course (https://developer.cisco.com/video/net-prog-basics/) there is also a teams room called 'Devnet: Network programmability basics support room' which is a great place to comment and ask questions on this subject.

Hope this helps.
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io