Using REST API with Nexus?

Ran into a Cisco guy at F5 Agility. He suggested we look at REST API for some of our Nexus scripts. I’m not sure if all of the devices we support today actually support the REST API and whether or not it’s a good direction for us, but wanted to get some feedback here.

@Ulrica_de_Fort-Menar , @Arie_Vayner , @Vasileios_Bouloukos WDUT?

It does seem to be supported, but it would require some testing to validate that all the information is exposed, and which versions support it…

Also, it would have to be explicitely enabled using feature nxapi

At one time, there was some concern around the backward compatibility of the API. Is that still a consideration?

Yes, this was the main concern. The API was added at some later release, and I am sure a lot of the functionality was added incrementally. This means that across the general installed base of equipment there will be a lot of gaps with specific functionality in the API…

The other concern is that it has to be explicitly enabled and is not turned on by default.

1 Like

@Yoni_Leitersdorf: Sorry for the delay to reply to your message but I wanted to do first an investigation since I liked this topic :slight_smile:

The NX-API feature has been available on the Nexus 9000/6000/3000 Series Switches for quite some time. However, it was introduced relative recently on the Nexus 7000/5000 series with the release of 7.2.0 (relevant links can be found to the end of this message).

All the aforementioned nexus models are supported by Indeni. From my experience, I expect to see several Nexus 7k or 5k with release lower than the 7.2.0 (this could be checked also via the indeni – insight and see which NX-OS versions are currently deployed to most nexus switches of Indeni’s customer :wink: ). The Nexus 7k and 5k are very popular series of switches. By using NX-API means these models currently supported by Indeni will not be supported with NX-API(if fully migrated).

I agree with @avayner that it is required additional configuration to enable the NX-API since is disabled by default to all the NX-OS releases. However, this is just a single NX-OS command “feature nx-api” and may in the near future to be enabled by most of the customers.

I have to mention that there is already a well-developed nxapi_utils python library by the Community GitHub for the Cisco Nexus.

Finally, I enabled the nxapi feature to the Nexus 9k switches installed at the indeni lab and now are accessible via the NX-API Sandbox. The NX-API Sandbox is an embedded web-based user interface that you use to enter the commands, command type, and output type for the Cisco Nexus 9000 Series device using HTTP/HTTPS. After posting the request, the output response is displayed.

In particular, you specify the commands, command type, and output type in the top pane. Click the POST Request button above the left pane to post the request. Brief descriptions of the request elements are displayed below the left pane. After the request is posted, the output response is displayed in the right pane (json, xml etc)

This would be very useful in case we take advantage of the NX-API feature. You can get access by typing the next

http://192.168.191.11/ (preferred browser Mozilla)

The credentials are the well known used by IKE

Below you can see a capture of the Sandbox by the Nexus at Indeni lab. It is requested the output of the command “show vpc” in json format.

To sum up NX-API is a good idea but I don’t think that is now good time to deploy it. However, it may be a good time to get prepared and run tests (limitations, current script requirements etc) by taking advantage of the NX-API.

NX-API and Nexus 7k Series support Release Note

NX-API and Nexus 5k Series support Release Note

Thank you for the feedback everyone. Very useful!