Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM...

26
Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x First Published: August 01, 2014 Americas Headquarters Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA http://www.cisco.com Tel: 408 526-4000 800 553-NETS (6387) Fax: 408 527-0883

Transcript of Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM...

Page 1: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide,Release 5.xFirst Published: August 01, 2014

Americas HeadquartersCisco Systems, Inc.170 West Tasman DriveSan Jose, CA 95134-1706USAhttp://www.cisco.comTel: 408 526-4000 800 553-NETS (6387)Fax: 408 527-0883

Page 2: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

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 LIMITEDWARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITHTHE 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 versionof the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California.

NOTWITHSTANDINGANYOTHERWARRANTYHEREIN, 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 OFMERCHANTABILITY, FITNESS FORA PARTICULAR PURPOSEANDNONINFRINGEMENTORARISING FROMACOURSEOFDEALING, USAGE, OR TRADE PRACTICE.

IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUTLIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERSHAVE 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, networktopology 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 unintentionaland 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: http://www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnershiprelationship between Cisco and any other company. (1110R)

© 2014 Cisco Systems, Inc. All rights reserved.

Page 3: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

C O N T E N T S

P r e f a c e Preface v

Audience v

Document Conventions v

Related Documentation for Cisco Nexus 1000V for KVM Software vi

Documentation Feedback vii

Obtaining Documentation and Submitting a Service Request vii

C H A P T E R 1 Overview 1

Information About the Cisco Nexus 1000V OpenStack REST API 1

Finding Supported OpenStack Resource Names 2

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

C H A P T E R 2 Cisco Nexus 1000V OpenStack API Functions 5

Get the List of Policy Profiles 5

Get Information About a Policy Profile 6

Create a Network Profile 8

Get a List of Network Profiles 9

Get Information About a Network Profile 10

Update a Network Profile 12

Delete a Network Profile 13

Create a Network 14

Create a Port 16

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iii

Page 4: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.xiv

Contents

Page 5: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Preface

This preface contains the following sections:

• Audience, page v

• Document Conventions, page v

• Related Documentation for Cisco Nexus 1000V for KVM Software, page vi

• Documentation Feedback, page vii

• Obtaining Documentation and Submitting a Service Request, page vii

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

Document ConventionsCommand descriptions use the following conventions:

DescriptionConvention

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

bold

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

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

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

[x | y]

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

{x | y}

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x v

Page 6: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

DescriptionConvention

Nested set of square brackets or braces indicate optional or requiredchoices within optional or required elements. Braces and a vertical barwithin square brackets indicate a required choice within an optionalelement.

[x {y | z}]

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

variable

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

string

Examples use the following conventions:

DescriptionConvention

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

Information you must enter is in boldface screen font.boldface screen font

Arguments for which you supply values are in italic screen font.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 lineof code indicates a comment line.

!, #

This document uses the following conventions:

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

Note

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

Caution

Related Documentation for Cisco Nexus 1000V for KVM SoftwareThis section lists the documents used with the Cisco Nexus 1000V for KVM software:

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.xvi

PrefaceRelated Documentation for Cisco Nexus 1000V for KVM Software

Page 7: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

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 FeedbackTo provide technical feedback on this document, or to report an error or omission, please send your commentsto:

We appreciate your feedback.

Obtaining Documentation and Submitting a Service RequestFor information on obtaining documentation, using the Cisco Bug Search Tool (BST), submitting a servicerequest, and gathering additional information, seeWhat's New in Cisco Product Documentation, at: http://www.cisco.com/c/en/us/td/docs/general/whatsnew/whatsnew.html.

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

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x vii

PrefaceDocumentation Feedback

Page 8: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.xviii

PrefaceObtaining Documentation and Submitting a Service Request

Page 9: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

C H A P T E R 1Overview

This chapter contains the following sections:

• Information About the Cisco Nexus 1000V OpenStack REST API, page 1

