cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
960
Views
0
Helpful
10
Replies

Restconfig yang model

mohamedshahid
Level 1
Level 1

Hi, 

I was trying to access the cisco switch of NX-OS 9500v through restAPI and I see that only System API(restconf/data/Cisco-NX-OS-device:System/) is accessible and then other, 

I have  a query , where can we find the restconf API documentation and data models, we want the info on the switch like type, interfaces, Vlans, and how to create a Vlans in that switch, pls help which APIs would be helpful in providing these solutions?

 

Regards,

Shahid

10 Replies 10

balaji.bandi
Hall of Fame
Hall of Fame

check restconf config example :

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/93x/progammability/guide/b-cisco-nexus-9000-series-nx-os-programmability-guide-93x/b-cisco-nexus-9000-series-nx-os-programmability-guide-93x_chapter_011100.html

here is the API reference :

https://developer.cisco.com/site/cisco-nexus-nx-api-references/

Note : most of the document was Physical Kit, Virtual there may be some limitration check the document before you deploying it.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

mohamedshahid
Level 1
Level 1

Hi,

I found a few restconfig APIs with the yang System model "https://<nxos-switchIP>/restconf/data/Cisco-NX-OS-device:System/"  --> this gives output.

But when I used openconfig models for example the below one https://nxos1/restconf/data/openconfig-interfaces:interfaces

it always gives "400 Bad request", any idea why, I found the similar issue reported in github too: https://github.com/YangModels/yang/issues/270 but no resolution for that still....

 

Regards,

Shahid

Hello,

post the full XML request you are using. Which NX-OS version are you running on the 9500v ?

mohamedshahid
Level 1
Level 1

Hi

is the version Nexus 9000v

I am accessing the get API's, not doing any POST operation

 GET https://<switch-ip>/restconf/data/openconfig-interfaces:interfaces?content=config

 

Can you post show run output here

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

mohamedshahid
Level 1
Level 1

Hi @balaji.bandi ,

I have attached the output

The response what I get is status code: 400 with body {}

 

Regards,

Shahid

requested the config -  show run 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

mohamedshahid
Level 1
Level 1

Have attached the output in the file

Regards..

 

mohamedshahid
Level 1
Level 1

@balaji.bandi ,

Can you please share any updates on the issue?

Regards,

Shahid

i have not got chance to test, this in my Lab, i will revert back when i get a chance to test it.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Review Cisco Networking for a $25 gift card