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

Rest API Cisco IOS XE

gespanos
Beginner
Beginner
1 Accepted Solution

Accepted Solutions

Jesus Illescas
Cisco Employee
Cisco Employee

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.

View solution in original post

2 Replies 2

Jesus Illescas
Cisco Employee
Cisco Employee

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.

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: