Chapter 1. Overview

Information About the Cisco Nexus 1000V OpenStack REST API

Finding Supported OpenStack Resource Names

List of Available OpenStack Resource Names for the Cisco Nexus 1000V

Chapter 2. Cisco Nexus 1000V OpenStack API Functions

Get the List of Policy Profiles

Get Information About a Policy Profile

Create a Network Profile

Get a List of Network Profiles

Get Information About a Network Profile

Update a Network Profile

Delete a Network Profile

Create a Network

Create a Port

Preface

Audience

Document Conventions

Related Documentation for Cisco Nexus 1000V for KVM Software

Documentation Feedback

Obtaining Documentation and Submitting a Service Request

Copyright Page

Chapter 1. Overview

This chapter contains the following sections:

- Information About the Cisco Nexus 1000V OpenStack REST API

- Finding Supported OpenStack Resource Names

- List of Available OpenStack Resource Names for the Cisco Nexus 1000V

Information About the Cisco Nexus 1000V OpenStack REST API

Note

OpenStack supports configuring all of the core Neutron resources, such as the network, subnet, and port, by using the REST APIs. The Cisco plug-in for OpenStack supports all of these core resources and also the resources that Cisco added to support Nexus 1000v, such as cisco-network-profile and cisco-policy-profile.

Accessing the core OpenStack resources through the REST APIs is thoroughly documented on the OpenStack Website. This document describes the resources that Cisco newly added or extended. The REST APIs can be accessed by using a Web browser or using the cURL tool.

Accessing the REST APIs for OpenStack is a two step process. You must authenticate with the Keystone service and obtain an authorization token. You use this token with the curl command to access the Neutron resources.

- To authenticate with the Keystone service:

curl -k -X 'POST' -v http://Controller’s_public_IP:Keystone’s_public_port/v2.0/tokens \
-d '{"auth":{"passwordCredentials":{"username": "userName", "password":"password"}, \
"tenantId":"tenant-ID"}}' -H 'Content-type: application/json'

- To request access to the Neutron resources:

curl -H "X-Auth-Token:Token" \
http://Controller's_public_port:neutron's_public_port/v2.0/networks

The following example authenticates with the Keystone service and fetches all of the networks configured on Neutron in JSON format:

$ curl -k -X 'POST' -v http://192.168.10.25:5000/v2.0/tokens -d \
'{"auth":{"passwordCredentials":{"username": "admin", "password":"pw1"}, \
"tenantId":"36c7867df9d24ab38fef45475a0a0c17"}}' -H 'Content-type: application/json'

$ curl -H "X-Auth-Token: 5788dc57e14036c7867df9d24ab38fef45475a0" \
-X GET http://192.168.10.25:9696/v2.0/networks
{
"networks":
[
{"status": "ACTIVE", "subnets": [], "name": "extnet", "provider:physical_network": "net1", "admin_state_up": true, "tenant_id": "36c7867df9d24ab38fef45475a0a0c17", "provider:network_type": "vlan", "router:external": true, "n1kv:profile_id": "cb027858-d3e7-4c73-a631-5788dc57e140", "shared": false, "id": "081e4573-2cf5-4abc-97a4-cb4860e642e4", "provider:segmentation_id": 14}
]
}

Finding Supported OpenStack Resource Names

Every OpenStack REST API function is associated with a resource name

To find the list of Cisco Nexus 1000V OpenStack resource names, use the following command:

curl -H "X-Auth-Token:Authorization_token" -X GET http://172.23.231.25:9696/v2.0/

You get the following output:

{
"resources":
[
{
"links": [{"href": "http://172.23.231.25:9696/v2.0/subnets", "rel": "self"}],
"name": "subnet", "collection": "subnets"
},
{
"links": [{"href": "http://172.23.231.25:9696/v2.0/networks", "rel": "self"}],
"name": "network", "collection": "networks"
},
{
"links": [{"href": "http://172.23.231.25:9696/v2.0/ports", "rel": "self"}],
"name": "port",
"collection": "ports"
}
]
}

List of Available OpenStack Resource Names for the Cisco Nexus 1000V

Available Resource Names

Namespace

Description

cisco-policy-profile-list

Retrieves the list of policy profiles of a Cisco Nexus 1000V switch.

cisco-policy-profile-show

Retrieves information about a port profile of a Cisco Nexus 1000V switch.

cisco-network-profile-create

Creates a network profile on a Cisco Nexus 1000V switch.

cisco-network-profile-list

Retrieves a list of network profiles from a Cisco Nexus 1000V switch.

cisco-network-profile-show

Gets information about a network profile on a Cisco Nexus 1000V switch.

cisco-network-profile-update

Updates a network profile on a Cisco Nexus 1000V switch.

cisco-network-profile-delete

Deletes a network profile from a Cisco Nexus 1000V switch.

net-create

Creates a network on a Cisco Nexus 1000V switch.

port-create

Creates a port on a Cisco Nexus 1000V switch.

Chapter 2. Cisco Nexus 1000V OpenStack API Functions

This chapter provides information about the Cisco Nexus 1000V OpenStack application programming interface (API) functions. The Cisco Nexus 1000V resource name is generic across all hypervisors. The functions that support write (create, update, and delete) operations are explicitly marked as writeable. All others are read-only functions.

The chapter contains the following topics:

- Get the List of Policy Profiles

- Get Information About a Policy Profile

- Create a Network Profile

- Get a List of Network Profiles

- Get Information About a Network Profile

- Update a Network Profile

- Delete a Network Profile

- Create a Network

- Create a Port

Get the List of Policy Profiles

Name

cisco-policy-profile-list

Description

Retrieves the list of policy profiles from a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

GET /v2.0/policy_profiles.json

User Agent

python-neutronclient

Response Sample

{
"date": "Fri, 13 Sep 2013 00:29:06 GMT",
"status": "200",
"content-length": "84",
"content-type": "application/json; charset=UTF-8",
"content-location": "http://172.23.180.45:9696/v2.0/policy_profiles.json"
}
{
"policy_profiles": [
{
"id": "452788f5-109d-4963-9153-1c5b181c8a0d",
"name": "pp1"
}
]
}

Response Description

Property

Writeable or Readable

content-location

Readable

id

Readable

name

Readable

Get Information About a Policy Profile

Name

cisco-policy-profile-show

Description

Retrieves information about a policy profile from a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

GET /v2.0/policy_profiles/452788f5-109d-4963-9153-1c5b181c8a0d.json

Note

Retrieve the policy profile ID as shown in Get the List of Policy Profiles, specifying the profile name in the command line. For example: GET /v2.0/policy_profiles.json?fields=id&name=pp1.

User Agent

python-neutronclient

Response Sample

{
"date": "Fri, 13 Sep 2013 00:33:32 GMT",
"status": "200",
"content-length": "81",
"content-type": "application/json; charset=UTF-8",
"content-location": "http://172.23.180.45:9696/v2.0/policy_profiles/452788f5-109d-4963-9153-1c5b181c8a0d.json"
}
{
"policy_profile": {
"id": "452788f5-109d-4963-9153-1c5b181c8a0d",
"name": "pp1"
}
}

Response Description

Property

Writeable or Readable

content-location

Readable

id

Readable

name

Readable

Create a Network Profile

Name

cisco-network-profile-create

Description

Creates a network profile on a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

POST /v2.0/network_profiles.json

User Agent

python-neutronclient

Response Sample

{
"network_profile": {
"segment_range": "100-200",
"segment_type": "vlan",
"physical_network": "physnet1",
"name": "VlanNetProf"
}
}
{
"date": "Fri, 13 Sep 2013 00:57:15 GMT",
"status": "201",
"content-length": "220",
"content-type": "application/json; charset=UTF-8"
}
{
"network_profile": {
"segment_range": "100-200",
"segment_type": "vlan",
"name": "VlanNetProf",
"sub_type": null,
"physical_network": "physnet1",
"id": "58f722ca-489c-4abf-b74f-7bcc2e988d89",
"multicast_ip_range": null
}
}

Response Description

Property

Writeable or Readable

segment_range

Writeable

segment_type

Writeable

name

Writeable

sub_type

Writeable

physical_network

Writeable

id

Readable

multicast_ip_range

Writeable

Get a List of Network Profiles

Name

cisco-network-profile-list

Description

Retrieves a list of network profiles from a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

GET /v2.0/network_profiles.json

User Agent

python-neutronclient

Response Sample

{
"date": "Fri, 13 Sep 2013 00:59:07 GMT",
"status": "200",
"content-length": "223",
"content-type": "application/json; charset=UTF-8",
"content-location": "http://172.23.180.45:9696/v2.0/network_profiles.json"
}
{
"network_profiles": [
{
"segment_range": "100-200",
"segment_type": "vlan",
"name": "VlanNetProf",
"sub_type": null,
"physical_network": "physnet1",
"id": "58f722ca-489c-4abf-b74f-7bcc2e988d89",
"multicast_ip_range": null
}
]
}

Response Description

Property

Writeable or Readable

content-location

Readable

segment_range

Readable

segment_type

Readable

name

Readable

sub_type

Readable

physical_network

Readable

id

Readable

multicast_ip_range

Readable

Get Information About a Network Profile

Name

cisco-network-profile-show

Description

Gets information about a network profile on a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

GET /v2.0/network_profiles/58f722ca-489c-4abf-b74f-7bcc2e988d89.json

Note

Retrieve the network profile ID as shown in Get a List of Network Profiles, specifying the profile name in the command line. For example: GET /v2.0/network_profiles.json?fields=id&name=VlanNetProf.

User Agent

python-neutronclient

Response Sample

{
"date": "Fri, 13 Sep 2013 01:00:03 GMT",
"status": "200",
"content-length": "220",
"content-type": "application/json; charset=UTF-8",
"content-location": "http://172.23.180.45:9696/v2.0/network_profiles/58f722ca-489c-4abf-b74f-7bcc2e988d89.json"
}
{
"network_profile": {
"segment_range": "100-200",
"segment_type": "vlan",
"name": "VlanNetProf",
"sub_type": null,
"physical_network": "physnet1",
"id": "58f722ca-489c-4abf-b74f-7bcc2e988d89",
"multicast_ip_range": null
}
}

Response Description

Property

Writeable or Readable

content-location

Readable

segment_range

Readable

segment_type

Readable

name

Readable

sub_type

Readable

physical_network

Readable

id

Readable

multicast_ip_range

Readable

Update a Network Profile

Name

cisco-network-profile-update

Description

Updates a network profile on a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

PUT /v2.0/network_profiles/27d1d0a0-f4fa-462a-977f-4a92cd206616.json

Note

Retrieve the network profile ID as shown in Get a List of Network Profiles, specifying the profile name in the command line. For example: GET /v2.0/network_profiles.json?fields=id&name=vmnp2.

User Agent

python-neutronclient

Response Sample

{
"network_profile": {
"name": "vmnp2"
}
}

{
"date": " Mon, 28 Oct 2013 14:56:29 GMT",
"status": "200",
"content-length": "208",
"content-type": "application/json; charset=UTF-8"
}
{
"network_profile": {
"segment_range": "700-705",
"segment_type": "vlan",
"name": "VlanNetProf",
"sub_type": null,
"physical_network": "p1",
"id": "58f722ca-489c-4abf-b74f-7bcc2e988d89",
"multicast_ip_range": null
}
}

Response Description

Property

Writeable or Readable

segment_range

Writeable

segment_type

Readable

name

Writeable

sub_type

Readable

physical_network

Readable

id

Readable

multicast_ip_range

Writeable

Delete a Network Profile

Name

cisco-network-profile-delete

Description

Deletes a network profile from a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