• Finding Supported OpenStack Resource Names, page 2

• List of Available OpenStack Resource Names for the Cisco Nexus 1000V, page 2

Information About the Cisco Nexus 1000V OpenStack REST API

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 alsothe resources that Cisco added to support Nexus 1000v, such as cisco-network-profile andcisco-policy-profile.

Note

Accessing the core OpenStack resources through the RESTAPIs is thoroughly documented on the OpenStackWebsite. This document describes the resources that Cisco newly added or extended. The REST APIs can beaccessed 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 Keystoneservice and obtain an authorization token. You use this token with the curl command to access the Neutronresources.

• 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 onNeutron in JSON format:$ curl -k -X 'POST' -v http://192.168.10.25:5000/v2.0/tokens -d \'{"auth":{"passwordCredentials":{"username": "admin", "password":"pw1"}, \

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 1

Page 10: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

"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 NamesEvery 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 CiscoNexus 1000V

Table 1: Available Resource Names

DescriptionNamespace

Retrieves the list of policy profiles of a Cisco Nexus1000V switch.

cisco-policy-profile-list

Retrieves information about a port profile of a CiscoNexus 1000V switch.

cisco-policy-profile-show

Creates a network profile on a Cisco Nexus 1000Vswitch.

cisco-network-profile-create

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x2

OverviewFinding Supported OpenStack Resource Names

Page 11: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

DescriptionNamespace

Retrieves a list of network profiles from a CiscoNexus 1000V switch.

cisco-network-profile-list

Gets information about a network profile on a CiscoNexus 1000V switch.

cisco-network-profile-show

Updates a network profile on a Cisco Nexus 1000Vswitch.

cisco-network-profile-update

Deletes a network profile from a Cisco Nexus 1000Vswitch.

cisco-network-profile-delete

Creates a network on a Cisco Nexus 1000V switch.net-create

Creates a port on a Cisco Nexus 1000V switch.port-create

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 3

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

Page 12: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x4

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

Page 13: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

C H A P T E R 2Cisco Nexus 1000V OpenStack API Functions

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

The chapter contains the following topics:

• Get the List of Policy Profiles, page 5

• Get Information About a Policy Profile, page 6

• Create a Network Profile, page 8

• Get a List of Network Profiles, page 9

• Get Information About a Network Profile, page 10

• Update a Network Profile, page 12

• Delete a Network Profile, page 13

• Create a Network, page 14

• Create a Port, page 16

Get the List of Policy ProfilesName

cisco-policy-profile-list

Description

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

Type

Request

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 5

Page 14: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

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

Writeable or ReadableProperty

Readablecontent-location

Readableid

Readablename

Get Information About a Policy ProfileName

cisco-policy-profile-show

Description

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

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x6

Cisco Nexus 1000V OpenStack API FunctionsGet Information About a Policy Profile

Page 15: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

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

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

Note

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

Writeable or ReadableProperty

Readablecontent-location

Readableid

Readablename

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 7

Cisco Nexus 1000V OpenStack API FunctionsGet Information About a Policy Profile

Page 16: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Create a Network ProfileName

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

}}

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x8

Cisco Nexus 1000V OpenStack API FunctionsCreate a Network Profile

Page 17: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Response Description

Writeable or ReadableProperty

Writeablesegment_range

Writeablesegment_type

Writeablename

Writeablesub_type

Writeablephysical_network

Readableid

Writeablemulticast_ip_range

Get a List of Network ProfilesName

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

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 9

Cisco Nexus 1000V OpenStack API FunctionsGet a List of Network Profiles

Page 18: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

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

Writeable or ReadableProperty

Readablecontent-location

Readablesegment_range

Readablesegment_type

Readablename

Readablesub_type

Readablephysical_network

Readableid

Readablemulticast_ip_range

Get Information About a Network ProfileName

cisco-network-profile-show

Description

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

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x10

