Experimenting w/ IOS-XE 16.5.1 on a CSR & have attempted to query the RESTCONF API. Having a hard time getting the information is needed. Being able to identify the correct URI to extract targeted data has been time-consuming because it's based on URI combinations to get the data needed. Not able to make sense of how to map the YANG models directly to a functional URI. Looking for guidance on how to take a specific YANG model & then be able to access the desired information within.
A concrete example:
Have configured MPLS tunnels between 2 CSR's & am attempting to query the Cisco-IOS-XE-mpls.yang model.
The closest URI that which provides meaningful info is as follows:
http://192.168.3.41/restconf/api/running/ios:native/ios:interface/Tunnel/102?deep
{
"Cisco-IOS-XE-native:Tunnel": {
"name": 102,
"description": "OPS(test1<>test2)::blah::AAAAAAAAAAAA::blahblah",
"ip": {
"unnumbered": "Loopback1000"
},
"Cisco-IOS-XE-tunnel:tunnel": {
"destination": "10.253.24.2",
"mode": {
"mpls": {
"traffic-eng": {}
}
},
"mpls": {
"traffic-eng": {
"path-option": {
"working": [
{
"id": 5,
"explicit": {
"name": {
"exp-name": "TEST1_TO_TEST2_TE"
}
}
}
]
}
}
}
}
}
}
But doesn't contain a lot of the information was needed. Hence want to make sure that you are accessing the YANG data model that you want (Cisco-IOS-XE-mpls.yang).
https://<ADDRESS>/<ROOT>/<DATA STORE>/<[YANGMODULE:]CONTAINER>/<LEAF>[?<OPTIONS>]
http://192.168.3.41/restconf/api/running/Cisco-IOS-XE-mpls:traffic-eng ????
Following are the issues :
1) Which datastore: operational/data/config/running . (some YANG models have "-oper" on the end of them, but otherwise its clueless.)
2) Once you know the data store, how do you know how to access the specific module that you want. Is there a concrete process for doing this. In Cisco documentation (and other tutorials) we see the same example of querying ieee-interfaces, but nothing w/ more detail.
3) is there a way to show API structure (like a list of keys, etc) through querying the API.
4) is there a way to output an entire yang data model (even if parts of it are empty)
Everyone may have the same feeling since there is no RESTCONF API reference menu.
use pyang and yang-explorer for help to figure out what to use.
DevNet learning labs may help too such as RESTCONF related LLs
Comments
0 comments
Please sign in to leave a comment.