01-18-2023 01:58 AM
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
01-18-2023 03:57 AM
check restconf config example :
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.
01-18-2023 04:05 AM
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
01-18-2023 04:24 AM
Hello,
post the full XML request you are using. Which NX-OS version are you running on the 9500v ?
01-18-2023 04:30 AM
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
01-18-2023 09:17 AM
Can you post show run output here
01-18-2023 10:11 AM
Hi @balaji.bandi ,
I have attached the output
The response what I get is status code: 400 with body {}
Regards,
Shahid
01-18-2023 01:08 PM
requested the config - show run
01-18-2023 07:59 PM
01-20-2023 03:23 AM
01-23-2023 08:41 AM
i have not got chance to test, this in my Lab, i will revert back when i get a chance to test it.
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