Cisco Nexus 1000V OpenStack API FunctionsGet Information About a Network Profile

Page 19: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Type

Request

Response Format

JSON

Accept Header

application/json

Verb and URI

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

Retrieve the network profile ID as shown in Get a List of Network Profiles, on page 9, specifying theprofile name in the command line. For example: GET

/v2.0/network_profiles.json?fields=id&name=VlanNetProf.

Note

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

Writeable or ReadableProperty

Readablecontent-location

Readablesegment_range

Readablesegment_type

Readablename

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 11

Cisco Nexus 1000V OpenStack API FunctionsGet Information About a Network Profile

Page 20: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Writeable or ReadableProperty

Readablesub_type

Readablephysical_network

Readableid

Readablemulticast_ip_range

Update a Network ProfileName

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

Retrieve the network profile ID as shown in Get a List of Network Profiles, on page 9, specifying theprofile name in the command line. For example: GET

/v2.0/network_profiles.json?fields=id&name=vmnp2.

Note

User Agent

python-neutronclient

Response Sample{"network_profile": {"name": "vmnp2"

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x12

Cisco Nexus 1000V OpenStack API FunctionsUpdate a Network Profile

Page 21: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

}}

{"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

Writeable or ReadableProperty

Writeablesegment_range

Readablesegment_type

Writeablename

Readablesub_type

Readablephysical_network

Readableid

Writeablemulticast_ip_range

Delete a Network ProfileName

cisco-network-profile-delete

Description

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

Type

Request

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 13

Cisco Nexus 1000V OpenStack API FunctionsDelete a Network Profile

Page 22: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Response Format

JSON

Accept Header

application/json

Verb and URI

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

Retrieve the network profile ID as shown in Get a List of Network Profiles, on page 9, specifying theprofile name in the command line. For example: GET

/v2.0/network_profiles.json?fields=id&name=VlanNetProf.

Note

User Agent

python-neutronclient

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

}

Response Description

Writeable or ReadableProperty

Writeablecontent-length

Create a NetworkName

net-create

Description

Creates a network on a Cisco Nexus 1000V switch.

Type

Request

Response Format

JSON

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x14

Cisco Nexus 1000V OpenStack API FunctionsCreate a Network

Page 23: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

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

Writeable or ReadableProperty

Writeablestatus

Writeablesubnets

Writeablename

Writeableprovider:physical_network

Writeableadmin_state_up

Writeabletenant_id

Writeableprovider:network_type

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 15

Cisco Nexus 1000V OpenStack API FunctionsCreate a Network

Page 24: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

Writeable or ReadableProperty

Writeablerouter:external

Writeablen1kv:profile_id

Writeableshared

Readableid

Writeableprovider:segmentation_id

Create a PortName

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": [

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x16

Cisco Nexus 1000V OpenStack API FunctionsCreate a Port

Page 25: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

{"id": "036a0a93-d7ef-4920-8ea1-bfe813aa21f4"

}]

}

Response Description

Writeable or ReadableProperty

Writeablecontent-location

Writeableid

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": [

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x 17

Cisco Nexus 1000V OpenStack API FunctionsCreate a Port

Page 26: Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide… · Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x iv Contents

{"subnet_id": "9244aacc-8d0c-4fbd-8811-6f023cf8288a","ip_address": "10.10.10.3"

}],"id": "e94ad622-eda7-4030-83dd-303bff7a557a","device_id": ""

}}

Response Description

Writeable or ReadableProperty

Writeablename

Writeableadmin_state_up

Writeablenetwork_id

Writeabletenant_id

Writeablebinding:vif_type

Writeabledevice_owner

Writeablen1kv:profile_id

Writeablemac_address

Writeablesubnet_id

Writeableip_address

Readableid

Writeabledevice_id

Cisco Nexus 1000V for KVM OpenStack REST API Configuration Guide, Release 5.x18

Cisco Nexus 1000V OpenStack API FunctionsCreate a Port