DELETE /v2.0/network_profiles/58f722ca-489c-4abf-b74f-7bcc2e988d89.json

Note

Retrieve the network profile ID as shown in Get a List of Network Profiles, specifying the profile name in the command line. For example: GET /v2.0/network_profiles.json?fields=id&name=VlanNetProf.

User Agent

python-neutronclient

Response Sample

{
"date": "Fri, 13 Sep 2013 01:02:01 GMT",
"status": "204",
"content-length": "0"
}

Response Description

Property

Writeable or Readable

content-length

Writeable

Create a Network

Name

net-create

Description

Creates a network on a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

POST /v2.0/networks.json

User Agent

python-neutronclient

Response Sample

{
"network": {
"n1kv:profile_id": "89b77e10-d363-4ee7-81b8-3e3e9ced5b08",
"name": "VlanNet1",
"admin_state_up": true
}
}
{
"date": "Fri, 13 Sep 2013 01:05:57 GMT",
"status": "201",
"content-length": "396",
"content-type": "application/json; charset=UTF-8"
}
{
"network": {
"status": "ACTIVE",
"subnets": [],
"name": "VlanNet1",
"provider:physical_network": "physnet1",
"admin_state_up": true,
"tenant_id": "4e56ea94b54442bab13dafcec9f52ebe",
"provider:network_type": "vlan",
"router:external": false,
"n1kv:profile_id": "89b77e10-d363-4ee7-81b8-3e3e9ced5b08",
"shared": false,
"id": "036a0a93-d7ef-4920-8ea1-bfe813aa21f4",
"provider:segmentation_id": 100
}
}

Response Description

Property

Writeable or Readable

status

Writeable

subnets

Writeable

name

Writeable

provider:physical_network

Writeable

admin_state_up

Writeable

tenant_id

Writeable

provider:network_type

Writeable

router:external

Writeable

n1kv:profile_id

Writeable

shared

Writeable

id

Readable

provider:segmentation_id

Writeable

Create a Port

Name

port-create

Description

Creates a port on a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

GET /v2.0/networks.json?fields=id&name=VlanNet1

User Agent

python-neutronclient

Response Sample

{
"date": "Fri, 13 Sep 2013 01:10:14 GMT",
"status": "200",
"content-length": "62",
"content-type": "application/json; charset=UTF-8",
"content-location": "http://172.23.180.45:9696/v2.0/networks.json?fields=id&name=VlanNet1"
}
{
"networks": [
{
"id": "036a0a93-d7ef-4920-8ea1-bfe813aa21f4"
}
]
}

Response Description

Property

Writeable or Readable

content-location

Writeable

id

Writeable

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

POST /v2.0/ports.json

User Agent

python-neutronclient

Response Sample

{
"port": {
"network_id": "036a0a93-d7ef-4920-8ea1-bfe813aa21f4",
"n1kv:profile_id": "452788f5-109d-4963-9153-1c5b181c8a0d",
"admin_state_up": true
}
}
{
"date": "Fri, 13 Sep 2013 01:10:14 GMT",
"status": "201",
"content-length": "472",
"content-type": "application/json; charset=UTF-8"
}
{
"port": {
"status": "ACTIVE",
"name": "",
"admin_state_up": true,
"network_id": "036a0a93-d7ef-4920-8ea1-bfe813aa21f4",
"tenant_id": "4e56ea94b54442bab13dafcec9f52ebe",
"binding:vif_type": "ovs",
"device_owner": "",
"n1kv:profile_id": "452788f5-109d-4963-9153-1c5b181c8a0d",
"mac_address": "fa:16:3e:0a:b8:ca",
"fixed_ips": [
{
"subnet_id": "9244aacc-8d0c-4fbd-8811-6f023cf8288a",
"ip_address": "10.10.10.3"
}
],
"id": "e94ad622-eda7-4030-83dd-303bff7a557a",
"device_id": ""
}
}

Response Description

Property

Writeable or Readable

name

Writeable

admin_state_up

Writeable

network_id

Writeable

tenant_id

Writeable

binding:vif_type

Writeable

device_owner

Writeable

n1kv:profile_id

Writeable

mac_address

Writeable

subnet_id

Writeable

ip_address

Writeable

id

Readable

device_id

Writeable

Preface

This preface contains the following sections:

- Audience

- Document Conventions

- Related Documentation for Cisco Nexus 1000V for KVM Software

- Documentation Feedback

- Obtaining Documentation and Submitting a Service Request

Audience

This publication is for network administrators who configure and maintain Cisco Nexus devices.

Document Conventions

Command descriptions use the following conventions:

Convention

Description

bold

Bold text indicates the commands and keywords that you enter literally as shown.

Italic

Italic text indicates arguments for which the user supplies the values.

[x]

Square brackets enclose an optional element (keyword or argument).

[x | y]

Square brackets enclosing keywords or arguments separated by a vertical bar indicate an optional choice.

{x | y}

Braces enclosing keywords or arguments separated by a vertical bar indicate a required choice.

[x {y | z}]

Nested set of square brackets or braces indicate optional or required choices within optional or required elements. Braces and a vertical bar within square brackets indicate a required choice within an optional element.

variable

Indicates a variable for which you supply values, in context where italics cannot be used.

string

A nonquoted set of characters. Do not use quotation marks around the string or the string will include the quotation marks.

Examples use the following conventions:

Convention

Description

screen font

Terminal sessions and information the switch displays are in screen font.

boldface screen font

Information you must enter is in boldface screen font.

italic screen font

Arguments for which you supply values are in italic screen font.

< >

Nonprinting characters, such as passwords, are in angle brackets.

[ ]

Default responses to system prompts are in square brackets.

!, #

An exclamation point (!) or a pound sign (#) at the beginning of a line of code indicates a comment line.

This document uses the following conventions:

Note

Means reader take note. Notes contain helpful suggestions or references to material not covered in the manual.

Caution

Means reader be careful. In this situation, you might do something that could result in equipment damage or loss of data.

Related Documentation for Cisco Nexus 1000V for KVM Software

This section lists the documents used with the Cisco Nexus 1000V for KVM software:

General Information

Cisco Nexus 1000V for KVM Release Notes

Install and Upgrade

Cisco Nexus 1000V for KVM Software Installation Guide

Configuration Guides

Cisco Nexus 1000V for KVM High-Availability Configuration Guide

Cisco Nexus 1000V for KVM Interface Configuration Guide

Cisco Nexus 1000V for KVM Layer 2 Configuration Guide

Cisco Nexus 1000V for KVM License Configuration Guide

Cisco Nexus 1000V for KVM Virtual Network Configuration Guide

Cisco Nexus 1000V for KVM Port Profile Configuration Guide

Cisco Nexus 1000V for KVM REST API Configuration Guide

Cisco Nexus 1000V for KVM Security Configuration Guide

Cisco Nexus 1000V for KVM System Management Configuration Guide

Cisco Nexus 1000V for KVM Verified Scalability Guide

Cisco Nexus 1000V for KVM VXLAN Configuration Guide

Reference Guides

Cisco Nexus 1000V for KVM Command Reference

Cisco Nexus 1000V for KVM OpenStack REST API Reference

Troubleshooting and Alerts

Cisco Nexus 1000V for KVM Troubleshooting Guide

Documentation Feedback

To provide technical feedback on this document, or to report an error or omission, please send your comments to:

We appreciate your feedback.

Obtaining Documentation and Submitting a Service Request

For information on obtaining documentation, using the Cisco Bug Search Tool (BST), submitting a service request, and gathering additional information, see What's New in Cisco Product Documentation, at: Click Here .

Subscribe to What's New in Cisco Product Documentation, which lists all new and revised Cisco technical documentation, as an RSS feed and deliver content directly to your desktop using a reader application. The RSS feeds are a free service.

THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS, INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.

THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY, CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.

The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version of the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California.

NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS. CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE.

IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.

Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: Click Here . Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)