Cisco Nexus 1000V REST API Plug-in Configuration Guide, Release 4.2(1)SV2(2.2)
Downloads: This chapterpdf (PDF - 1.14 MB) The complete bookPDF (PDF - 2.15 MB) | The complete bookePub (ePub - 175.0 KB) | Feedback



This chapter contains the following sections:

Information About the Cisco Nexus 1000V REST API

The REST API supports retrieving system information from the Cisco Nexus 1000V.

You can read an object on the Cisco Nexus 1000V Virtual Supervisor Module (VSM) using the Representational State Transfer (REST) web services API. In order to call any REST function, you can use tools such as a web browser, the cURL tool, and Windows PowerShell.

The following is the basic construct of a REST URL:

http[s]://<IP_address>/api/<resource locator>

The resource locator consists of two parts:

<resource locator> := <name space>/<resource name>

<name space> indicates the broader class of functions and <resource name> refers to the specific object.

For example, in the following URL:

n1k is the namespace and license is the resource name.

If you are using a browser, type in the URL. For example, if you want to get the license information of your VSM that has an IP address of, you type the URL as follows:

The browser prompts you for a username and a password and returns the HTML output.

To access the same through cURL, you use the following format:

curl http://username:password@

You get the following XML output:

<set name="license_set">
<instance name="NEXUS_VSG_SERVICES_PKG" url="/api/n1k/license">
<expires>04 May 2013</expires>
<instance name="NEXUS_ASA1000V_SERVICES_PKG" url="/api/n1k/license">
<expires>04 May 2013</expires>
<instance name="NEXUS1000V_LAN_SERVICES_PKG" url="/api/n1k/license">
<expires>04 May 2013</expires>

REST API Architecture

Additional REST APIs can be installed using this plug-in infrastructure to expand the capabilities of the API and retrieve a broader set of information from the switch.

See the following figure for the supported architecture on the Cisco Nexus 1000V switch.
Figure 1. REST API Architecture

Web Interface

The REST API plug-in provides a Web interface to find the available APIs. You can access the Web interface from a browser by using the following URL:


For resources under /api, you can access the online documentation by appending ?meta to the resource name as shown in the following example:


Listing Supported Resource Names

Every REST API function is associated with a resource name.

To find the list of Cisco Nexus 1000V resource names, construct the URL as follows:

You get the following output:

<?xml version="1.0" encoding="utf-8"?>
<instance url="/api">
        <child name="span" url="/api/span" />
        <child name="vpath" url="/api/vpath" />
        <child name="vnode" url="/api/vnode" />
        <child name="vff" url="/api/vff" />
        <child name="user" url="/api/user" />
        <child name="port-profile" url="/api/port-profile" />
        <child name="vxlan" url="/api/vxlan" />
        <child name="vlan" url="/api/vlan" />
        <child name="vc" url="/api/vc" />

Guidelines and Limitations

  • Before you load the REST API plug-in, the plug-in must be available in the bootflash of the active and standby directory.
  • Ensure that you unload the REST API plug-in that is installed during boot time before loading the REST API plug-in from the bootflash.


    After unloading the REST API plug-in, wait for at least 10 seconds before loading the new REST API plug-in.
  • You cannot install multiple plug-ins on the same system.
  • The REST API plug-in load and unload commands are supported only in the VSM HA mode.
  • Ensure that you do not switch over or reload the VSM immediately after unloading the REST API plug-in.

Feature History for Overview



Feature Information

Support for Web Interface


This feature was introduced.