05-26-2020 02:05 PM - edited 05-26-2020 02:20 PM
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
05-27-2020 03:15 AM
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.
05-27-2020 12:03 PM
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.
05-27-2020 11:24 PM
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
05-28-2020 02:57 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide