The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter provides information about the Cisco Nexus 1000V application programming interface (API) functions. The functions are grouped under two namespaces—n1k and hyper-v. The n1k namespace is generic across all hypervisors, and hyper-v namespaces are specific. The functions that support write (create, update, and delete) operations are explicitly marked as writeable. All others are read-only functions.
The functions are the following:
•Get License Information for the Cisco Nexus 1000V
•Get Basic Information About the Cisco Nexus 1000V
•Get Module Information for the Cisco Nexus 1000V
•Get Uplink Information for the Cisco Nexus 1000V
•Get Virtual Port Information for the Cisco Nexus 1000V
•Get Port Profile Information for the Cisco Nexus 1000V
•Get a List of Cisco Nexus 1000V Port Profiles on a Specific Module
•Get a List of Cisco Nexus 1000V vNICs in Use on a Specific Module
•Get a List of Cisco Nexus 1000V Uplink Ports In Use On a Specific Module
•Get a List of Cisco Nexus 1000V VSEM Details
•Get a List of Cisco Nexus 1000V Switch Extensions
•Get a List of Cisco Nexus 1000V Logical Networks
•Get a List of Cisco Nexus 1000V Network Segment Pools
•Get a List of Cisco Nexus 1000V IP Address Pools
•Get a List of Cisco Nexus 1000V Network Segments
•Get a List of Cisco Nexus 1000V VM Networks
•Get a List of Cisco Nexus 1000V Virtual Port Profiles
•Get a List of Cisco Nexus 1000V Uplink Port Profiles
["/api/n1k/license"]
Retrieves license-usage information. This function is equivalent to the show license usage command.
<?xml version="1.0" encoding="UTF-8"?>
<set name="license_set"
<instance name="NEXUS_VSG_SERVICES_PKG" url="/api/n1k/license">
<properties>
<expires>Never</expires>
<type>NEXUS_VSG_SERVICES_PKG</type>
<available>16</available>
<status>Unused</status>
<used>0</used>
</properties>
</instance>
<instance name="NEXUS_ASA1000V_SERVICES_PKG" url="/api/n1k/license">
<properties>
<expires>Never</expires>
<type>NEXUS_ASA1000V_SERVICES_PKG</type>
<available>16</available>
<status>Unused</status>
<used>0</used>
</properties>
</instance>
<instance name="N1KV_MSFT_LAN_SERVICES_PKG" url="/api/n1k/license">
<properties>
<expires>Never</expires>
<type>N1KV_MSFT_LAN_SERVICES_PKG</type>
<available>511</available>
<status>In use</status>
<used>0</used>
</properties>
</instance>
</set>
|
|
---|---|
|
Earliest expiration date for a given license. |
|
License name. |
|
Available license count. |
|
License usage status. |
|
Used licenses. |
["/api/n1k/summary"]
Retrieves basic information about the Cisco Nexus 1000V.
<instance uri="/api/n1k/summary">
<properties>
<switchMode>Advance</switchMode>
<ip>172.23.231.209</ip>
<name>my_vsm</name>
<haStatus>false</haStatus>
<version>version 5.2(1)SM1(5.1)</version>
</properties>
</instance>
["/api/n1k/vem"]
Retrieves information about Cisco Nexus 1000V modules. This function is equivalent to the show module command.
<set name="vem_set">
<instance name="3" url="/api/n1k/vem">
<properties>
<module>3</module>
<licenseUsage>-</licenseUsage>
<numVnics>3</numVnics>
<ip>10.10.10.2</ip>
<hostVersion>Windows Server 8 - Datacenter (6.2.9200, 6.30)
</hostVersion>
<status>ok</status>
<license>licensed</license>
<mac>02-00-0c-00-03-00 to 02-00-0c-00-03-80</mac>
<type>Virtual Ethernet Module</type>
<maxNumVnic>216</maxNumVnic>
<nSockets>2</nSockets>
<ports>288</ports>
<modmac>3</modmac>
<numVM>3</numVM>
<version>5.2(1)SM1(5.1)</version>
<model>NA</model>
<lic_version>-</lic_version>
<serialnum>NA</serialnum>
<name>SAMLIN-SERVER02</name>
</properties>
<children>
<child name="port-profile" url="/api/n1k/vem/3/port-profile"/>
<child name="uplink" url="/api/n1k/vem/3/uplink"/>
<child name="vnic" url="/api/n1k/vem/3/vnic"/>
</children>
</instance>
</set>
Each child indicates the sub-addon available under each module.
["/api/n1k/uplink"]
Retrieves information about the Cisco Nexus 1000V uplink ports.
Response Sample
<set name="uplink_set">
<instance name="Ethernet3/8" uri="/api/n1k/uplink/Ethernet3%2F8">
<properties>
<module>3</module>
<portChannelType>Eth</portChannelType>
<packetsTx>26361</packetsTx>
<mtu>1500</mtu>
<cdpPort>GigabitEthernet3/39</cdpPort>
<port>Ethernet3/8</port>
<status>up</status>
<mode>trunk</mode>
<vlans>231</vlans>
<portChannel>1</portChannel>
<cdpNativeVlan>231</cdpNativeVlan>
<portChannelMembers>Ethernet3/8</portChannelMembers>
<ethernet>Ethernet</ethernet>
<packetsRx>187544</packetsRx>
<cdpSwitch>sfish-6k-I9</cdpSwitch>
<portProfile>n1kv-uplink0</portProfile>
<speed>1000 Mb/s</speed>
</properties>
</instance>
</set>
["/api/n1k/vnic"]
Retrieves information about the Cisco Nexus 1000V virtual ports.
Response Sample
<set name="vnic_set">
<instance name="Vethernet5" uri="/api/n1k/vnic/Vethernet5">
<properties>
<mac>0050.56ba.58bc</mac>
<dvport>DVPort65</dvport>
<adapter>Net Adapter 1</adapter>
<hostIP>172.23.231.192</hostIP>
<vlans>231</vlans>
<portGroup>n1kv-system-control</portGroup>
<status>up</status>
<module>3</module>
<vm>vsm-openstack</vm>
<vnic>Vethernet5</vnic>
</properties>
</instance>
</set>
["/api/n1k/port-profile"]
Retrieves information about the Cisco Nexus 1000V port profiles.
<set name="port-profile_set">
<instance name="n1kv-pp-vmk0" uri="/api/n1k/port-profile/n1kv-pp-vmk0">
<properties>
<minPorts>1</minPorts>
<systemVlans>231</systemVlans>
<usedPorts>1</usedPorts>
<name>n1kv-pp-vmk0</name>
<vlans>231</vlans>
<status>1</status>
<mode>access</mode>
<maxPorts>32</maxPorts>
<type>Vethernet</type>
</properties>
</instance>
</set>
[/"api/n1k/vem/<module number>/port-profile"]
Retrieves a list of the Cisco Nexus 1000V port profiles in use on a specific module.
<set name="port-profile_set">
<instance name="1" uri="/api/n1k/vem/3/port-profile/1">
<properties>
<minPorts>1</minPorts>
<systemVlans>231</systemVlans>
<usedPorts>1</usedPorts>
<name>n1kv-pp-vmk0</name>
<vlans>231</vlans>
<status>1</status>
<mode>access</mode>
<maxPorts>32</maxPorts>
<type>Vethernet</type>
</properties>
</instance>
</set>
["/api/n1k/vem/<module no>/vnic/<vnic number>"]
Retrieves a list of Cisco Nexus 1000V virtual ports in use on a specific module.
<set name="vnic_set">
<instance name="Vethernet5" uri="/api/n1k/vem/3/vnic/Vethernet5">
<properties>
<mac>0050.56ba.58bc</mac>
<dvport>DVPort65</dvport>
<adapter>Net Adapter 1</adapter>
<hostIP>172.23.231.192</hostIP>
<vlans>231</vlans>
<portGroup>n1kv-system-control</portGroup>
<status>up</status>
<module>3</module>
<vm></module>
<vnic>Vethernet5</vnic>
</properties>
</instance>
</set>
See the description for [/api/n1k/vnic].
["/api/n1k/vem/<module number>/uplink"]
Retrieves a list of uplink ports in use on a specific module and related information.
<set name="uplink_set">
<instance name="Ethernet3/8" uri="/api/n1k/vem/3/uplink/Ethernet3%2F8">
<properties>
<module>3</module>
<portChannelType>Eth</portChannelType>
<packetsTx>33077</packetsTx>
<mtu>1500</mtu>
<cdpPort>GigabitEthernet3/39</cdpPort>
<port>Ethernet3/8</port>
<status>up</status>
<mode>trunk</mode>
<vlans>231</vlans>
<portChannel>1</portChannel>
<cdpNativeVlan>231</cdpNativeVlan>
<portChannelMembers>Ethernet3/8</portChannelMembers>
<ethernet>Ethernet</ethernet>
<packetsRx>235849</packetsRx>
<cdpSwitch>sfish-6k-I9</cdpSwitch>
<portProfile>n1kv-uplink0</portProfile>
<speed>1000 Mb/s</speed>
</properties>
</instance>
</set>
See the description for [/api/n1k/uplink].
["/api/n1k/hyper-v/vsem-system-info"]
Retrieves information that is associated with the Virtual Switch Extension Module (VSEM) object. For any external switch device managed by the Virtual Machine Manager (VMM), the VMM associates it to a VSEM object.
<instance name="vsem-system-info" uri="/api/n1k/hyper-v/vsem-system-info">
<properties>
<description>Cisco Systems Nexus 1000V</description>
<model>Nexus 1000V</model><id></model>
<manufacturer>Cisco Systems</manufacturer>
<name>Nexus 1000V Chassis version 5.2(1)SM1(5.1) [build 5.2(1)SM1(5.0.128)|build 5.2(1)SM1(5.0.128)]</name>
<version>1.0</version>
<id>277cebaa-5c64-1336-a9d5-60965f468a4c</id>
<vendorId>{55ca4f11-f549-4440-a489-e7337f3a6b73}</vendorId>
</properties>
</instance>
["/api/n1k/hyper-v/switch-extension-info"]
Retrieves the VSM information needed by VMM to associate it to a switch extension. A VSEM can contain one or more switch extensions. For the Cisco Nexus 1000V, a VSEM can contain only one switch extension.
<instance url="/api/n1k/hyper-v/switch-extension-info">
<properties>
<drivernetcfginstanceid>9C8ED422-F33A-4F34-B771-E8B8D0539FD3
</drivernetcfginstanceid>
<name>hyperv-vsm-1</name>
<opdata>data-version</opdata>
<maxVersion>5.2.128</maxVersion>
<minVersion>105.100.0000.0000</minVersion>
<extensionType>Forwarding</extensionType>
<isSwitchTeamSupported>true</isSwitchTeamSupported
<switchExtensionFeatureConfigId>2ABD62F9-0E77-4E4C-B7B0-B2DBAF9B7CBB
</switchExtensionFeatureConfigId>>
<maxNumberOfPorts>16000</maxNumberOfPorts>
<mandatoryFeatureId>2ABD62F9-0E77-4E4C-B7B0-B2DBAF9B7CBB
</mandatoryFeatureId>
<maxNumberOfPortsPerHost>216</maxNumberOfPortsPerHost>
<isChildOfWFPSwitchExtension>false</isChildOfWFPSwitchExtension>
</properties>
</instance>
["/api/n1k/logical-network"] [writeable]
Retrieves a list of logical networks. This function represents a logical network that spans across multiple sites represented by multiple subnets.
<set name="logical_network_set">
<instance name="LN1" url="/api/nlk/logical-network">
<properties>
<name>LN1</name>
<description>LN1</description>
</properties>
</instance>
</set>
|
|
|
---|---|---|
|
User field name for a logical network. |
No |
|
Description of a logical network. |
Yes |
["/api/n1k/network-segment-pool"] [writeable]
Retrieves a list of network segment pools. The network segment pools contain one or more network segments that represent a logical network in a location. This fuunction is equivalent to the VMM network segment pool.
<set name="network_segment_pool_set">
<instance name="my-network-segment-pool" url="/api/n1k/network-segment-pool">
<properties>
<name>my-network-segment-pool</name>
<logicalNetwork>my-logical-network</logicalNetwork>
<id>a3e7d0b7-98ac-44f7-89ad-0eaa9675d753</id>
<maximumNetworkSegmentsPerVMNetwork>2000</maximumNetworkSegmentsPerVMNetwork>
<supportsVMNetoworkProvisioning>true</supportsVMNetoworkProvisioning>
<supportsIpPool>true</supportsIpPool>
<intraPortCommunication>true</intraPortCommunication>
</properties>
</instance>
</set>
["/api/n1k/ip-pool-template"] [writeable]
Retrieves the Layer-3 information associated with the Layer-2 network. Every network segment is associated with an IP address pool.
<set name="ip_address_pool_set">
<instance name="ip-pool-template" url="api/n1k/ip-pooltemplate">
<properties>
<netbt>false</netbt>
<description/>
<addressRangeStart>1.1.1.2</addressRangeStart>
<dhcp>true</dhcp>
<dnsSuffixList>cisco.com<dnsSuffixList>
<addressFamily>IPv4</addressFamily>
<dnsServersListList>1.1.1.3</dnsServersListList>
<ipAddressSubnet>255.255.255.0</ipAddressSubnet>
<addressRangeEnd>1.1.1.100</addressRangeEnd>
<networkAddress>1.1.1.1</networkAddress>
<name>ip-pool-template</name>
<gateway>1.1.1.1</gateway>
<netbiosServersList>1.1.1.99</netbiosServersList>
<reservedIpList>1.1.1.50</reservedIpList>
</properties>
</instance>
</set>
["/api/n1k/network-segment"] [writeable]
Retrieves a list of network segments. A network segment represents a subnet.
<set name="network_segment_set">
<instance name="my-network-segment-secondary-101" url="/api/n1k/network-segment">
<properties>
<description>My secondary (101) network segment</description>
<ipPoolId>d4fe3b3a-8ade-4fd0-9e3d-0af43b760c1a</ipPoolId>
<id>21e1dbbe-7fb4-456c-a91b-8c66ff33792b</id>
<vmNetworkId>5b602e01-58c8-4b48-a3b8-9d66c5dac5d9</vmNetworkId>
<segmentType>VLAN</segmentType>
<networkSegmentPool>my-network-segment-pool</networkSegmentPool>
<name>joe-network-segment-secondary-101</name>
<vmNetwork>my-network-segment-secondary-101</vmNetwork>
<vlan>0</vlan>
<ipPoolName>joe-ip-pool-template</ipPoolName>
</properties>
</instance>
</set>
["/api/n1k/hyper-v/vm-network"] [writeable]
Retrieves a list of virtual machine (VM) networks. A network segment can contain one or more network segments. For VLAN-based networks, a network segment can contain only one network segment.
<set name="vm_network_set">
<instance name="my-network-segment-access-110" url="/api/n1k/hyper-v/vm-network">
<properties>
<id>26735817-8b5f-4a84-94e8-da72aee20ad5</id>
<networkSegment>my-network-segment-access-110</networkSegment>
<name>joe-network-segment-access-110</name>
<networkSegmentPool>my-network-segment-pool</networkSegmentPool>
</properties>
</instance>
</set>
["/api/n1k/virtual-port-profile"]
Retrieves a list of virtual port profiles. A virtual port profile is a port profile that can be attached to a virtual interface.
<set name="virtual_port_profile_set">
<instance name="veth-pp" url="/api/n1k/virtual-port-profile">
<properties>
<state>enabled</state>
<type>vethernet</type>
<name>veth-pp</name>
<id>4b87bc57-e686-4296-8720-92736aecd95b</id>
<maxNumberOfPortsPerHost>216</maxNumberOfPortsPerHost>
<maxPorts>32</maxPorts>
<switchId>86e13b66-ba94-4190-9e5d-e2e43c9ec1cd</switchId>
<properties>
</instance>
</set>
Object Locator
["/api/n1k/uplink-port-profile"]
Description
Retrieves a list of uplink port profiles. An uplink port profile is a port profile that can be attached to a physical interface.
Response Sample
<set name="uplink-port-profile_set">
<instance name="UPP1" url="/api/n1k/uplink-port-profile">
<properties>
<switchId>86e13b66-ba94-4190-9e5d-e2e43c9ec1cd</switchId>
<name>UPP1</name>
<id>7978f13c-70ad-4ecd-peec-51c8027ef629</id>
<maxPorts>32</maxPorts>
<networkSegmentPool>nsp1</networkSegmentPool>
</properties>
</instance>
</set>