- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 11:37 PM
Hello Community,
I'm new here.
I'm trying to build an APP, for configuring Cisco IOS XE devices.
My problem is that I can't find documentation for the exact paths of the endpoints.
I found only these route resources from the Cisco official doc
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/174/b_174_programmability_cg/restconf_protocol.html :
-
GigabitEthernet0/0/2 - https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=0%2F0%2F2
-
fields=name – https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=0%2F0%2F2?fields=name
-
depth=1 - https://10.85.116.59/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet?depth=1
-
Name and IP - https://10.85.116.59/restconf/data/Cisco-IOS-XE-native:native/interface?fields=GigabitEthernet/ip/address/primary;name
-
MTU (fields) - https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface?fields=GigabitEthernet(mtu)
-
MTU - https://10.85.116.59/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=3/mtu
-
Port-Channel - https://10.85.116.59/restconf/data/Cisco-IOS-XE-native:native/interface/Port-channel
Can anyone please help me find the Restconf documentation in IOS XE ( and other IOS also) ???
Thanks, community
Solved! Go to Solution.
- Labels:
-
General
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 02:30 AM - edited 09-15-2023 02:46 AM
When I'm looking for the xpath for specific items on IOS-XE, I prefer to go and look for them using yangsuite. Different versions/devices implement different versions of yang models. You can check here the yangs models https://github.com/YangModels/yang/tree/main/vendor/cisco/xe
Yanguiste can be used as a docker container or pip package that you install locally. Then you add the device you are testing and the yangsuite can download the yang models the device is implementing.
From there, you can go to the protocol you want to use, in this case restconf and search for the model you are interested on. From that, you can navigate what the model expose and play around to get the data you want to get. In the yangsuite you can execute APIs directly, so the test is quickly.
See https://github.com/CiscoDevNet/yangsuite and https://developer.cisco.com/yangsuite/ to get more familiar.
IOS-XE, NX-OS, IOS-XR are supported by yangsuite. and other protocols as such as netconf and grpc.
You can download the yang models your device implements, but is much easier to go with the yangsuite.
EDIT: typos.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 02:30 AM - edited 09-15-2023 02:46 AM
When I'm looking for the xpath for specific items on IOS-XE, I prefer to go and look for them using yangsuite. Different versions/devices implement different versions of yang models. You can check here the yangs models https://github.com/YangModels/yang/tree/main/vendor/cisco/xe
Yanguiste can be used as a docker container or pip package that you install locally. Then you add the device you are testing and the yangsuite can download the yang models the device is implementing.
From there, you can go to the protocol you want to use, in this case restconf and search for the model you are interested on. From that, you can navigate what the model expose and play around to get the data you want to get. In the yangsuite you can execute APIs directly, so the test is quickly.
See https://github.com/CiscoDevNet/yangsuite and https://developer.cisco.com/yangsuite/ to get more familiar.
IOS-XE, NX-OS, IOS-XR are supported by yangsuite. and other protocols as such as netconf and grpc.
You can download the yang models your device implements, but is much easier to go with the yangsuite.
EDIT: typos.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 12:11 AM
Hello,
Thanks a lot Jesus Illescas !!!
That was definitely what I was searching for !
By the way, this is a great tool for starting Automation and Programmability in Cisco IOS
Best Regards,
GS
