NSX-T API Guide

NSX-T 1.1.0

Table of Contents

  1. Overview
  2. API Methods
    1. Licensing
    2. Nsx Admin
      1. Appliance Management
      2. Backup Config
      3. Cluster Management
    3. Users and Roles
    4. Aggregation Service
      1. Configuration
    5. Api Services
      1. Api Request Batching
      2. Authentication
      3. Task Management
    6. Associations
    7. Error Resolver
    8. Fabric
      1. Nodes
      2. Vifs
      3. Virtual Machines
    9. Grouping Objects
      1. Ip Sets
      2. Mac Sets
      3. Ns Groups
      4. Ns Service Groups
      5. Ns Services
    10. Licensing
    11. Logical Routing And Services
      1. Bfd Peers
      2. Dhcp Relay
      3. Dhcp Relay Profiles
      4. Logical Router Ports
      5. Logical Routers
      6. Nat
      7. Routing Bfd Configuration
      8. Routing Configuration
      9. Service Profiles
      10. Services
    12. Logical Switching
      1. Logical Switch Ports
      2. Logical Switches
      3. Switching Profiles
    13. Network Transport
      1. Bridge Clusters
      2. Bridge Endpoints
      3. Cluster Profiles
      4. Edge Clusters
      5. Hostswitch Profiles
      6. Transport Nodes
      7. Transport Profiles
      8. Transport Zones
    14. Normalization
    15. Nsx Component Administration
      1. Appliance Management
      2. Cluster Management
      3. Trust Management
        1. Certificate
        2. Crl
        3. Csr
    16. Operations
      1. Ipfix
    17. Pool Management
      1. Ip Pools
      2. Vni Pools
    18. Realization
    19. Services
      1. Dhcp
      2. Firewall
      3. Metadata Proxy
      4. Networkencryption
    20. Transport Entities
      1. Transport-Nodes
    21. Troubleshooting And Monitoring
      1. Heatmap
      2. Ipfix
      3. Portconnection
      4. Portmirroring
      5. System Logs
      6. Traceflow
    22. Uirpc
    23. Upgrade
      1. Bundle
      2. Group
      3. History
      4. Nodes
      5. Plan
      6. Status
      7. Upgradeunits
  3. API Types
  4. API Type Schemas
  5. API Errors


Overview

Introduction

NSX-T provides a programmatic API to automate the management of the node. The API follows a resource-oriented Representational State Transfer (REST) architecture, using JSON object encoding. Clients interact with the API using RESTful web service calls over the HTTPS protocol.

Each API method is identified by a request method and URI. Method parameters are specified as key-value pairs appended to the URI. Unless otherwise noted, request and response bodies are encoded using JSON, and must conform to the JSON schema associated with each method. The content type of each request and reply is "application/json" unless otherwise specified. Each request that can be made is documented in the API Methods section. The associated request and response body schemas are documented in the API Schemas section.

It is possible for any request to fail. Errors are reported using standard HTTP response codes. It should be assumed the following errors could be returned by any API method: 301 Moved Permanently, 307 Temporary Redirect, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 500 Internal Server Error, 503 Service Unavailable. Where other errors may be returned, the type of error is indicated in the API method description. All errors are documented in the API Errors section. It is possible for requests to partially complete before failing. Any inconsistent state resulting from a failure must be resolved by the caller.

Request Authentication

Most API calls require authentication. This API supports HTTP Basic authentication and session-based authentication schemes. Multiple authentication schemes may not be used concurrently.

HTTP Basic Authentication

To authenticate a request using HTTP Basic authentication, the caller's credentials are passed using the 'Authorization' header. The header content should consist of a base64-encoded string containing the username and password separated by a single colon (":") character, as specified in RFC 1945 section 11.1.

For example, to authenticate a request using the default credentials of user admin with password admin, include the following header with the request:

Authorization: Basic YWRtaW46YWRtaW4=

The following cURL command will authenticate to the manager using basic authentication and will issue a GET request for logical ports:

curl -k -u USERNAME:PASSWORD https://MANAGER/api/v1/logical-ports

where:
USERNAME is the user to authenticate as,
PASSWORD is the password to provide, and
MANAGER is the IP address or host name of the NSX manager

For example:

curl -k -u admin:secretPw99 https://192.168.22.32/api/v1/logical-ports

Note: the -k argument instructs cURL to skip verifying the manager's self-signed X.509 certificate.

Session-based Authentication

Session-based authentication is used by calling the /api/session/create authentication API to manage a session cookie. The session cookie returned in the result of a successful login must be provided in subsequent requests in order to associate those requests with the session.

Session state is local to the server responding to the API request. Idle sessions will automatically time-out, or can be terminated immediately using the POST /logout API.

To obtain a session cookie, POST form data to the server using the application/x-ww-form-urlencoded media type, with fields "j_username" and "j_password" containing the username and password. The following cURL command will authenticate to the server and will deposit the session cookie in the file "cookies.txt":

curl -k -c cookies.txt -X POST -d j_username=USERNAME&j_password=PASSWORD https://MANAGER/api/session/create

For example:

curl -k -c cookies.txt -X POST -d j_username=admin&j_password=secretPw99 https://192.168.22.32/api/session/create

The manager will respond with the roles and permissions granted to the user, and cURL will deposit the session cookie into the file "cookies.txt".

In subsequent cURL requests, use the -b argument to specify the cookie file:

curl -k -b cookies.txt -X GET https://192.168.22.32/api/v1/logical-ports

When the session expires, the manager will respond with a 403 Forbidden HTTP response, at which point you must obtain a new session cookie.

Experimental Features

The following features are experimental and are not fully supported:

Example Requests and Responses

Most of the API calls below have example requests and responses. Your actual response might differ from the example in the number of fields returned because optional empty fields are not returned when you make an API call.

Restrictions on Certain Fields in a Request

In layer 2 switching, the following fields can contain any character except these 6 characters: semicolon (;), vertical bar (|), equal sign (=), comma (,), tilde (~), and the "at" sign (@). They also have a maximum length limitation as specified below:

OpenAPI Specification of NSX-T API

You can get a OpenAPI specification of the NSX-T API with one of the following calls:



API Methods

Toggle all tables +

Licensing

Associated URIs:

Add a new license key

This will add a license key to the system. The API supports adding only one license key for each license edition type - Standard, Advanced or Enterprise. If a new license key is tried to add for an edition for which the license key already exists, then this API will return an error. Request:
Method:
POST
URI Path:
/api/v1/licenses
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
License+

Example Request: POST https://<nsx-mgr>/api/v1/licenses { "license_key": "11111-22222-33333-44444-55555" } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
License+

Example Response: { "features":"mh, l2-vlan,l2-vxlan,l3,l2-edge,dfw,efw,lb,vpn,multi-vc,policy,si-ovsdb,si-guest, si-netx,si-pp,av,dlb,mpls", "capacity_type": "VM" "product_version": "1.0", "quantity": 1, "is_eval": false, "description" : "NSX Standard Edition" "expiry": 1458688231359, "product_name" : "NSX", "is_mh": false, "license_key": "11111-22222-33333-44444-55555" } Required Permissions: read-write-api Additional Errors:

Remove a license identified by the license-key

This will delete the license key identified in the URI by the and its properties from the system. Don't allow to delete the last key. Request:
Method:
DELETE
URI Path:
/api/v1/licenses/<license-key>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/licenses/11111-22222-33333-44444-55555 Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Get license properties for license identified by the license-key

This will get the properties of a particular license idetified in the URI by the Request:
Method:
GET
URI Path:
/api/v1/licenses/<license-key>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/licenses/11111-22222-33333-44444-55555 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
License+

Example Response: { "features":"mh, l2-vlan,l2-vxlan,l3,l2-edge,dfw,efw,lb,vpn,multi-vc,policy,si-ovsdb,si-guest, si-netx,si-pp,av,dlb,mpls", "capacity_type": "VM" "product_version": "1.0", "quantity": 1, "is_eval": false, "description": "NSX Standard Edition" "expiry": 1458688231359, "product_name": "NSX", "is_mh": false, "license_key": "11111-22222-33333-44444-55555" } Required Permissions: read-api Additional Errors:

Nsx Admin

Nsx Admin: Appliance Management

Associated URIs:

Restore node backup

Restores the NSX Manager state, using backup information from the specified backup file. Important: This restore request is one part of the restore process. You must complete all backup and restore tasks in the correct order. See the NSX-T Administration Guide for information and instructions about performing backups and restores. Request:
Method:
POST
URI Path:
/api/v1/node/backups?action=restore
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
RestoreProperties+

Example Request: POST https://<nsx-mgr>/api/v1/node/backups?action=restore { "restore_file": { "file_store": "remote", "passphrase": "backup_secret", "server": "10.1.1.1", "uri": "/backups/nsx_node_20151231.bak", "protocol": { "name": "scp", "ssh_fingerprint": "61158a0316bb060c0a42dbc68b149a88", "authentication_scheme": { "scheme_name": "password", "username": "scp_user", "password": "scp_user_password" } } } } Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Nsx Admin: Backup Config

Associated URIs:

Get backup configuration

Get a configuration of a file server and timers for automated backup. Fields that contain secrets (password, passphrase) are not returned. Request:
Method:
GET
URI Path:
/api/v1/cluster/backups/config
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
BackupConfiguration+

Example Response: { "backup_enabled" : true; "backup_schedule":{ "resource_type": "WeeklyBackupSchedule", "days_of_week":[ 1, 3, 5 ], "hour_of_day":0, "minute_of_day":0 }, "remote_file_server":{ "server":"10.1.2.3", "port":22, "protocol":{ "protocol_name":"sftp", "ssh_fingerprint":"43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8", "authentication_scheme":{ "scheme_name":"password", "username":"admin" } }, "directory_path":"/nsx-backups" }, "inventory_summary_interval":300 } Required Permissions: read-api Additional Errors:

Configure backup

Configure file server and timers for automated backup. If secret fields are omitted (password, passphrase) then use the previously set value. Request:
Method:
PUT
URI Path:
/api/v1/cluster/backups/config
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
BackupConfiguration+

Example Request: PUT https://<nsx-mgr>/api/v1/backups/config { "backup_enabled" : true; "backup_schedule":{ "resource_type": "WeeklyBackupSchedule", "days_of_week":[ 1, 3, 5 ], "hour_of_day":0, "minute_of_day":0 }, "remote_file_server":{ "server":"10.1.2.3", "port":22, "protocol":{ "protocol_name":"sftp", "ssh_fingerprint":"43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8", "authentication_scheme":{ "scheme_name":"password", "username":"admin", "password":"default" } }, "directory_path":"/nsx-backups" }, "passphrase":"swordfish", "inventory_summary_interval":300 }| PUT https://<nsx-mgr>/api/v1/backups/config { "backup_enabled" : true; "interval_config":{ "resource_type": "IntervalBackupSchedule", "seconds_between_backups":90 }, "remote_file_server":{ "server":"10.1.2.3", "port":22, "protocol":{ "protocol_name":"sftp", "ssh_fingerprint":"43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8", "authentication_scheme":{ "scheme_name":"password", "username":"admin", "password":"default" } }, "directory_path":"/nsx-backups" }, "passphrase":"swordfish", "inventory_summary_interval":300 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
BackupConfiguration+

Required Permissions: read-write-api Additional Errors:

Get backup history

Get history of previous backup operations Request:
Method:
GET
URI Path:
/api/v1/cluster/backups/history
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
BackupOperationHistory+

Example Response: { "cluster_backup_statuses": [ { "backup_id" : "backup-2128af2d-d763-4a27-80e0-4933af7e4824-1462221358", "start_time": 1462396258, "end_time": 1462396558, "success": true, } ], "node_backup_statuses": [ { "backup_id" : "backup-3128af2d-d763-4a27-80e0-4933af7e4824-1462221359", "start_time": 1462396258, "end_time": 1462396558, "success": false, "error_code": "BACKUP_RESTORE_FILESERVER_OPERATION_TIMEOUT" "error_message": "Timed out while transmitting data to fileserver" } ], "inventory_backup_statuses": [ { "backup_id" : "backup-4128af2d-d763-4a27-80e0-4933af7e4824-1462221360", "start_time": 1462396258, "end_time": 1462396558, "success": true, } ] } Required Permissions: read-api Additional Errors:

Get backup status

Get status of active backup operations Request:
Method:
GET
URI Path:
/api/v1/cluster/backups/status
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
CurrentBackupOperationStatus+

Example Response: { "operation_type": "backup", "backup_id": "backup-2128af2d-d763-4a27-80e0-4933af7e4824-1462221358", "current_step": "backup_uploading_cluster_backup", "current_step_message": "Uploaded XXX bytes", "start_time": 1462396258 "expected_end_time": 1462396558 } Required Permissions: read-api Additional Errors:

Request one-time backup

Request one-time backup. The backup will be uploaded using the same server configuration as for automatic backup. Request:
Method:
POST
URI Path:
/api/v1/cluster?action=backup_to_remote
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: POST https://<nsx-mgr>/api/v1/cluster?action=backup_to_remote Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Request one-time inventory summary.

Request one-time inventory summary. The backup will be uploaded using the same server configuration as for automatic backup. Request:
Method:
POST
URI Path:
/api/v1/cluster?action=summarize_inventory_to_remote
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: POST https://<nsx-mgr>/api/v1/cluster?action=summarize_inventory_to_remote Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Nsx Admin: Cluster Management

Associated URIs:

Restore cluster backup

Restores the NSX cluster state, using backup information from the specified backup file. Important: This restore request is one part of the restore process. You must complete all backup and restore tasks in the correct order. See the NSX-T Administration Guide for information and instructions about performing backups and restores. Request:
Method:
POST
URI Path:
/api/v1/cluster/backups?action=restore
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
RestoreProperties+

Example Request: POST https://<nsx-mgr>/api/v1/cluster/backups?action=restore { "restore_file": { "file_store": "remote", "passphrase": "backup_secret", "server": "10.1.1.1", "uri": "/backups/nsx_cluster_20151231.zip", "protocol": { "name": "sftp", "ssh_fingerprint": "61158a0316bb060c0a42dbc68b149a88", "authentication_scheme": { "scheme_name": "password", "username": "sftp_user", "password": "sftp_user_password" } } } } Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Users and Roles

Associated URIs:

Get information about logged-in user

Request:
Method:
GET
URI Path:
/api/v1/aaa/user-info
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/aaa/user-info Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
UserInfo+

Example Response: { "user_name": "admin", "roles": [ { "role": "superusers", "permissions": [ "read-api", "read-write-api", "read-cli", "read-write-cli" ] } ] } Required Permissions: read-api Additional Errors:

Aggregation Service

Aggregation Service: Configuration

Associated URIs:

List all health performance monitoring feature stacks

Request:
Method:
GET
URI Path:
/api/v1/hpm/features
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/hpm/features Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
FeatureStackCollectionConfigurationList+

Example Response: { "cursor": "0036849e339e-64b7-47cb-9480-33068f70dc5als-demo", "result_count": 1, "results": [ { "feature_stack_name": "HostNodeStatusVertical" "client_type_collection_configurations": [ { "client_type": "CONTROL_PLANE" "collection_type_configurations": [ { "collection_type": "STATUS" "collection_frequency": 60 }, { "collection_type": "STATISTICS" "collection_frequency": 300 } }, { "client_type": "MANAGEMENT_PLANE" "collection_type_configurations": [ { "collection_type": "STATUS" "collection_frequency": 60 }, { "collection_type": "STATISTICS" "collection_frequency": 300 } } ] } ] } Required Permissions: read-api Additional Errors:

Update health performance monitoring configuration for feature stack

Apply the data collection configuration for the specified feature stack. Request:
Method:
PUT
URI Path:
/api/v1/hpm/features/<feature-stack-name>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
FeatureStackCollectionConfiguration+

Example Request: PUT https://<nsx-mgr>/api/v1/hpm/features/FabricStats { "resource_type": "FeatureStackCollectionConfiguration", "display_name": "FabricStats", "feature_stack_name": "FabricStats", "client_type_collection_configurations": [ { "client_type": "HYPERVISOR", "data_type_configurations": [ { "collection_frequency": 120, "data_type": "STATUS" } ] } ], "_revision": 1 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
FeatureStackCollectionConfiguration+

Example Response: { "resource_type": "FeatureStackCollectionConfiguration", "id": "01b0e1fe-a8c9-4a76-af6a-d59890141145", "display_name": "FabricStats", "feature_stack_name": "FabricStats", "client_type_collection_configurations": [ { "client_type": "HYPERVISOR", "data_type_configurations": [ { "collection_frequency": 120, "data_type": "STATUS" } ] } ], "_revision": 2 } Required Permissions: read-write-api Additional Errors:

Read health performance monitoring configuration for feature stack

Returns the complete set of client type data collection configuration records for the specified feature stack. Request:
Method:
GET
URI Path:
/api/v1/hpm/features/<feature-stack-name>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/hpm/features/HostNodeStatusVertical Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
FeatureStackCollectionConfiguration+

Example Response: { "resource_type" : "FeatureStackCollectionConfiguration", "id" : "78c2b5d5-a591-4bfc-ba9b-c2a9ed63091b", "display_name" : "HostNodeStatusVertical", "feature_stack_name" : "HostNodeStatusVertical", "client_type_collection_configurations" : [ { "client_type" : "HYPERVISOR", "data_type_configurations" : [ { "collection_frequency" : 61, "data_type" : "STATISTICS" }, { "collection_frequency" : 60, "data_type" : "STATUS" } ] }, { "client_type" : "MANAGEMENT_PLANE", "data_type_configurations" : [ { "collection_frequency" : 61, "data_type" : "STATISTICS" }, { "collection_frequency" : 15, "data_type" : "STATUS" } ] }, { "client_type" : "MANAGEMENT_PLANE_PLATFORM", "data_type_configurations" : [ { "collection_frequency" : 61, "data_type" : "STATISTICS" }, { "collection_frequency" : 15, "data_type" : "STATUS" } ] }, { "client_type" : "EDGE", "data_type_configurations" : [ { "collection_frequency" : 61, "data_type" : "STATISTICS" }, { "collection_frequency" : 60, "data_type" : "STATUS" } ] }, { "client_type" : "CONTROL_PLANE_PLATFORM", "data_type_configurations" : [ { "collection_frequency" : 61, "data_type" : "STATISTICS" }, { "collection_frequency" : 15, "data_type" : "STATUS" } ] } ], "_revision" : 1 } Required Permissions: read-api Additional Errors:

Reset the data collection frequency configuration setting to the default values

Request:
Method:
POST
URI Path:
/api/v1/hpm/features/<feature-stack-name>?action=reset_collection_frequency
Request Headers:
n/a
Query Parameters:
AggregationServiceActionRequestParameters+
Request Body:
n/a

Example Request: POST https://<nsx-mgr>/api/v1/hpm/features/FabricStats?action=reset_collection_frequency Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
FeatureStackCollectionConfiguration+

Example Response: { "resource_type": "FeatureStackCollectionConfiguration", "id": "1d8b2673-dbba-4368-a1fd-c97edbb04c7d", "display_name": "FabricStats", "feature_stack_name": "FabricStats", "client_type_collection_configurations": [ { "client_type": "HYPERVISOR", "data_type_configurations": [ { "collection_frequency": 60, "data_type": "STATUS" } ] } ], "_revision": 1 } Required Permissions: read-write-api Additional Errors:

Set the global configuration for aggregation service related data collection

Request:
Method:
PUT
URI Path:
/api/v1/hpm/global-config
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
GlobalCollectionConfiguration+

Example Request: PUT https://<nsx-mgr>/api/v1/hpm/global-config { "resource_type": "GlobalCollectionConfiguration", "id": "74d59b24-c433-4d3d-bb92-6870bb35b037", "display_name": "Global Data Collection Configuration", "is_data_collection_enabled": true, "modified_feature_stack_collection_configurations": { "results": [] }, "aggregated_data_collection_frequency": 400, "_revision": 1 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
GlobalCollectionConfiguration+

Example Response: { "resource_type": "GlobalCollectionConfiguration", "id": "74d59b24-c433-4d3d-bb92-6870bb35b037", "display_name": "Global Data Collection Configuration", "is_data_collection_enabled": true, "modified_feature_stack_collection_configurations": { "results": [] }, "aggregated_data_collection_frequency": 400, "_last_modified_time": 1458245693232, "_create_time": 1457468839463, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "system", "_revision": 2 } Required Permissions: read-write-api Additional Errors:

Read global health performance monitoring configuration

Request:
Method:
GET
URI Path:
/api/v1/hpm/global-config
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/hpm/global-config Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
GlobalCollectionConfiguration+

Example Response: { "resource_type": "GlobalCollectionConfiguration", "id": "74d59b24-c433-4d3d-bb92-6870bb35b037", "display_name": "Global Data Collection Configuration", "is_data_collection_enabled": true, "modified_feature_stack_collection_configurations": { "results": [] }, "aggregated_data_collection_frequency": 300, "_last_modified_time": 1457468839463, "_create_time": 1457468839463, "_last_modified_user": "system", "_system_owned": false, "_create_user": "system", "_revision": 1 } Required Permissions: read-api Additional Errors:

Api Services

Api Services: Api Request Batching

Associated URIs:

Register a Collection of API Calls at a Single End Point

Enables you to make multiple API requests using a single request. The batch API takes in an array of logical HTTP requests represented as JSON arrays. Each request has a method (GET, PUT, POST, or DELETE), a relative_url (the portion of the URL after https://<nsx-mgr>/api/), optional headers array (corresponding to HTTP headers) and an optional body (for POST and PUT requests). The batch API returns an array of logical HTTP responses represented as JSON arrays. Each response has a status code, an optional headers array and an optional body (which is a JSON-encoded string). Request:
Method:
POST
URI Path:
/api/v1/batch
Request Headers:
n/a
Query Parameters:
BatchParameter+
Request Body:
BatchRequest+

Example Request: POST https://<nsx-mgr>/api/v1/batch { "requests":[ { "method":"POST", "uri":"/v1/switching-profiles", "body": { "resource_type": "SpoofGuardSwitchingProfile", "display_name": "spoof-guard-lswitch-bindings", "white_list_providers": ["LSWITCH_BINDINGS"] } }, { "method":"GET", "uri":"/v1/switching-profiles" } ] } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
BatchResponse+

Example Response: { "results": [ { "body": { "revision": 0, "id": "9e6e5375-d7d9-48b4-9118-b1121757f1e3", "display_name": "custom1-qos-switching-profile", "code": 201, "body": { "resource_type": "SpoofGuardSwitchingProfile", "id": "02d866d7-495c-47f4-b945-61a8559219b9", "display_name": "spoof-guard-lswitch-bindings", "white_list_providers": [ "LSWITCH_BINDINGS" ], "_last_modified_time": 1458772318447, "_create_time": 1458772318447, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 } }, { "code": 200, "body": { "cursor": "00361b53de57-0313-4f3d-b494-635c58b1d986spoof-guard-lswitch-bindings", "result_count": 4, "results": [ { "_revision": 0, "id": "9e6e5375-d7d9-48b4-9118-b1121757f1e3", "display_name": "custom1-qos-switching-profile", "resource_type": "QosSwitchingProfile", "description": "", "id": "7f39bf67-ccf5-4613-8993-506ec89d893a", "display_name": "TT", "dscp": { "mode": "TRUSTED", "priority": 0 }, "shaper_configuration": [ { "resource_type": "IngressRateShaper", "enabled": false, "average_bandwidth_mbps": 0, "peak_bandwidth_mbps": 0, "burst_size_bytes": 0 }, { "resource_type": "IngressBroadcastRateShaper", "enabled": false, "burst_size_bytes": 0, "peak_bandwidth_kbps": 0, "average_bandwidth_kbps": 0 }, { "resource_type": "EgressRateShaper", "enabled": false, "average_bandwidth_mbps": 0, "peak_bandwidth_mbps": 0, "burst_size_bytes": 0 } ], "class_of_service": 2, "_last_modified_time": 1457999948761, "_create_time": 1457999948761, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_last_modified_user": "admin" }, "code": 201 }, { "body": { "result_count": 9, "results": [ { "resource_type": "IpfixSwitchingProfile", "revision": 0, "id": "cb317635-939b-430a-ae50-005fc4c6ac14", "display_name": "nsx-default-ipfix-global-profile", "enabled": false, "_last_modified_time": 1413324646801, "_create_time": 1413324646801, "_create_user": "system", "_last_modified_user": "system" }, { "resource_type": "QosSwitchingProfile", "revision": 0, "id": "9e6e5375-d7d9-48b4-9118-b1121757f1e3", "display_name": "custom1-qos-switching-profile", "system_defined": false, "dscp": { "priority": 1, "mode": "UNTRUSTED" }, "burst_size": 20, "class_of_service": 1, "peak_bandwidth": 400, "average_bandwidth": 200, "_last_modified_time": 1413349096169, "_create_time": 1413349096169, "_create_user": "admin", "_last_modified_user": "admin" }, { "resource_type": "IpDiscoverySwitchingProfile", "revision": 0, "id": "64814784-7896-3901-9741-badeff705639", "display_name": "nsx-default-ip-discovery-overlay-profile", "system_defined": true, "arp_snooping_enabled": true, "dhcp_snooping_enabled": true, "_last_modified_time": 1413324646789, "_create_time": 1413324646789, "_create_user": "system", "_last_modified_user": "system" }, { "resource_type": "IpDiscoverySwitchingProfile", "revision": 0, "id": "64814874-6987-1093-1479-badeff705639", "display_name": "nsx-default-ip-discovery-vlan-profile", "system_defined": true, "arp_snooping_enabled": false, "dhcp_snooping_enabled": false, "_last_modified_time": 1413324646800, "_create_time": 1413324646800, "_create_user": "system", "_last_modified_user": "system" }, { "resource_type": "QosSwitchingProfile", "revision": 0, "id": "f313290b-eba8-4262-bd93-fab5026e9495", "display_name": "nsx-default-qos-switching-profile", "system_defined": true, "dscp": { "priority": 0, "mode": "TRUSTED" }, "burst_size": 0, "class_of_service": 0, "peak_bandwidth": 0, "average_bandwidth": 0, "_last_modified_time": 1413324646729, "_create_time": 1413324646729, "_create_user": "system", "_last_modified_user": "system" }, { "resource_type": "PortMirroringSwitchingProfile", "revision": 1, "id": "93b4b7e8-f116-415d-a50c-3364611b5d09", "display_name": "nsx-default-port-mirroring-profile", "system_defined": false, "direction": "INGRESS", "_last_modified_time": 1413345541673, "_create_time": 1413324646767, "_create_user": "system", "_last_modified_user": "admin" } ] }, "code": 200 "_revision": 0 }, { "resource_type": "SpoofGuardSwitchingProfile", "id": "ff45644f-9dda-4970-b1e3-30ac11ff0582", "display_name": "spoof-guard-lswitch-bindings", "white_list_providers": [ "LSWITCH_BINDINGS" ], "_last_modified_time": 1458754361177, "_create_time": 1458754361177, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 }, { "resource_type": "SpoofGuardSwitchingProfile", "id": "02d866d7-495c-47f4-b945-61a8559219b9", "display_name": "spoof-guard-lswitch-bindings", "white_list_providers": [ "LSWITCH_BINDINGS" ], "_last_modified_time": 1458772318447, "_create_time": 1458772318447, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 }, { "resource_type": "SpoofGuardSwitchingProfile", "id": "1b53de57-0313-4f3d-b494-635c58b1d986", "display_name": "spoof-guard-lswitch-bindings", "white_list_providers": [ "LSWITCH_BINDINGS" ], "_last_modified_time": 1458754382102, "_create_time": 1458754382102, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 } ] } } Required Permissions: read-api Additional Errors:

Api Services: Authentication

Associated URIs:

Update node authentication policy configuration

Update the currently configured authentication policy on the node. Request:
Method:
PUT
URI Path:
/api/v1/node/aaa/auth-policy
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
AuthenticationPolicyProperties+

Example Request: PUT https://<nsx-mgr>/api/v1/node/aaa/auth-policy { "minimum_password_length": 12 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
AuthenticationPolicyProperties+

Example Response: { "minimum_password_length": 12 } Required Permissions: read-write-api Additional Errors:

Read node authentication policy configuration

Returns information about the currently configured authentication policies on the node. Request:
Method:
GET
URI Path:
/api/v1/node/aaa/auth-policy
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/node/aaa/auth-policy Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
AuthenticationPolicyProperties+

Example Response: { "minimum_password_length": 8 } Required Permissions: read-api Additional Errors:

Api Services: Task Management

Associated URIs:

Get information about all tasks

Request:
Method:
GET
URI Path:
/api/v1/tasks
Request Headers:
n/a
Query Parameters:
TaskQueryParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/tasks Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
TaskListResult+

Example Response: { "result_count" : 1, "results" : [ { "start_time" : 1478646470253, "async_response_available" : true, "cancelable" : false, "end_time" : 1478646470344, "progress" : 100, "id" : "59c7d6c8-7d64-4f0e-8af5-0b5e92bc3330", "user" : "admin", "status" : "SUCCESS" } ] } Required Permissions: read-api Additional Errors:

Get information about the specified task

Request:
Method:
GET
URI Path:
/api/v1/tasks/<task-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/tasks/ab265781-c826-4da7-9487-48a5c713a481 Successful Response:
Response Code:
200 OK, 303 See Other
Response Headers:
Content-type: application/json
Response Body:
TaskProperties+

Example Response: { "progress" : 100, "id" : "ab265781-c826-4da7-9487-48a5c713a481", "end_time" : 1416959364977, "status" : "success", "async_response_available" : false, "cancelable" : false, "start_time" : 1416959362874 } Required Permissions: read-api Additional Errors:

Get the response of a task

Request:
Method:
GET
URI Path:
/api/v1/tasks/<task-id>/response
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/tasks59c7d6c8-7d64-4f0e-8af5-0b5e92bc3330/response Successful Response:
Response Code:
200 OK, 303 See Other
Response Headers:
Content-type: application/json
Response Body:
object

Example Response: { "cursor" : "", "sort_ascending" : true, "sort_by" : "displayName", "result_count" : 0, "results" : [ ] } Required Permissions: read-api Additional Errors:

Associations

Associated URIs:

Get ResourceReference objects to which the given resource belongs to

Returns information about resources that are associated with the given resource. Id and type of the resource for which associated resources are to be fetched are to be specified as query parameter in the URI. Resource type of the associated resources must be specified as query parameter. Request:
Method:
GET
URI Path:
/api/v1/associations
Request Headers:
n/a
Query Parameters:
AssociationListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/associations?resource_id= bf250578-c0a5-4ca0-b237-0375966d23ce&resource_type=MACSet&associated_resource_type=NSGroup Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
AssociationListResult+

Example Response: { "sort_by": "displayName", "sort_ascending": true, "result_count": 1, "results": [ { "target_type": "NSGroup", "target_display_name": "testNSGroup", "target_id": "4f3ba7e3-4876-45ef-882a-34bdcb1a1ac8" } ] } Required Permissions: read-api Additional Errors:

Error Resolver

Associated URIs:

Fetches a list of metadata for all the registered error resolvers

Returns a list of metadata for all the error resolvers registered. Request:
Method:
GET
URI Path:
/api/v1/error-resolver
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/error-resolver Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
ErrorResolverInfoList+

Example Response: { "results": [ { "user_metadata": { "user_input_list": [ { "property_value": "1000", "property_name": "connectTimeout", "data_type": "NUMBER" } ] }, "error_id": 1002, "resolver_present": true }, { "user_metadata": {}, "error_id": 1001, "resolver_present": true } ] } Required Permissions: read-api Additional Errors:

Fetches metadata about the given error_id

Returns some metadata about the given error_id. This includes information of whether there is a resolver present for the given error_id and its associated user input data Request:
Method:
GET
URI Path:
/api/v1/error-resolver/<error_id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/error-resolver/1002 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
ErrorResolverInfo+

Example Response: { "user_metadata": { "user_input_list": [ { "property_value": "1000", "property_name": "connectTimeout", "data_type": "NUMBER" } ] }, "error_id": 1002, "resolver_present": true } Required Permissions: read-api Additional Errors:

Resolves the error

Invokes the corresponding error resolver for the given error(s) present in the payload Request:
Method:
POST
URI Path:
/api/v1/error-resolver?action=resolve_error
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
ErrorResolverMetadataList+

Example Request: POST https://<nsx-mgr>/api/v1/error-resolver?action=resolve_error { "errors": [ { "user_metadata": { "user_input_list": [ { "property_value": "default", "property_name": "password", "data_type": "PASSWORD" }, { } ] }, "error_id": 1001, "entity_id": "a123-b234-c355-d3333" } ] } Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Fabric

Fabric: Nodes

Associated URIs:

Return the List of Nodes

Returns information about all fabric nodes (hosts and edges). Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes
Request Headers:
n/a
Query Parameters:
NodeListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NodeListResult+

Example Response: { "cursor": "003653b55e00-e5c1-11e5-a549-005056b18ef8nsx-edge2", "result_count": 2, "results": [ { "resource_type": "HostNode", "id": "74730a28-e52d-11e5-936e-6f061d405a28", "display_name": "comp-01b", "fqdn": "comp-01b.eng.abc.com", "ip_addresses": [ "192.168.210.53" ], "discovered_ip_addresses": [ "192.168.210.53" ], "external_id": "74730a28-e52d-11e5-936e-6f061d405a28", "os_type": "ESXI", "os_version": "6.0.0", "managed_by_server": "192.168.110.24", "_last_modified_time": 1457470683936, "_create_time": 1457470683936, "_last_modified_user": "admin", "_create_user": "admin", "_revision": 0 }, { "resource_type": "EdgeNode", "id": "53b55e00-e5c1-11e5-a549-005056b18ef8", "display_name": "nsx-edge2", "fqdn": "nsx-edge2.eng.abc.com", "ip_addresses": [ "192.168.110.37" ], "discovered_ip_addresses": [ "192.168.110.37" ], "external_id": "53b55e00-e5c1-11e5-a549-005056b18ef8", "deployment_type": "VIRTUAL_MACHINE", "_last_modified_time": 1457505420494, "_create_time": 1457505420494, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 } ] } Required Permissions: read-api Additional Errors:

Register and Install NSX Components on a Node

Creates a host node (hypervisor) or edge node (router) in the transport network. When you run this command for a host, NSX Manager attempts to install the NSX kernel modules, which are packaged as VIB, RPM, or DEB files. For the installation to succeed, you must provide the host login credentials and the host thumbprint. To get the ESXi host thumbprint, SSH to the host and run the openssl x509 -in /etc/vmware/ssl/rui.crt -fingerprint -sha256 -noout command. To generate host key thumbprint using SHA-256 algorithm please follow the steps below. Log into the host, making sure that the connection is not vulnerable to a man in the middle attack. Check whether a public key already exists. Host public key is generally located at '/etc/ssh/ssh_host_rsa_key.pub'. If the key is not present then generate a new key by running the following command and follow the instructions. ssh-keygen -t rsa Now generate a SHA256 hash of the key using the following command. Please make sure to pass the appropriate file name if the public key is stored with a different file name other than the default 'id_rsa.pub'. awk '{print $2}' id_rsa.pub | base64 -d | sha256sum -b | sed 's/ .*$//' | xxd -r -p | base64 Request:
Method:
POST
URI Path:
/api/v1/fabric/nodes
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
EdgeNode+
HostNode+
Node+

Example Request: POST https://<nsx-mgr>/api/v1/fabric/nodes { "resource_type": "HostNode", "display_name": "Host ABC123", "ip_addresses": [ "192.168.210.54" ], "os_type": "ESXI", "os_version": "6.0.0", "host_credential": { "username": "user1", "password": "password", "thumbprint": "3A:21:22:A6:72:28:DA:EC:9D:05:AF:0B:B5:C6:44:CC:52:8D:54:AC" } } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
EdgeNode+
HostNode+
Node+

Example Response: { "resource_type": "HostNode", "display_name": "Host ABC123", "fqdn": "host-abc-123.eng.abc.com", "id": "cf1f01db-e5b3-4688-9c1e-5f47d335fb01", "ip_addresses": [ "192.168.210.54" ], "external_id": "cf1f01db-e5b3-4688-9c1e-5f47d335fb01", "discovered_ip_addresses": [ "192.168.210.54" ], "os_type": "ESXI", "os_version": "6.0.0", "managed_by_server": "192.168.110.24", "_create_time": 1446577081344, "_last_modified_user": "admin", "_last_modified_time": 1446577081344, "_create_user": "admin", "_revision": 0 } Required Permissions: read-write-api Additional Errors:

Delete a Node

Removes a specified fabric node (host or edge). A fabric node may only be deleted when it is no longer referenced by a Transport Node. If unprepare_host option is specified, the host will be deleted without uninstalling the NSX components from the host. Request:
Method:
DELETE
URI Path:
/api/v1/fabric/nodes/<node-id>
Request Headers:
n/a
Query Parameters:
HostNodeDeleteParameters+
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/fabric/nodes/564dab50-63a0-8b4f-a1f8-20e4d36efc3b Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Return Node Information

Returns information about a specific fabric node (host or edge). Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/<node-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/564dab50-63a0-8b4f-a1f8-20e4d36efc3b Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
EdgeNode+
HostNode+
Node+

Example Response: { "resource_type": "HostNode", "id": "564dab50-63a0-8b4f-a1f8-20e4d36efc3b", "display_name": "pnq1-vm-eng-dhcp-203-201.eng.vmware.com", "fqdn": "pnq1-vm-eng-dhcp-203-201.eng.vmware.com", "external_id": "564dab50-63a0-8b4f-a1f8-20e4d36efc3b", "ip_addresses": [ "10.41.40.41", "10.50.51.50" ], "discovered_ip_addresses": [ "10.41.40.41", "10.50.51.50" ], "managed_by_server": "10.41.203.17", "os_version": "6.0.0", "os_type": "ESXI", "_last_modified_time": 1413358186953, "_create_time": 1413358186953, "_create_user": "admin", "_last_modified_user": "admin", "_revision": 0 } Required Permissions: read-api Additional Errors:

Perform an Action on Fabric Node

The supported fabric node actions are enter_maintenance_mode, exit_maintenance_mode for EdgeNode. Request:
Method:
POST
URI Path:
/api/v1/fabric/nodes/<node-id>
Request Headers:
n/a
Query Parameters:
NodeActionParameters+
Request Body:
n/a

Example Request: POST https://<nsx-mgr>/api/v1/fabric/nodes/53b55e00-e5c1-11e5-a549-005056b18ef8?action=enter_maintenance_mode Successful Response:
Response Code:
202 Accepted
Response Headers:
Content-type: application/json
Response Body:
EdgeNode+
HostNode+
Node+

Example Response: { "resource_type": "EdgeNode", "id": "53b55e00-e5c1-11e5-a549-005056b18ef8", "display_name": "nsx-edge2", "fqdn": "nsx-edge2.eng.abc.com", "ip_addresses": [ "192.168.110.37" ], "discovered_ip_addresses": [ "192.168.110.37" ], "external_id": "53b55e00-e5c1-11e5-a549-005056b18ef8", "deployment_type": "VIRTUAL_MACHINE", "_last_modified_time": 1457505420494, "_create_time": 1457505420494, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 } Required Permissions: read-write-api Additional Errors:

Update a Node

Modifies attributes of a fabric node (host or edge). Request:
Method:
PUT
URI Path:
/api/v1/fabric/nodes/<node-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
EdgeNode+
HostNode+
Node+

Example Request: PUT https://<nsx-mgr>/api/v1/fabric/nodes/8538f119-ba45-4fb1-9cf1-ee849e4cf168 { "resource_type": "EdgeNode", "id": "8538f119-ba45-4fb1-9cf1-ee849e4cf168", "display_name": "edge-node5", "ip_addresses": [ "192.168.110.37", "192.168.110.38" ], "_create_time": 1446579085852, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1446579085852, "_create_user": "admin", "_revision": 0 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
EdgeNode+
HostNode+
Node+

Example Response: { "resource_type": "EdgeNode", "id": "8538f119-ba45-4fb1-9cf1-ee849e4cf168", "display_name": "edge-node5", "fqdn": "edge-node5.eng.abc.com", "ip_addresses": [ "192.168.110.37", "192.168.110.38" ], "discovered_ip_addresses": [ "192.168.110.37", "192.168.110.38" ], "_create_time": 1446579085852, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1446660509297, "_create_user": "admin", "_revision": 1 } Required Permissions: read-write-api Additional Errors:

Return the List of Capabilities of a Single Node

Returns information about capabilities of a single fabric node (host or edge). Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/<node-id>/capabilities
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/c8778638-818a-11e4-a4d5-210df118b5e2/capabilities Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NodeCapabilitiesResult+

Example Response: { "capabilities": [ { "description": "Capability of supporting rate limiting in switch security switching profile", "version": 1, "value": "true", "key": "switchingprofile.switch-security.rate-limiting" }, { "description": "Capability of supporting multiple LACP groups in uplink host switch profile", "version": 1, "value": "true", "key": "hostswitchprofile.multi-lag" }, { "description": "Capability of supporting egress shaper in QoS switching profile", "version": 1, "value": "true", "key": "switchingprofile.qos.shaper.egress" }, { "description": "Capability of supporting LLDP in lldp host switch profile", "version": 1, "value": "true", "key": "hostswitchprofile.lldp" }, { "description": "Capability of supporting broadcast shaper in QoS switching profile", "version": 1, "value": "true", "key": "switchingprofile.qos.shaper.broadcast" } ] } Required Permissions: read-api Additional Errors:

Get the module details of a Fabric Node

Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/<node-id>/modules
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/8538f119-ba45-4fb1-9cf1-ee849e4cf168/modules Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
SoftwareModuleResult+

Example Response: { "software_modules": [ { "module_name": "nsx-aggservice", "module_version": "1.1.0.0.0-4320344" }, { "module_name": "nsx-da", "module_version": "1.1.0.0.0-4320344" }, { "module_name": "nsx-esx-datapath", "module_version": "1.1.0.0.0-4320347" }, { "module_name": "nsx-exporter", "module_version": "1.1.0.0.0-4320344" }, { "module_name": "nsx-host", "module_version": "1.1.0.0.0-4320389" }, { "module_name": "nsx-lldp", "module_version": "1.1.0.0.0-4320344" }, { "module_name": "nsx-mpa", "module_version": "1.1.0.0.0-4320344" }, { "module_name": "nsx-netcpa", "module_version": "1.1.0.0.0-4320340" }, { "module_name": "nsx-python-protobuf", "module_version": "2.4.1-1" }, { "module_name": "nsx-sfhc", "module_version": "1.1.0.0.0-4320344" }, { "module_name": "nsx-support-bundle-client", "module_version": "1.1.0.0.0-4320344" }, { "module_name": "nsxa", "module_version": "1.1.0.0.0-4320344" }, { "module_name": "nsxcli", "module_version": "1.1.0.0.0-4320339" } ] } Required Permissions: read-api Additional Errors:

List the specified node's Network Interfaces

Returns the number of interfaces on the node and detailed information about each interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method (static or DHCP). Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/<node-id>/network/interfaces
Request Headers:
n/a
Query Parameters:
DataSourceParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/<node-id>/network/interfaces Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NodeInterfacePropertiesListResult+

Example Response: { "result_count": 6, "results": [ { "interface_id": "vmnic0", "admin_status": "UP", "link_status": "UP", "source": "cached", "mtu": 1500 }, { "interface_id": "vmnic1", "admin_status": "UP", "link_status": "UP", "source": "cached", "mtu": 1600 }, { "interface_id": "vmnic2", "admin_status": "UP", "link_status": "DOWN", "source": "cached", "mtu": 1500 }, { "interface_alias": [ { "physical_address": "54:9f:35:0b:d0:84", "netmask": "255.255.255.0", "ip_address": "192.168.210.53", "ip_configuration": "STATIC", "broadcast_address": "192.168.210.255" } ], "interface_id": "vmk0", "admin_status": "UP", "link_status": "UP", "source": "cached", "mtu": 1500 }, { "interface_alias": [ { "physical_address": "00:50:56:68:91:ad", "netmask": "255.255.255.0", "ip_address": "10.20.20.53", "ip_configuration": "STATIC", "broadcast_address": "10.20.20.255" } ], "interface_id": "vmk1", "admin_status": "UP", "link_status": "UP", "source": "cached", "mtu": 1500 }, { "interface_alias": [ { "physical_address": "00:50:56:65:f5:fc", "netmask": "255.255.255.0", "ip_address": "192.168.250.102", "ip_configuration": "STATIC", "broadcast_address": "192.168.250.255" } ], "interface_id": "vmk10", "admin_status": "UP", "link_status": "UP", "source": "cached", "mtu": 1600 } ] } Required Permissions: read-api Additional Errors:

Read the node's Network Interface

Returns detailed information about the specified interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method (static or DHCP). Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/<node-id>/network/interfaces/<interface-id>
Request Headers:
n/a
Query Parameters:
DataSourceParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/<node-id>/network/interfaces/vmk10 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NodeInterfaceProperties+

Example Response: { "interface_alias": [ { "physical_address": "00:50:56:65:f5:fc", "netmask": "255.255.255.0", "ip_address": "192.168.250.102", "ip_configuration": "STATIC", "broadcast_address": "192.168.250.255" } ], "interface_id": "vmk10", "admin_status": "UP", "link_status": "UP", "source": "cached", "mtu": 1600 } Required Permissions: read-api Additional Errors:

Read the NSX Manager's Network Interface Statistics

On the specified interface, returns the number of received (rx), transmitted (tx), and dropped packets; the number of bytes and errors received and transmitted on the interface; and the number of detected collisions. Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/<node-id>/network/interfaces/<interface-id>/stats
Request Headers:
n/a
Query Parameters:
DataSourceParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/<node-id>/network/interfaces/<interface-id>/stats Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NodeInterfaceStatisticsProperties+

Example Response: { "tx_errors": 0, "rx_frame": 0, "tx_carrier": 0, "tx_bytes": 31611, "rx_dropped": 1813, "tx_packets": 261, "rx_packets": 91656, "interface_id": "mgmt", "tx_dropped": 0, "tx_colls": 0, "rx_errors": 0, "rx_bytes": 7360718 } Required Permissions: read-api Additional Errors:

Get the Realized State of a Fabric Node

Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/<node-id>/state
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/8538f119-ba45-4fb1-9cf1-ee849e4cf168/state Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
ConfigurationState+

Example Response: { "details": [], "state": "success" } Required Permissions: read-api Additional Errors:

Return Runtime Status Information for a Node

Returns connectivity, heartbeat, and version information about a fabric node (host or edge). Note that the LCP connectivity status remains down until after the fabric node has been added as a transpot node and the NSX host switch has been successfully installed. See POST /api/v1/transport-nodes. If the mpa_connectivity_status value is not "UP", ignore the lcp_connectivity_status value because it might be inaccurate. Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/<node-id>/status
Request Headers:
n/a
Query Parameters:
DataSourceParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/90b3ee63-82fe-11e5-b403-fd59414c0c52/status Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NodeStatus+

Example Response: { "last_heartbeat_timestamp": 1446675283540, "lcp_connectivity_status": "UP", "mpa_connectivity_status": "UP", "system_status": { "mem_used": 2551264, "system_time": 1446649452000, "file_systems": [ { "file_system": "root", "total": 32768, "used": 476, "type": "ramdisk", "mount": "/" }, { "file_system": "etc", "total": 28672, "used": 220, "type": "ramdisk", "mount": "/etc" }, { "file_system": "opt", "total": 32768, "used": 1040, "type": "ramdisk", "mount": "/opt" }, { "file_system": "var", "total": 49152, "used": 1196, "type": "ramdisk", "mount": "/var" }, { "file_system": "tmp", "total": 262144, "used": 24136, "type": "ramdisk", "mount": "/tmp" }, { "file_system": "hostdstats", "total": 302080, "used": 2072, "type": "ramdisk", "mount": "/var/lib/vmware/hostd/stats" } ], "load_average": [ 0.17000000178813934, 0.17000000178813934, 0.15000000596046448 ], "swap_total": 0, "mem_cache": 0, "cpu_cores": 16, "source": "cached", "mem_total": 25119208, "swap_used": 0, "uptime": 7213000 }, "last_sync_time": 1473837914408, "mpa_connectivity_status_details": "Client is responding to heartbeats", "software_version": "1.1.0.0.0.3195008", "host_node_deployment_status": "INSTALL_SUCCESSFUL", "lcp_connectivity_status_details": [ { "control_node_ip": "192.168.110.34", "failure_status": "UNKNOWN_FAILURE_STATUS", "status": "UP" } ], "inventory_sync_paused": false } Required Permissions: read-api Additional Errors:

Restart the inventory sync for the node if it's paused currently.

Restart the inventory sync for the node if it's currently internally paused. After this action the next inventory sync coming from the node is processed. Request:
Method:
POST
URI Path:
/api/v1/fabric/nodes/<node-id>?action=restart_inventory_sync
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Perform a service deployment upgrade on a host node

Request:
Method:
POST
URI Path:
/api/v1/fabric/nodes/<node-id>?action=upgrade_infra
Request Headers:
n/a
Query Parameters:
UpgradeInfraRequestParameters+
Request Body:
n/a

Example Request: POST https://<nsx-mgr>/api/v1/fabric/nodes/4c8101d8-a129-11e6-961f-005056a99106?action=upgrade_infra Successful Response:
Response Code:
202 Accepted
Response Headers:
Content-type: application/json
Response Body:
EdgeNode+
HostNode+
Node+

Example Response: { "resource_type" : "HostNode", "description" : "", "id" : "73aabd55-7c9a-4015-a769-47e2e95f0045", "display_name" : "comp-02b", "tags" : [ ], "fqdn" : "", "ip_addresses" : [ "192.168.210.54" ], "external_id" : "73aabd55-7c9a-4015-a769-47e2e95f0045", "discovered_ip_addresses" : [ ], "os_type" : "ESXI", "os_version" : "", "managed_by_server" : "", "_create_time" : 1478050967406, "_create_user" : "admin", "_last_modified_user" : "admin", "_last_modified_time" : 1478050967406, "_revision" : 0 } Required Permissions: read-write-api Additional Errors:

Return Runtime Status Information for given Nodes

Returns connectivity, heartbeat, and version information about all fabric nodes (host or edge). If the mpa_connectivity_status value is not "UP", ignore the lcp_connectivity_status value because it might be inaccurate. Request:
Method:
GET
URI Path:
/api/v1/fabric/nodes/status
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
ReadNodesStatusRequestParameters+

Example Request: GET https://<nsx-mgr>/api/v1/fabric/nodes/status { "node_ids": [ { "b342511e-d0b4-475c-89f4-edfb7a494437" }, { "9ec4e9e1-ae56-4b04-8ee7-836d7216c81b" } ] } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NodeStatusListResult+

Example Response: { "cursor": "003600000000-0000-0000-0000-0000000000022305843009213694015", "sort_by": "priority", "result_count": 2, "results": [ { "last_heartbeat_timestamp": 1446675283540, "lcp_connectivity_status": "UP", "mpa_connectivity_status": "UP", "system_status": { "mem_used": 2551264, "system_time": 1446649452000, "file_systems": [ { "file_system": "root", "total": 32768, "used": 476, "type": "ramdisk", "mount": "/" }, { "file_system": "etc", "total": 28672, "used": 220, "type": "ramdisk", "mount": "/etc" }, { "file_system": "opt", "total": 32768, "used": 1040, "type": "ramdisk", "mount": "/opt" } ], "load_average": [ 0.17000000178813934, 0.17000000178813934, 0.15000000596046448 ], "swap_total": 0, "mem_cache": 0, "cpu_cores": 16, "source": "cached", "mem_total": 25119208, "swap_used": 0, "uptime": 7213000 }, "last_sync_time": 1473837914408, "mpa_connectivity_status_details": "Client is responding to heartbeats", "software_version": "1.1.0.0.0.3195008", "host_node_deployment_status": "INSTALL_SUCCESSFUL", "lcp_connectivity_status_details": [ { "control_node_ip": "192.168.110.34", "failure_status": "UNKNOWN_FAILURE_STATUS", "status": "UP" } ], "inventory_sync_paused": false "external_id": "b342511e-d0b4-475c-89f4-edfb7a494437", } }, { "last_heartbeat_timestamp": 1446675283540, "lcp_connectivity_status": "UP", "mpa_connectivity_status": "UP", "last_sync_time": 1473837914408, "mpa_connectivity_status_details": "Client is responding to heartbeats", "software_version": "1.1.0.0.0.3195008", "host_node_deployment_status": "INSTALL_SUCCESSFUL", "lcp_connectivity_status_details": [ { "control_node_ip": "192.168.110.34", "failure_status": "UNKNOWN_FAILURE_STATUS", "status": "UP" } ], "inventory_sync_paused": false "external_id": "9ec4e9e1-ae56-4b04-8ee7-836d7216c81b", } } ] } Required Permissions: read-api Additional Errors:

Fabric: Vifs

Associated URIs:

Return the List of Virtual Network Interfaces (VIFs)

Returns information about all VIFs. A virtual network interface aggregates network interfaces into a logical interface unit that is indistinuishable from a physical network interface. Request:
Method:
GET
URI Path:
/api/v1/fabric/vifs
Request Headers:
n/a
Query Parameters:
VifListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/vifs Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
VirtualNetworkInterfaceListResult+

Example Response: { "cursor": "00365fbf3eee-b54e-47ec-bf38-e316656c2084nnuullll", "result_count": 2, "results": [ { "resource_type": "VirtualNetworkInterface", "device_key": "4000", "device_name": "Network adapter 1", "ip_address_info": [ { "ip_addresses": [ "172.16.20.10", "fe80::250:56ff:fe86:f2b2" ], "source": "VM_TOOLS" } ], "vm_local_id_on_host": "1", "mac_address": "00:50:56:86:f2:b2", "owner_vm_id": "5006d98a-352f-134f-df6b-33e7f8d5de65", "external_id": "5006d98a-352f-134f-df6b-33e7f8d5de65-4000", "lport_attachment_id": "3d4b208c-b986-47f7-8a29-a74610d33a13", "host_id": "74730a28-e52d-11e5-936e-6f061d405a28" }, { "resource_type": "VirtualNetworkInterface", "device_key": "4000", "device_name": "Network adapter 1", "ip_address_info": [ { "ip_addresses": [ "172.16.20.11", "fe80::250:56ff:feb1:705e" ], "source": "VM_TOOLS" } ], "vm_local_id_on_host": "3", "mac_address": "00:50:56:b1:70:5e", "owner_vm_id": "50314b00-d422-d5d0-0cb2-d8a904a31c16", "external_id": "50314b00-d422-d5d0-0cb2-d8a904a31c16-4000", "lport_attachment_id": "d0649784-6fb8-43f9-be9e-88d3ee357f6e", "host_id": "65bcd211-e570-11e5-8472-991cc87d670e" } ] } Required Permissions: read-api Additional Errors:

Fabric: Virtual Machines

Associated URIs:

Return the List of Virtual Machines

Returns information about all virtual machines. Request:
Method:
GET
URI Path:
/api/v1/fabric/virtual-machines
Request Headers:
n/a
Query Parameters:
VirtualMachineListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/fabric/virtual-machines Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
VirtualMachineListResult+

Example Response: { "cursor" : "00361f148bdc-fe7c-4320-8ef3-594e28d57c87Iws-2", "result_count" : 1, "results" : [ { "display_name" : "Iws-2", "resource_type" : "VirtualMachine", "local_id_on_host": "1", "external_id" : "420e72c9-55e7-a4f7-81bf-673a2af1a6cf", "host_id" : "cf0ffd7a-818a-11e4-9ab1-cb7a79b0af39", "compute_ids" : [ "locationId:420e72c9-55e7-a4f7-81bf-673a2af1a6cf", "instanceUuid:500e0c08-2ecc-2609-d9ba-ed489e48c787", "biosUuid:420e72c9-55e7-a4f7-81bf-673a2af1a6cf", "externalId:420e72c9-55e7-a4f7-81bf-673a2af1a6cf", "hostLocalId:1", "moIdOnHost:1" ], "type" : "REGULAR" } ] } { "cursor": "00011", "result_count": 1, "results": [ { "resource_type": "VirtualMachine", "display_name": "app-vm", "compute_ids": [ "instanceUuid:5006d98a-352f-134f-df6b-33e7f8d5de65", "moIdOnHost:1", "externalId:5006d98a-352f-134f-df6b-33e7f8d5de65", "hostLocalId:1", "locationId:564d1012-15a8-dd22-9c13-f53d697678a8", "biosUuid:4206a555-5a2f-edaa-d215-dac9508da942" ], "external_id": "5006d98a-352f-134f-df6b-33e7f8d5de65", "type": "REGULAR", "host_id": "74730a28-e52d-11e5-936e-6f061d405a28", "local_id_on_host": "1" } ] } { "cursor": "00364a60d899-7b2b-4983-8254-41be3aba6472web-vm", "result_count": 1, "results": [ { "resource_type": "VirtualMachine", "display_name": "web-vm", "compute_ids": [ "instanceUuid:50069c43-e024-9fce-6017-001a87ef32be", "moIdOnHost:1", "externalId:50069c43-e024-9fce-6017-001a87ef32be", "hostLocalId:1", "locationId:564d6439-4abb-e39c-1a2f-d2524e3cc3e1", "biosUuid:42060137-3f57-15bb-1bfc-293c4ba89050" ], "external_id": "50069c43-e024-9fce-6017-001a87ef32be", "type": "REGULAR", "host_id": "65bcd211-e570-11e5-8472-991cc87d670e", "local_id_on_host": "1" } ] } { "cursor": "00011", "result_count": 1, "results": [ { "resource_type": "VirtualMachine", "display_name": "db-vm-new", "compute_ids": [ "instanceUuid:50314b00-d422-d5d0-0cb2-d8a904a31c16", "moIdOnHost:3", "externalId:50314b00-d422-d5d0-0cb2-d8a904a31c16", "hostLocalId:3", "locationId:564d90f6-8f73-1baa-8226-82d85cc9c5c8", "biosUuid:4231c15f-ca24-b567-65b4-17bf1c0dd20e" ], "external_id": "50314b00-d422-d5d0-0cb2-d8a904a31c16", "type": "REGULAR", "host_id": "65bcd211-e570-11e5-8472-991cc87d670e", "local_id_on_host": "3" } ] } Required Permissions: read-api Additional Errors:

Update tags applied to a virtual machine

Update tags applied to the virtual machine. External id of the virtual machine will be specified in the request body. Request body should contain all the tags to be applied. To clear all tags, provide an empty list. Request:
Method:
POST
URI Path:
/api/v1/fabric/virtual-machines?action=update_tags
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
VirtualMachineTagUpdate+

Example Request: POST https://<nsx-mgr>/api/v1/fabric/virtual-machines?action=update_tags { "external_id": "ID-0", "tags": [ {"scope": "os", "tag": "win32"}, {"scope": "security", "tag": "PCI"} ] } Successful Response:
Response Code:
204 No Content
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Grouping Objects

Grouping Objects: Ip Sets

Associated URIs:

List IPSets

Returns paginated list of IPSets Request:
Method:
GET
URI Path:
/api/v1/ip-sets
Request Headers:
n/a
Query Parameters:
IPSetListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/ip-sets Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
IPSetListResult+

Example Response: { "cursor": "003696ebbc9f-6eae-4009-b709-532820dbba2atestIPSet", "sort_by": "displayName", "sort_ascending": true, "result_count": 1, "results": [ { "id": "96ebbc9f-6eae-4009-b709-532820dbba2a", "display_name": "testIPSet", "resource_type": "IPSet", "ip_addresses": [ "192.168.1.1-192.168.1.6", "192.168.1.8", "192.168.4.8/24" ], "_last_modified_user": "a;a", "_last_modified_time": 1439879046475, "_create_time": 1439879046475, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } ] } Required Permissions: read-api Additional Errors:

Create IPSet

Creates a new IPSet that can group either IPv4 or IPv6 individual ip addresses, ranges or subnets. Request:
Method:
POST
URI Path:
/api/v1/ip-sets
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
IPSet+

Example Request: POST https://<nsx-mgr>/api/v1/ip-sets { "display_name":"testIPSet", "ip_addresses":["192.168.1.1-192.168.1.6","192.168.1.8","192.168.4.8/24"] } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
IPSet+

Example Response: { "id": "96ebbc9f-6eae-4009-b709-532820dbba2a", "display_name": "testIPSet", "resource_type": "IPSet", "ip_addresses": [ "192.168.1.1-192.168.1.6", "192.168.1.8", "192.168.4.8/24" ], "_last_modified_user": "a;a", "_last_modified_time": 1439879046475, "_create_time": 1439879046475, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } Required Permissions: read-write-api Additional Errors:

Read IPSet

Returns information about the specified IPSet Request:
Method:
GET
URI Path:
/api/v1/ip-sets/<ip-set-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/ip-sets/2ffea46a-b537-4d71-98f5-6fedb7f3c28b Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
IPSet+

Example Response: { "id": "2ffea46a-b537-4d71-98f5-6fedb7f3c28b", "display_name": "testIPSet", "resource_type": "IPSet", "ip_addresses": [ "192.168.1.1-192.168.1.6", "192.168.1.8", "192.168.4.8/24" ], "_last_modified_user": "a;a", "_last_modified_time": 1439892910866, "_create_time": 1439892910866, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } Required Permissions: read-api Additional Errors:

Delete IPSet

Deletes the specified IPSet. By default, if the IPSet is added to an NSGroup, it won't be deleted. In such situations, pass "force=true" as query param to force delete the IPSet. Request:
Method:
DELETE
URI Path:
/api/v1/ip-sets/<ip-set-id>
Request Headers:
n/a
Query Parameters:
IPSetDeleteRequestParameters+
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/ip-sets/22dc1d1a-adcb-4c58-874e-6e783df02790 DELETE https://<nsx-mgr>/api/v1/ip-sets/22dc1d1a-adcb-4c58-874e-6e783df02790 ?force=true Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Update IPSet

Updates the specified IPSet. Modifiable parameters include description, display_name and ip_addresses. Request:
Method:
PUT
URI Path:
/api/v1/ip-sets/<ip-set-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
IPSet+

Example Request: PUT https://<nsx-mgr>/api/v1/ip-sets/e8102843-dc86-47d4-903f-5911ea48deb7 { "resource_type": "IPSet", "display_name": "West Customers", "ip_addresses": [ "192.168.1.1-192.168.1.6", "192.168.1.0/24", "192.168.4.0/24" ], "_revision": 0 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
IPSet+

Example Response: { "resource_type": "IPSet", "id": "e8102843-dc86-47d4-903f-5911ea48deb7", "display_name": "West Customers", "ip_addresses": [ "192.168.1.1-192.168.1.6", "192.168.1.0/24", "192.168.4.0/24" ], "_last_modified_time": 1458326830542, "_create_time": 1458326554714, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 1 } Required Permissions: read-write-api Additional Errors:

Grouping Objects: Mac Sets

Associated URIs:

Create MACSet

Creates a new MACSet that can group individual MAC addresses. Request:
Method:
POST
URI Path:
/api/v1/mac-sets
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
MACSet+

Example Request: POST https://<nsx-mgr>/api/v1/mac-sets { "display_name":"testMACSet", "mac_addresses":["01:23:45:67:89:ab","00:14:22:01:23:45"] } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
MACSet+

Example Response: { "resource_type": "MACSet", "id": "c20eb62d-9ff1-4d64-8506-134e603e01f9", "display_name": "testMACSet", "mac_addresses": [ "01:23:45:67:89:AB", "00:14:22:01:23:45" ], "_last_modified_time": 1458327532700, "_create_time": 1458327532700, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 } Required Permissions: read-write-api Additional Errors:

List MACSets

Returns paginated list of MACSets Request:
Method:
GET
URI Path:
/api/v1/mac-sets
Request Headers:
n/a
Query Parameters:
MACSetListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/mac-sets Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
MACSetListResult+

Example Response: { "cursor": "003602cf0d81-4c1c-45fb-87b3-fb52ec89a8a4test-mac-set", "result_count": 1, "results": [ { "resource_type": "MACSet", "id": "02cf0d81-4c1c-45fb-87b3-fb52ec89a8a4", "display_name": "test-mac-set", "mac_addresses": [ "01:23:45:67:89:AB", "00:14:22:01:23:45", "01:66:48:21:97:AC", "00:57:82:44:12:99" ], "_create_time": 1454015311172, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1454015311172, "_create_user": "admin", "_revision": 0 } ] } Required Permissions: read-api Additional Errors:

Read MACSet

Returns information about the specified MACSet Request:
Method:
GET
URI Path:
/api/v1/mac-sets/<mac-set-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/mac-sets/183e372b-854c-4fcc-a24e-05721ce89a60 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
MACSet+

Example Response: { "_revision": 0, "id": "183e372b-854c-4fcc-a24e-05721ce89a60", "display_name":"testMACSet", "resource_type": "MACSet", "mac_addresses":["01:23:45:67:89:ab","00:14:22:01:23:45"], "_create_user": "system", "_last_modified_user": "system", "_last_modified_time": 1414057732203, "_create_time": 1414057732203 } Required Permissions: read-api Additional Errors:

Update MACSet

Updates the specified MACSet. Modifiable parameters include the description, display_name and mac_addresses. Request:
Method:
PUT
URI Path:
/api/v1/mac-sets/<mac-set-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
MACSet+

Example Request: PUT https://<nsx-mgr>/api/v1/mac-sets/d95da628-8677-4d26-b593-76b51c6439c2 { "resource_type": "MACSet", "display_name": "Lab A MACs", "mac_addresses": [ "01:23:45:67:89:AB", "00:14:22:01:23:45" ], "_revision": 0 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
MACSet+

Example Response: { "resource_type": "MACSet", "id": "d95da628-8677-4d26-b593-76b51c6439c2", "display_name": "Lab A MACs", "mac_addresses": [ "01:23:45:67:89:AB", "00:14:22:01:23:45" ], "_last_modified_time": 1458327141731, "_create_time": 1458167290173, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 1 } Required Permissions: read-write-api Additional Errors:

Delete MACSet

Deletes the specified MACSet. By default, if the MACSet is added to an NSGroup, it won't be deleted. In such situations, pass "force=true" as query param to force delete the MACSet. Request:
Method:
DELETE
URI Path:
/api/v1/mac-sets/<mac-set-id>
Request Headers:
n/a
Query Parameters:
MACSetDeleteRequestParameters+
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/mac-sets/183e372b-854c-4fcc-a24e-05721ce89a60 DELETE https://<nsx-mgr>/api/v1/mac-sets/183e372b-854c-4fcc-a24e-05721ce89a60 ?force=true Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Add a MAC address to a MACSet

Add an individual MAC address to a MACSet Request:
Method:
POST
URI Path:
/api/v1/mac-sets/<mac-set-id>/members
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
MACAddressElement+

Example Request: POST https://<nsx-mgr>/api/v1/mac-sets/183e372b-854c-4fcc-a24e-05721ce89a60/members { "mac_address":"01:23:45:67:89:ab" } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
MACAddressElement+

Example Response: { "mac_address": "01:23:45:67:89:AB", "_revision": 2 } Required Permissions: read-write-api Additional Errors:

Get all MACAddresses in a MACSet

List all MAC addresses in a MACSet Request:
Method:
GET
URI Path:
/api/v1/mac-sets/<mac-set-id>/members
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/mac-sets/183e372b-854c-4fcc-a24e-05721ce89a60/members Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
MACAddressElementListResult+

Example Response: { "result_count": 4, "results": [ { "mac_address": "01:23:45:67:89:AB" }, { "mac_address": "00:14:22:01:23:45" }, { "mac_address": "01:66:48:21:97:AC" }, { "mac_address": "00:57:82:44:12:99" } ] } Required Permissions: read-api Additional Errors:

Remove a MAC address from given MACSet

Remove an individual MAC address from a MACSet Request:
Method:
DELETE
URI Path:
/api/v1/mac-sets/<mac-set-id>/members/<mac-address>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/mac-sets/183e372b-854c-4fcc-a24e-05721ce89a60/members/01:23:45:67:89:ab Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Grouping Objects: Ns Groups

Associated URIs:

Create NSGroup

Creates a new NSGroup that can group NSX resources - VIFs, Lports and LSwitches as well as the grouping objects - IPSet, MACSet and other NSGroups Request:
Method:
POST
URI Path:
/api/v1/ns-groups
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
NSGroup+

Example Request: POST https://<nsx-mgr>/api/v1/ns-groups { "display_name":"testNSGroup", "members":[{"resource_type": "NSGroupSimpleExpression", "target_type":"IPSet", "target_property":"id", "op":"EQUALS", "value":"183e372b-854c-4fcc-a24e-05721ce89a60" } ], "membership_criteria": [ {"resource_type": "NSGroupComplexExpression", expressions : [ { resource_type :NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Tenant", tag: Nike }, { resource_type : NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Location", tag: US } ] }, { resource_type : NSGroupTagExpression, "target_type": "LogicalSwitch", "scope: "Tenant", tag: Columbia } ] } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
NSGroup+

Required Permissions: read-write-api Additional Errors:

List NSGroups

List the NSGroups in a paginated format. The page size is restricted to 50 NSGroups so that the size of the response remains small even in the worst case. Request:
Method:
GET
URI Path:
/api/v1/ns-groups
Request Headers:
n/a
Query Parameters:
NSGroupListRequestParameters+
Request Body:
n/a

Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSGroupListResult+

Example Response: { "cursor": "0036a21f8e31-52e9-4790-9574-0c5f52f24096test-ns-group-4", "sort_ascending": true, "sort_by": "displayName", "result_count": 1, "results": [ { "resource_type": "NSGroup", "id": "a21f8e31-52e9-4790-9574-0c5f52f24096", "display_name": "test-ns-group-4", "members": [ { "resource_type": "NSGroupSimpleExpression", "op": "EQUALS", "target_type": "IPSet", "value": "8c0ab37c-c8db-4d69-99c9-21b6762a86f6", "target_property": "id" } ], "membership_criteria": [ {"resource_type": "NSGroupComplexExpression", expressions : [ { resource_type :NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Tenant", tag: Nike }, { resource_type : NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Location", tag: US } ] }, { resource_type : NSGroupTagExpression, "target_type": "LogicalSwitch", "scope: "Tenant", tag: Columbia } ] } ], "_create_user": "admin", "_create_time": 1445584267531, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1445584267531, "_revision": 0 } ] } { "cursor": "0036a21f8e31-52e9-4790-9574-0c5f52f24096test-ns-group-4", "sort_ascending": true, "sort_by": "displayName", "result_count": 1, "results": [ { "resource_type": "NSGroup", "id": "a21f8e31-52e9-4790-9574-0c5f52f24096", "display_name": "test-ns-group-4", "members": [ { "resource_type": "NSGroupSimpleExpression", "op": "EQUALS", "target_resource": { "target_display_name": "test-ipset-1", "is_valid": true, "target_type": "IPSet", "target_id": "8c0ab37c-c8db-4d69-99c9-21b6762a86f6" }, "target_type": "IPSet", "value": "8c0ab37c-c8db-4d69-99c9-21b6762a86f6", "target_property": "id" } ], "membership_criteria": [ {"resource_type": "NSGroupComplexExpression", expressions : [ { resource_type :NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Tenant", tag: Nike }, { resource_type : NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Location", tag: US } ] }, { resource_type : NSGroupTagExpression, "target_type": "LogicalSwitch", "scope: "Tenant", tag: Columbia } ] } ], "_create_user": "admin", "_create_time": 1445584267531, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1445584267531, "_revision": 0 } ] } Required Permissions: read-api Additional Errors:

Update NSGroup

Updates the specified NSGroup. Modifiable parameters include the description, display_name and members. Request:
Method:
PUT
URI Path:
/api/v1/ns-groups/<ns-group-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
NSGroup+

Example Request: PUT https://<nsx-mgr>/api/v1/ ns-groups/183e372b-854c-4fcc-a24e-05721ce89a60 { "_revision": 2, "id": "183e372b-854c-4fcc-a24e-05721ce89a60", "display_name":"testNSGroup", "members":[{ "resource_type": "NSGroupSimpleExpression", "target_type":"MACSet", "target_property":"id", "op":"EQUALS", "value":"183e372b-854c-4fcc-a24e-05721ce89a34" }], "membership_criteria": [ {"resource_type": "NSGroupComplexExpression", expressions : [ { resource_type :NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Tenant", tag: Nike }, { resource_type : NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Location", tag: US } ] }, { resource_type : NSGroupTagExpression, "target_type": "LogicalSwitch", "scope: "Tenant", tag: Columbia } ] } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSGroup+

Required Permissions: read-write-api Additional Errors:

Delete NSGroup

Deletes the specified NSGroup. By default, if the NSGroup is added to another NSGroup, it won't be deleted. In such situations, pass "force=true" as query param to force delete the NSGroup. Request:
Method:
DELETE
URI Path:
/api/v1/ns-groups/<ns-group-id>
Request Headers:
n/a
Query Parameters:
NSGroupDeleteRequestParameters+
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/ ns-groups/183e372b-854c-4fcc-a24e-05721ce89a60 DELETE https://<nsx-mgr>/api/v1/ ns-groups/183e372b-854c-4fcc-a24e-05721ce89a60?force=true Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Add NSGroup expression

Add/remove the expressions passed in the request body to/from the NSGroup Request:
Method:
POST
URI Path:
/api/v1/ns-groups/<ns-group-id>
Request Headers:
n/a
Query Parameters:
MemberAction+
Request Body:
NSGroupExpressionList+

Example Request: POST https://<nsx-mgr>/api/v1/ ns-groups/183e372b-854c-4fcc-a24e-05721ce89a60?action=ADD_MEMBERS { "members": [ { "resource_type": "NSGroupSimpleExpression", "op": "EQUALS", "target_type": "IPSet", "value": "cd1b2ced-3d2c-4145-b54a-bf613c090aa", "target_property": "id" } ] } POST https://<nsx-mgr>/api/v1/ ns-groups/183e372b-854c-4fcc-a24e-05721ce89a60?action=REMOVE_MEMBERS { "members": [ { "resource_type": "NSGroupSimpleExpression", "op": "EQUALS", "target_type": "IPSet", "value": "cd1b2ced-3d2c-4145-b54a-bf613c090aa", "target_property": "id" } ] } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSGroup+

Required Permissions: read-write-api Additional Errors:

Read NSGroup

Returns information about the specified NSGroup. Request:
Method:
GET
URI Path:
/api/v1/ns-groups/<ns-group-id>
Request Headers:
n/a
Query Parameters:
NSGroupRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/ ns-groups/183e372b-854c-4fcc-a24e-05721ce89a60 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSGroup+

Example Response: { "resource_type": "NSGroup", "id": "a21f8e31-52e9-4790-9574-0c5f52f24096", "display_name": "test-ns-group-4", "members": [ { "resource_type": "NSGroupSimpleExpression", "op": "EQUALS", "target_type": "IPSet", "value": "8c0ab37c-c8db-4d69-99c9-21b6762a86f6", "target_property": "id" } ], "membership_criteria": [ {"resource_type": "NSGroupComplexExpression", expressions : [ { resource_type :NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Tenant", tag: Nike }, { resource_type : NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Location", tag: US } ] }, { resource_type : NSGroupTagExpression, "target_type": "LogicalSwitch", "scope: "Tenant", tag: Columbia } ], "_create_user": "admin", "_create_time": 1445584267531, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1445584267531, "_revision": 0 } { "resource_type": "NSGroup", "id": "a21f8e31-52e9-4790-9574-0c5f52f24096", "display_name": "test-ns-group-4", "members": [ { "resource_type": "NSGroupSimpleExpression", "op": "EQUALS", "target_resource": { "target_display_name": "test-ipset-1", "is_valid": true, "target_type": "IPSet", "target_id": "8c0ab37c-c8db-4d69-99c9-21b6762a86f6" }, "target_type": "IPSet", "value": "8c0ab37c-c8db-4d69-99c9-21b6762a86f6", "target_property": "id" } ], "membership_criteria": [ {"resource_type": "NSGroupComplexExpression", expressions : [ { resource_type :NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Tenant", tag: Nike }, { resource_type : NSGroupTagExpression, "target_type": "LogicalPort", "scope: "Location", tag: US } ] }, { resource_type : NSGroupTagExpression, "target_type": "LogicalSwitch", "scope: "Tenant", tag: Columbia } ], "_create_user": "admin", "_create_time": 1445584267531, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1445584267531, "_revision": 0 } Required Permissions: read-api Additional Errors:

Get Effective IPAddress translated from the NSGroup

Returns effective ip address members of the specified NSGroup. Request:
Method:
GET
URI Path:
/api/v1/ns-groups/<ns-group-id>/effective-ip-address-members
Request Headers:
n/a
Query Parameters:
ListRequestParameters+
Request Body:
n/a

Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
EffectiveIPAddressMemberListResult+

Example Response: { "cursor": "00012", "sort_ascending": true, "result_count": 2, "results": [ "10.112.1.1", "10.112.1.2/24" ] } Required Permissions: read-api Additional Errors:

Get Effective Logical Ports translated from the NSgroup

Returns effective logical port members of the specified NSGroup. Request:
Method:
GET
URI Path:
/api/v1/ns-groups/<ns-group-id>/effective-logical-port-members
Request Headers:
n/a
Query Parameters:
ListRequestParameters+
Request Body:
n/a

Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
EffectiveMemberResourceListResult+

Example Response: { "cursor": "00012", "sort_ascending": true, "result_count": 2, "results": [ { "target_id" : "20c1ac1f-58b5-4241-a352-f8e82c4a8c65", "target_display_name" : "LP-HR1", "target_type" : "LogicalPort", }, { "id" : "c07005fe-4a9a-47f1-9a1e-2db65a285124", "display_name" : "LP-HR2", "target_type" : "LogicalPort" } ] } Required Permissions: read-api Additional Errors:

Get Effective switch members translated from the NSGroup

Returns effective logical switch members of the specified NSGroup. Request:
Method:
GET
URI Path:
/api/v1/ns-groups/<ns-group-id>/effective-logical-switch-members
Request Headers:
n/a
Query Parameters:
ListRequestParameters+
Request Body:
n/a

Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
EffectiveMemberResourceListResult+

Example Response: { "cursor": "00012", "sort_ascending": true, "result_count": 2, "results": [ { "target_id" : "20c1ac1f-58b5-4241-a352-f8e82c4a8c65", "target_display_name" : "LS-HR1", "target_type" : "LogicalSwitch" }, { "id" : "c07005fe-4a9a-47f1-9a1e-2db65a285124", "display_name" : "LS-HR2", "target_type" : "LogicalSwitch" } ] } Required Permissions: read-api Additional Errors:

Grouping Objects: Ns Service Groups

Associated URIs:

Create NSServiceGroup

Creates a new NSServiceGroup which can contain NSServices. A given NSServiceGroup can contain either only ether type of NSServices or only non-ether type of NSServices, i.e. an NSServiceGroup cannot contain a mix of both ether and non-ether types of NSServices. Request:
Method:
POST
URI Path:
/api/v1/ns-service-groups
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
NSServiceGroup+

Example Request: POST https://<nsx-mgr>/api/v1/ns-service-groups { "display_name":"testNSServiceGroup", "members":[{"target_id": "183e372b-854c-4fcc-a24e-05721ce89a61", "target_type": "NSService"}] } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
NSServiceGroup+

Example Response: { "id": "8525429d-1e5b-4846-9684-d57fe83f4ea8", "display_name": "testNSServiceGroup", "resource_type": "NSServiceGroup", "service_type": "ETHER", "members": [ { "target_type": "NSService", "target_display_name": "testNSService", "is_valid": true, "target_id": "8c669da6-47a4-4508-9077-6a48d26c5a4b" } ], "_create_user": "a;a", "_last_modified_user": "a;a", "_last_modified_time": 1439966963844, "_create_time": 1439966963844, "_system_owned": false, "_revision": 0 } Required Permissions: read-write-api Additional Errors:

List all NSServiceGroups

Returns paginated list of NSServiceGroups Request:
Method:
GET
URI Path:
/api/v1/ns-service-groups
Request Headers:
n/a
Query Parameters:
NSServiceGroupListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/ns-service-groups Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSServiceGroupListResult+

Example Response: { "cursor": "003626b93aaf-a577-4985-838e-baec26c02a9evCentre Operations Standard 1.x", "sort_ascending": true, "sort_by": "displayName", "result_count": 39, "results": [ { "resource_type": "NSServiceGroup", "description": "Data Recovery Appliance", "id": "6525a2c3-32a8-4560-84fd-0fe3482b845b", "display_name": "Data Recovery Appliance", "service_type": "NON_ETHER", "default_service": true, "members": [ { "target_display_name": "VMware-DataRecovery", "is_valid": true, "target_type": "NSService", "target_id": "37d6cc1d-4ceb-4802-8e20-e41556af7b59" }, { "target_display_name": "VMware-ESXi5.x-TCP", "is_valid": true, "target_type": "NSService", "target_id": "06c173a6-4067-4c98-a4db-62969cd59298" }, { "target_display_name": "HTTPS", "is_valid": true, "target_type": "NSService", "target_id": "3705b545-81b8-4c0f-b77a-fec77f6bf134" } ], "_last_modified_time": 1457468830239, "_create_time": 1457468830239, "_last_modified_user": "system", "_system_owned": true, "_create_user": "system", "_revision": 0 } ...[output truncated for brevity] Required Permissions: read-api Additional Errors:

Update NSServiceGroup

Updates the specified NSService. Modifiable parameters include the description, display_name and members. Request:
Method:
PUT
URI Path:
/api/v1/ns-service-groups/<ns-service-group-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
NSServiceGroup+

Example Request: PUT https://<nsx-mgr>/api/v1/ns-service-groups/12dd0d9d-fac3-457e-ba91-8121aa67e3dd { "resource_type": "NSServiceGroup", "id": "12dd0d9d-fac3-457e-ba91-8121aa67e3dd", "display_name": "test", "service_type": "NON_ETHER", "default_service": false, "members": [ { "target_display_name": "Active Directory Server UDP", "is_valid": true, "target_type": "NSService", "target_id": "d0f1a6c1-9a61-49ef-bcbf-ed8213058361" } ], "_revision": 0 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSServiceGroup+

Example Response: { "resource_type": "NSServiceGroup", "id": "12dd0d9d-fac3-457e-ba91-8121aa67e3dd", "display_name": "test", "service_type": "NON_ETHER", "default_service": false, "members": [ { "target_display_name": "Active Directory Server UDP", "is_valid": true, "target_type": "NSService", "target_id": "d0f1a6c1-9a61-49ef-bcbf-ed8213058361" } ], "_create_time": 1457123992088, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1457124154584, "_create_user": "admin", "_revision": 1 } Required Permissions: read-write-api Additional Errors:

Read NSServiceGroup

Returns information about the specified NSServiceGroup Request:
Method:
GET
URI Path:
/api/v1/ns-service-groups/<ns-service-group-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/ns-service-groups/8525429d-1e5b-4846-9684-d57fe83f4ea8 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSServiceGroup+

Example Response: { "id": "8525429d-1e5b-4846-9684-d57fe83f4ea8", "display_name": "testNSServiceGroup", "resource_type": "NSServiceGroup", "service_type": "ETHER", "members": [ { "target_type": "NSService", "target_display_name": "testNSService", "is_valid": true, "target_id": "8c669da6-47a4-4508-9077-6a48d26c5a4b" } ], "_create_user": "a;a", "_last_modified_user": "a;a", "_last_modified_time": 1439966963844, "_create_time": 1439966963844, "_system_owned": false, "_revision": 0 } Required Permissions: read-api Additional Errors:

Delete NSServiceGroup

Deletes the specified NSServiceGroup. By default, if the NSServiceGroup is consumed in a Firewall rule, it won't get deleted. In such situations, pass "force=true" as query param to force delete the NSServiceGroup. Request:
Method:
DELETE
URI Path:
/api/v1/ns-service-groups/<ns-service-group-id>
Request Headers:
n/a
Query Parameters:
NSServiceGroupDeleteRequestParameters+
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/ns-service-groups/183e372b-854c-4fcc-a24e-05721ce89a60 DELETE https://<nsx-mgr>/api/v1/ns-service-groups/183e372b-854c-4fcc-a24e-05721ce89a60 ?force=true Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Grouping Objects: Ns Services

Associated URIs:

List all NSServices

Returns paginated list of NSServices Request:
Method:
GET
URI Path:
/api/v1/ns-services
Request Headers:
n/a
Query Parameters:
NSServiceListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/ns-services Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSServiceListResult+

Example Response: { "cursor": "0036a88532ec-5cfe-457a-9ca0-24673372d387iSQLPlus 10g (5580)", "sort_ascending": true, "sort_by": "displayName", "result_count": 364, "results": [ { "resource_type": "NSService", "description": "AD Server", "id": "ed5d47fc-3d90-461d-bc78-9be38cf2d1b9", "display_name": "AD Server", "default_service": true, "nsservice_element": { "resource_type": "L4PortSetNSService", "destination_ports": [ "1024" ], "l4_protocol": "TCP" }, "_create_time": 1455764626691, "_last_modified_user": "system", "_system_owned": true, "_last_modified_time": 1455764626691, "_create_user": "system", "_revision": 0 } ...[output truncated for brevity] Required Permissions: read-api Additional Errors:

Create NSService

Creates a new NSService which allows users to specify characteristics to use for matching network traffic. Request:
Method:
POST
URI Path:
/api/v1/ns-services
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
NSService+

Example Request: POST https://<nsx-mgr>/api/v1/ns-services # Ether type NSService { "display_name":"testNSService", "nsservice_element":{"ether_type": 5463, "resource_type": "EtherTypeNSService"} } # IPProtocol NSService { "display_name":"testNSService", "nsservice_element":{"protocol_number": 3, "resource_type": "IPProtocolNSService"} } # IGMP type NSService { "display_name":"testNSService", "nsservice_element":{"resource_type": "IGMPTypeNSService"} } # ICMP type NSService { "display_name":"testNSService", "nsservice_element":{"protocol": "ICMPv4", "icmp_code": 3, "icmp_type": 0, "resource_type": "ICMPTypeNSService"} } # ALG type NSService { "display_name":"testNSService", "nsservice_element":{"alg": "FTP", "destination_ports": [ "21" ], "resource_type": "ALGTypeNSService"} } # L4PortSet NSService { "display_name":"testNSService", "nsservice_element":{"l4_protocol": "TCP", "source_ports": [ "31-34" ], "destination_ports": [ "81-88", "96" ], "resource_type": "L4PortSetNSService"} } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
NSService+

Example Response: # Ether type NSService { "id": "8c669da6-47a4-4508-9077-6a48d26c5a4b", "display_name": "testNSService", "resource_type": "NSService", "nsservice_element": { "resource_type": "EtherTypeNSService", "ether_type": 5463 }, "_last_modified_user": "a;a", "_last_modified_time": 1439882177929, "_create_time": 1439882177929, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } # IPProtocol NSService { "id": "c4e164f8-914d-49ad-a7ff-8af6f5d7cbcb", "display_name": "testNSService", "resource_type": "NSService", "nsservice_element": { "resource_type": "IPProtocolNSService", "protocol_number": 3 }, "_last_modified_user": "a;a", "_last_modified_time": 1439883547301, "_create_time": 1439883547301, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } # IGMP type NSService { "id": "11d98458-c901-4e28-8393-81f8d84d3271", "display_name": "testNSService", "resource_type": "NSService", "nsservice_element": { "resource_type": "IGMPTypeNSService" }, "_last_modified_user": "a;a", "_last_modified_time": 1439883753153, "_create_time": 1439883753153, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } # ICMP type NSService { "id": "7cebfa0f-8021-417c-b087-f5eff9c69202", "display_name": "testNSService", "resource_type": "NSService", "nsservice_element": { "resource_type": "ICMPTypeNSService", "protocol": "ICMPv4", "icmp_code": 3, "icmp_type": 0 }, "_last_modified_user": "a;a", "_last_modified_time": 1439886066914, "_create_time": 1439886066914, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } # ALG type NSService { "id": "7e69a479-7c8e-4c4e-995c-95b6c7bbd701", "display_name": "testNSService", "resource_type": "NSService", "nsservice_element": { "resource_type": "ALGTypeNSService", "alg": "FTP", "destination_ports": [ "21" ] }, "_last_modified_user": "a;a", "_last_modified_time": 1439886283296, "_create_time": 1439886283296, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } # L4PortSet NSService { "id": "ea66a379-f007-4488-b9be-cbdd380e1e07", "display_name": "testNSService", "resource_type": "NSService", "nsservice_element": { "resource_type": "L4PortSetNSService", "destination_ports": [ "81-88", "96" ], "source_ports": [ "31-34" ], "l4_protocol": "TCP" }, "_last_modified_user": "a;a", "_last_modified_time": 1439886580319, "_create_time": 1439886580319, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } Required Permissions: read-write-api Additional Errors:

Read NSService

Returns information about the specified NSService Request:
Method:
GET
URI Path:
/api/v1/ns-services/<ns-service-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/ns-services/183e372b-854c-4fcc-a24e-05721ce89a60 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSService+

Example Response: { "id": "8c669da6-47a4-4508-9077-6a48d26c5a4b", "display_name": "testNSService", "resource_type": "NSService", "nsservice_element": { "resource_type": "EtherTypeNSService", "ether_type": 5463 }, "_last_modified_user": "a;a", "_last_modified_time": 1439882177929, "_create_time": 1439882177929, "_system_owned": false, "_create_user": "a;a", "_revision": 0 } Required Permissions: read-api Additional Errors:

Update NSService

Updates the specified NSService. Modifiable parameters include the description, display_name and the NSService element. The system defined NSServices can't be modified Request:
Method:
PUT
URI Path:
/api/v1/ns-services/<ns-service-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
NSService+

Example Request: PUT https://<nsx-mgr>/api/v1/ns-services/12dd0d9d-fac3-457e-ba91-8121aa67e3dd { "resource_type": "NSServiceGroup", "id": "12dd0d9d-fac3-457e-ba91-8121aa67e3dd", "display_name": "test", "service_type": "NON_ETHER", "default_service": false, "members": [ { "target_display_name": "Active Directory Server UDP", "is_valid": true, "target_type": "NSService", "target_id": "d0f1a6c1-9a61-49ef-bcbf-ed8213058361" } ], "_revision": 0 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSService+

Example Response: { "resource_type": "NSServiceGroup", "id": "12dd0d9d-fac3-457e-ba91-8121aa67e3dd", "display_name": "test", "service_type": "NON_ETHER", "default_service": false, "members": [ { "target_display_name": "Active Directory Server UDP", "is_valid": true, "target_type": "NSService", "target_id": "d0f1a6c1-9a61-49ef-bcbf-ed8213058361" } ], "_create_time": 1457123992088, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1457124154584, "_create_user": "admin", "_revision": 1 } Required Permissions: read-write-api Additional Errors:

Delete NSService

Deletes the specified NSService. By default, if the NSService is being referred in an NSServiceGroup, it can't be deleted. In such situations, pass "force=true" as a parameter to force delete the NSService. System defined NSServices can't be deleted using "force" flag. Request:
Method:
DELETE
URI Path:
/api/v1/ns-services/<ns-service-id>
Request Headers:
n/a
Query Parameters:
NSServiceDeleteRequestParameters+
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/ns-services/183e372b-854c-4fcc-a24e-05721ce89a60 Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Licensing

Associated URIs:

Deprecated. Assign an Updated Enterprise License Key (Deprecated)

Deprecated. Use POST /api/v1/licenses instead. Request:
Method:
PUT
URI Path:
/api/v1/license
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
License+

Example Request: PUT https://<nsx-mgr>/api/v1/license { "license_key": "00000-00000-00000-00000-00000" } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
License+

Example Response: { "features": "mh,l2-vlan,l2-vxlan,l3,l2-edge,dfw,efw,lb,vpn,multi-vc,policy,si-ovsdb,si-guest,si-netx,si-pp,av,dlb,mpls", "capacity_type": "VM", "product_version": "1.0", "quantity": 1, "is_eval": false, "description": "NSX Enterprise Edition", "expiry": 1458688231359, "product_name": "NSX", "is_mh": true, "license_key": "00000-00000-00000-00000-00000" } Required Permissions: read-write-api Additional Errors:

Deprecated. Return the Enterprise License (Deprecated)

Deprecated. Use GET /api/v1/licenses instead. Request:
Method:
GET
URI Path:
/api/v1/license
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/license Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
License+

Example Response: { "features": "mh,l2-vlan,l2-vxlan,l3,l2-edge,dfw,efw,lb,vpn,multi-vc,policy,si-ovsdb,si-guest,si-netx,si-pp,av,dlb,mpls", "capacity_type": "VM", "product_version": "1.0", "quantity": 0, "is_eval": true, "description": "NSX Enterprise Edition", "expiry": 1458688231359, "product_name": "NSX", "is_mh": true, "license_key": "00000-00000-00000-00000-00000" } Required Permissions: read-api Additional Errors:

Get all licenses

Returns all licenses. Request:
Method:
GET
URI Path:
/api/v1/licenses
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/licenses Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
LicensesListResult+

Example Response: { "result_count": 2, "results" : [ { "features": "mh,l2-vlan,l2-vxlan,l3,l2-edge,dfw,efw,lb,vpn,multi-vc,policy,si-ovsdb,si-guest,si-netx,si-pp,av,dlb,mpls", "capacity_type": "VM" "product_version": "1.0", "quantity": 1, "is_eval": false, "description" : "NSX Standard Edition" "expiry": 1458688231359, "product_name" : "NSX", "is_mh": false, "license_key": "11111-22222-33333-44444-55555" }, { "features": "mh, l2-vlan,l2-vxlan,l3,l2-edge,dfw,efw,lb,vpn,multi-vc,policy,si-ovsdb,si-guest, si-netx,si-pp,av,dlb,mpls", "capacity_type": "VM" "product_version": "1.0", "quantity": 1, "is_eval": false, "description" : "NSX Advanced Edition" "expiry": 1458688231359, "product_name" : "NSX", "is_mh": false, "license_key": "11111-22222-33333-44444-66666" } ] } Required Permissions: read-api Additional Errors:

Logical Routing And Services

Logical Routing And Services: Bfd Peers

Associated URIs:

Create a static hop BFD peer

Creates a BFD peer for static route. The required parameters includes peer IP address. Request:
Method:
POST
URI Path:
/api/v1/logical-routers/<logical-router-id>/routing/static-routes/bfd-peers
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
StaticHopBfdPeer+

Example Request: POST https://<nsx-mgr>/api/v1/logical-routers/f962173f-ac03-4d08-8366-56a41779f61d/routing/static-routes/bfd-peers Successful Response:
Response Code:
201 Created
Response Headers:
Location
Content-type: application/json
Response Body:
StaticHopBfdPeer+

Example Response: { "id": "ab6e173e-ac03-5d09-8888-46a41779f633", "peer_ip_address": "10.10.10.10", "enabled": true, "bfd_config": { "receive_interval": 1000, "transmit_interval": 1000, "declare_dead_multiple": 3 }, "_revision": 0 } Required Permissions: read-write-api Additional Errors:

List static routes BFD Peers

Returns information about all BFD peers created on specified logical router for static routes. Request:
Method:
GET
URI Path:
/api/v1/logical-routers/<logical-router-id>/routing/static-routes/bfd-peers
Request Headers:
n/a
Query Parameters:
StaticHopBfdPeerListParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/logical-routers/f962173f-ac03-4d08-8366-56a41779f61d/routing/static-routes/bfd-peers Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
StaticHopBfdPeerListResult+

Example Response: { "result_count": 1, "results": [ { "id": "ab6e173e-ac03-5d09-8888-46a41779f633" "peer_ip_address": "10.10.10.10", "enabled": true, "bfd_config": { "receive_interval": 1000, "transmit_interval": 1000, "declare_dead_multiple": 3 }, "_revision": 1 } ] } Required Permissions: read-api Additional Errors:

Delete a specified static route BFD peer cofigured on a specified logical router

Deletes the specified BFD peer present on specified logical router. Request:
Method:
DELETE
URI Path:
/api/v1/logical-routers/<logical-router-id>/routing/static-routes/bfd-peers/<bfd-peer-id>
Request Headers:
n/a
Query Parameters:
StaticHopBfdPeerDeleteRequestParameters+
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/logical-routers/f962173f-ac03-4d08-8366-56a41779f61d/routing/static-rooutes/bfd-peers/ab6e173e-ac03-5d09-8888-46a41779f633 Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Read a static route BFD peer

Read the BFD peer having specified ID. Request:
Method:
GET
URI Path:
/api/v1/logical-routers/<logical-router-id>/routing/static-routes/bfd-peers/<bfd-peer-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/logical-routers/f962173f-ac03-4d08-8366-56a41779f61d/routing/static-routes/bfd-peers/723c1e3e-c82c-4243-bba0-2e1ef4815143 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
StaticHopBfdPeer+

Example Response: { "id": "ab6e173e-ac03-5d09-8888-46a41779f633", "peer_ip_address": "10.10.10.10", "enabled": true, "bfd_config": { "receive_interval": 1000, "transmit_interval": 1000, "declare_dead_multiple": 3 }, "_revision": 0 } Required Permissions: read-api Additional Errors:

Update a static route BFD peer

Modifies the static route BFD peer. Modifiable parameters includes peer IP, enable flag and configuration of the BFD peer. Request:
Method:
PUT
URI Path:
/api/v1/logical-routers/<logical-router-id>/routing/static-routes/bfd-peers/<bfd-peer-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
StaticHopBfdPeer+

Example Request: PUT https://<nsx-mgr>/api/v1/logical-routers/f962173f-ac03-4d08-8366-56a41779f61d/routing/static-routes/bfd-peers/723c1e3e-c82c-4243-bba0-2e1ef4815143 { "id": "ab6e173e-ac03-5d09-8888-46a41779f633", "peer_ip_address": "10.10.10.10", "enabled": true, "bfd_config": { "receive_interval": 1000, "transmit_interval": 1000, "declare_dead_multiple": 3 } } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
StaticHopBfdPeer+

Example Response: { "id": "ab6e173e-ac03-5d09-8888-46a41779f633", "peer_ip_address": "10.10.10.10", "enabled": true, "bfd_config": { "receive_interval": 1000, "transmit_interval": 1000, "declare_dead_multiple": 3 }, "_revision": 43 } Required Permissions: read-write-api Additional Errors:

Logical Routing And Services: Dhcp Relay

Associated URIs:

List all DHCP Relay Services

Returns information about all configured dhcp relay services. Request:
Method:
GET
URI Path:
/api/v1/dhcp/relays
Request Headers:
n/a
Query Parameters:
ListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/dhcp/relays Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
DhcpRelayServiceListResult+

Example Response: { "result_count": 1, "results": [ { "resource_type": "DhcpRelayService", "_revision": 0, "id": "fac2f67e-a860-4a9f-842b-a3cb6e34bb73", "dhcp_relay_profile_id": "bbfa30e4-87b6-41b8-8da5-771055967da1", "_last_modified_user": "admin", "_last_modified_time": 1414704710165, "_create_time": 1414704710165, "_create_user": "admin" } ] } Required Permissions: read-api Additional Errors:

Create a DHCP Relay Service

Creates a dhcp relay service. Request:
Method:
POST
URI Path:
/api/v1/dhcp/relays
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
DhcpRelayService+

Example Request: POST https://<nsx-mgr>/api/v1/dhcp/relays { "dhcp_relay_profile_id": "bbfa30e4-87b6-41b8-8da5-771055967da1" } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
DhcpRelayService+

Example Response: { "resource_type": "DhcpRelayService", "_revision": 0, "id": "fac2f67e-a860-4a9f-842b-a3cb6e34bb73", "dhcp_relay_profile_id": "bbfa30e4-87b6-41b8-8da5-771055967da1", "_last_modified_user": "admin", "_last_modified_time": 1414704710165, "_create_time": 1414704710165, "_create_user": "admin" } Required Permissions: read-write-api Additional Errors:

Read a DHCP Relay Service

Returns the dhcp relay service information. Request:
Method:
GET
URI Path:
/api/v1/dhcp/relays/<relay-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/dhcp/relays/bbfa30e4-87b6-41b8-8da5-771055967da1 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
DhcpRelayService+

Example Response: { "resource_type": "DhcpRelayService", "_revision": 0, "id": "fac2f67e-a860-4a9f-842b-a3cb6e34bb73", "dhcp_relay_profile_id": "bbfa30e4-87b6-41b8-8da5-771055967da1", "_last_modified_user": "admin", "_last_modified_time": 1414704710165, "_create_time": 1414704710165, "_create_user": "admin" } Required Permissions: read-api Additional Errors:

Delete a DHCP Relay Service

Deletes the specified dhcp relay service. Request:
Method:
DELETE
URI Path:
/api/v1/dhcp/relays/<relay-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/dhcp/relays/fac2f67e-a860-4a9f-842b-a3cb6e34bb73 Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Update a DHCP Relay Service

Modifies the specified dhcp relay service. Request:
Method:
PUT
URI Path:
/api/v1/dhcp/relays/<relay-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
DhcpRelayService+

Example Request: PUT https://<nsx-mgr>/api/v1/dhcp/relays/fac2f67e-a860-4a9f-842b-a3cb6e34bb73 { "resource_type": "DhcpRelayService", "_revision": 1, "dhcp_relay_profile_id": "bbfa30e4-87b6-41b8-8da5-771055967da1" } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
DhcpRelayService+

Example Response: { "resource_type": "DhcpRelayService", "_revision": 2, "id": "fac2f67e-a860-4a9f-842b-a3cb6e34bb73", "dhcp_relay_profile_id": "bbfa30e4-87b6-41b8-8da5-771055967da1", "_last_modified_user": "admin", "_last_modified_time": 1414705228041, "_create_time": 1414704710165, "_create_user": "admin" } Required Permissions: read-write-api Additional Errors:

Logical Routing And Services: Dhcp Relay Profiles

Associated URIs:

Create a DHCP Relay Profile

Creates a dhcp relay profile. Request:
Method:
POST
URI Path:
/api/v1/dhcp/relay-profiles
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
DhcpRelayProfile+

Example Request: POST https://<nsx-mgr>/api/v1/dhcp/relay-profiles { "server_addresses" : [ "10.1.1.1", "10.2.2.2", "10.3.3.3", "10.4.4.4" ], "display_name" : "dhcp-relay-external-servers", "resource_type": "DhcpRelayProfile" } Successful Response:
Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
DhcpRelayProfile+

Example Response: { "resource_type": "DhcpRelayProfile", "_revision": 0, "id": "bbfa30e4-87b6-41b8-8da5-771055967da1", "display_name": "dhcp-relay-external-servers", "server_addresses": [ "10.1.1.1", "10.2.2.2", "10.3.3.3", "10.4.4.4" ], "_last_modified_user": "admin", "_last_modified_time": 1414623610509, "_create_time": 1414623610509, "_create_user": "admin" } Required Permissions: read-write-api Additional Errors:

List All DHCP Relay Profiles

Returns information about all dhcp relay profiles. Request:
Method:
GET
URI Path:
/api/v1/dhcp/relay-profiles
Request Headers:
n/a
Query Parameters:
ListRequestParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/dhcp/relay-profiles Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
DhcpRelayProfileListResult+

Example Response: { "result_count": 1, "results": [ { "resource_type": "DhcpRelayProfile", "_revision": 0, "id": "bbfa30e4-87b6-41b8-8da5-771055967da1", "display_name": "dhcp-relay-external-servers", "server_addresses": [ "10.1.1.1", "10.2.2.2", "10.3.3.3", "10.4.4.4" ], "_last_modified_user": "admin", "_last_modified_time": 1414623610509, "_create_time": 1414623610509, "_create_user": "admin" } ] } Required Permissions: read-api Additional Errors:

Update a DHCP Relay Profile

Modifies the specified dhcp relay profile. Request:
Method:
PUT
URI Path:
/api/v1/dhcp/relay-profiles/<relay-profile-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
DhcpRelayProfile+

Example Request: PUT https://<nsx-mgr>/api/v1/dhcp/relay-profiles/bbfa30e4-87b6-41b8-8da5-771055967da1 { "resource_type": "DhcpRelayProfile", "_revision": 1, "display_name": "dhcp-relay-servers", "server_addresses": [ "10.10.1.1", "10.20.2.2", "10.30.3.3", "10.40.4.4" ] } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
DhcpRelayProfile+

Example Response: { "resource_type": "DhcpRelayProfile", "_revision": 2, "id": "bbfa30e4-87b6-41b8-8da5-771055967da1", "display_name": "dhcp-relay-servers", "server_addresses": [ "10.10.1.1", "10.20.2.2", "10.30.3.3", "10.40.4.4" ], "_last_modified_user": "admin", "_last_modified_time": 1414624153541, "_create_time": 1414623610509, "_create_user": "admin" } Required Permissions: read-write-api Additional Errors:

Read a DHCP Relay Profile

Returns information about the specified dhcp relay profile. Request:
Method:
GET
URI Path:
/api/v1/dhcp/relay-profiles/<relay-profile-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/dhcp/relay-profiles/bbfa30e4-87b6-41b8-8da5-771055967da1 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
DhcpRelayProfile+

Example Response: { "resource_type": "DhcpRelayProfile", "_revision": 0, "id": "bbfa30e4-87b6-41b8-8da5-771055967da1", "display_name": "dhcp-relay-external-servers", "server_addresses": [ "10.1.1.1", "10.2.2.2", "10.3.3.3", "10.4.4.4" ], "_last_modified_user": "admin", "_last_modified_time": 1414623610509, "_create_time": 1414623610509, "_create_user": "admin" } Required Permissions: read-api Additional Errors:

Delete a DHCP Relay Profile

Deletes the specified dhcp relay profile. Request:
Method:
DELETE
URI Path:
/api/v1/dhcp/relay-profiles/<relay-profile-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/dhcp/relay-profiles/bbfa30e4-87b6-41b8-8da5-771055967da1 Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions: read-write-api Additional Errors:

Logical Routing And Services: Logical Router Ports

Associated URIs:

List Logical Router Ports

Returns information about all logical router ports. Information includes the resource_type (LogicalRouterUpLinkPort, LogicalRouterDownLinkPort, LogicalRouterLinkPort); logical_router_id (the router to which each logical router port is assigned); and any service_bindings (such as DHCP relay service). The GET request can include a query parameter (logical_router_id or logical_switch_id). Request:
Method:
GET
URI Path:
/api/v1/logical-router-ports
Request Headers:
n/a
Query Parameters:
LogicalRouterPortsListParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/logical-router-ports?logical_router_id=723c1e3e-c82c-4243-bba0-2e1ef4815143 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
LogicalRouterPortListResult+

Example Response: { "cursor": "003681096324-23ba-408e-ae24-294a7ba07f60web-tier router", "result_count": 2, "results": [ { "resource_type": "LogicalRouterLinkPort", "revision": 0, "id": "770ffb50-44f7-4d8c-a359-de0af1088932", "service_bindings": [ { "service_id": "dc5804f7-fdd9-4ef6-b5f8-80b1494ca183", "resource_type": "DhcpRelayService" } ] "logical_router_id": "b676dec7-5d78-4492-9b16-cb7cdcf65328", "_last_modified_user": "admin", "_last_modified_time": 1415746635953, "_create_time": 1415746635953, "_create_user": "admin" "resource_type": "LogicalRouterDownLinkPort", "id": "87db83ed-9a73-436b-91f1-a2a793ffaa31", "display_name": "app-tier router", "logical_router_id": "723c1e3e-c82c-4243-bba0-2e1ef4815143", "mac_address": "02:50:56:56:44:52", "linked_logical_switch_port_id": { "target_display_name": "5a3f8696-e7ed-4e01-9fa6-eba1db8d7371", "is_valid": true, "target_type": "LogicalPort", "target_id": "5a3f8696-e7ed-4e01-9fa6-eba1db8d7371" }, "subnets": [ { "ip_addresses": [ "172.16.20.1" ], "prefix_length": 24 } ], "_last_modified_time": 1457984402672, "_create_time": 1457984402672, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 }, { "resource_type": "LogicalRouterLinkPortOnTIER1", "description": "Port created on Tier-1 router for 'overlay-router'(ID: 723c1e3e-c82c-4243-bba0-2e1ef4815143)", "id": "6cafb2ac-27d1-415c-916a-b37e6b8a32e1", "display_name": "tier1 router link port", "logical_router_id": "723c1e3e-c82c-4243-bba0-2e1ef4815143", "mac_address": "02:50:56:00:00:04", "linked_logical_router_port_id": { "target_display_name": "tier0 router link port", "is_valid": true, "target_type": "LogicalRouterLinkPortOnTIER0", "target_id": "48f78319-00e4-47b1-b721-6c3d43df821c" }, "edge_cluster_member_index": [ 0 ], "subnets": [ { "ip_addresses": [ "100.126.240.1" ], "prefix_length": 31 } ], "_last_modified_time": 1457984951916, "_create_time": 1457984404360, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 1 } ] } Required Permissions: read-api Additional Errors:

Create a Logical Router Port

Creates a logical router port. The required parameters include resource_type (LogicalRouterUpLinkPort, LogicalRouterDownLinkPort, LogicalRouterLinkPort); and logical_router_id (the router to which each logical router port is assigned). The service_bindings parameter is optional. Request:
Method:
POST
URI Path:
/api/v1/logical-router-ports
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
LogicalRouterDownLinkPort+
LogicalRouterLinkPortOnTIER0+
LogicalRouterLinkPortOnTIER1+
LogicalRouterUpLinkPort+

Example Request: POST https://<nsx-mgr>/api/v1/logical-router-ports { "resource_type": "LogicalRouterDownLinkPort", "logical_router_id": "723c1e3e-c82c-4243-bba0-2e1ef4815143", "linked_logical_switch_port_id": { "target_type": "LogicalPort", "target_id": "18691381-b08f-4d90-8c0c-98d0e449b141" }, "subnets": [ { "ip_addresses": [ "172.16.40.1" ], "prefix_length": 24 } ] } Successful Response:
Response Code:
201 Created
Response Headers:
Location
Content-type: application/json
Response Body:
LogicalRouterDownLinkPort+
LogicalRouterLinkPortOnTIER0+
LogicalRouterLinkPortOnTIER1+
LogicalRouterUpLinkPort+

Example Response: { "resource_type": "LogicalRouterLinkPort", "_revision": 0, "id": "4a0d8003-0958-4911-a32b-3a5a51f18d95", "logical_router_id": "7a62a0c5-1ea1-4b25-9d43-dce1c0fa4b8c", "resource_type": "LogicalRouterDownLinkPort", "id": "b5ceef62-cc10-424a-96ed-8c2d5989cd50", "display_name": "b5ceef62-cc10-424a-96ed-8c2d5989cd50", "logical_router_id": "723c1e3e-c82c-4243-bba0-2e1ef4815143", "mac_address": "02:50:56:56:44:52", "linked_logical_switch_port_id": { "target_display_name": "db2-switch-to-t1-router", "is_valid": true, "target_type": "LogicalPort", "target_id": "18691381-b08f-4d90-8c0c-98d0e449b141" }, "subnets": [ { "ip_addresses": [ "172.16.40.1" ], "prefix_length": 24 } ], "_last_modified_time": 1458848284438, "_create_time": 1458848284438, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 } Required Permissions: read-write-api Additional Errors:

Delete a Logical Router Port

Deletes the specified logical router port. You must delete logical router ports before you can delete the associated logical router. To Delete Tier0 router link port you must have to delete attached tier1 router link port, otherwise pass "force=true" as query param to force delete the Tier0 router link port. Request:
Method:
DELETE
URI Path:
/api/v1/logical-router-ports/<logical-router-port-id>
Request Headers:
n/a
Query Parameters:
LogicalRouterPortDeleteRequestParameters+
Request Body:
n/a

Example Request: DELETE https://<nsx-mgr>/api/v1/logical-router-ports/258c50b4-c960-4005-9023-f7946e302162 DELETE http://<nsx-mgr>/api/v1/logical-router-ports/258c50b4-c960-4005-9023-f7946e302162?force=true Successful Response:
Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Example Response: None Required Permissions: read-write-api Additional Errors:

Update a Logical Router Port

Modifies the specified logical router port. Required parameters include the resource_type and logical_router_id. Modifiable parameters include the resource_type (LogicalRouterUpLinkPort, LogicalRouterDownLinkPort, LogicalRouterLinkPort), logical_router_id (to reassign the port to a different router), and service_bindings. Request:
Method:
PUT
URI Path:
/api/v1/logical-router-ports/<logical-router-port-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
LogicalRouterDownLinkPort+
LogicalRouterLinkPortOnTIER0+
LogicalRouterLinkPortOnTIER1+
LogicalRouterUpLinkPort+

Example Request: PUT https://<nsx-mgr>/api/v1/logical-router-ports/258c50b4-c960-4005-9023-f7946e302162 { "resource_type": "LogicalRouterDownLinkPort", "id": "81096324-23ba-408e-ae24-294a7ba07f60", "display_name": "web-tier router", "logical_router_id": "723c1e3e-c82c-4243-bba0-2e1ef4815143", "mac_address": "02:50:56:56:44:52", "service_bindings": [ { "service_id": { "target_display_name": "DHCP Relay", "is_valid": true, "target_type": "LogicalService", "target_id": "fb5334a1-3c82-4d2b-8adf-65e52e09d2a1" } } ], "linked_logical_switch_port_id": { "target_display_name": "4630aadd-25d7-4c73-b03c-227ac314dfc4", "is_valid": true, "target_type": "LogicalPort", "target_id": "4630aadd-25d7-4c73-b03c-227ac314dfc4" }, "subnets": [ { "ip_addresses": [ "172.16.10.1" ], "prefix_length": 24 } ], "_revision": 2 } Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
LogicalRouterDownLinkPort+
LogicalRouterLinkPortOnTIER0+
LogicalRouterLinkPortOnTIER1+
LogicalRouterUpLinkPort+

Example Response: { "resource_type": "LogicalRouterUpLinkPort", "_revision": 3, "id": "258c50b4-c960-4005-9023-f7946e302162", "subnets": [ "resource_type": "LogicalRouterDownLinkPort", "id": "81096324-23ba-408e-ae24-294a7ba07f60", "display_name": "web-tier router", "logical_router_id": "723c1e3e-c82c-4243-bba0-2e1ef4815143", "mac_address": "02:50:56:56:44:52", "service_bindings": [ { "service_id": { "target_display_name": "DHCP Relay", "is_valid": true, "target_type": "LogicalService", "target_id": "fb5334a1-3c82-4d2b-8adf-65e52e09d2a1" } } ], "linked_logical_switch_port_id": { "target_display_name": "4630aadd-25d7-4c73-b03c-227ac314dfc4", "is_valid": true, "target_type": "LogicalPort", "target_id": "4630aadd-25d7-4c73-b03c-227ac314dfc4" }, "subnets": [ { "ip_addresses": [ "172.16.10.1" ], "prefix_length": 24 } ], "_last_modified_time": 1458851284244, "_create_time": 1457984402461, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 3 } Required Permissions: read-write-api Additional Errors:

Read Logical Router Port

Returns information about the specified logical router port. Request:
Method:
GET
URI Path:
/api/v1/logical-router-ports/<logical-router-port-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/logical-router-ports/c84f70b4-7500-4087-bb2d-3f68f5a32060 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
LogicalRouterDownLinkPort+
LogicalRouterLinkPortOnTIER0+
LogicalRouterLinkPortOnTIER1+
LogicalRouterUpLinkPort+

Example Response: { "resource_type": "LogicalRouterLinkPort", "_revision": 0, "id": "258c50b4-c960-4005-9023-f7946e302162", "logical_router_id": "7a62a0c5-1ea1-4b25-9d43-dce1c0fa4b8c", "resource_type": "LogicalRouterUpLinkPort", "id": "c84f70b4-7500-4087-bb2d-3f68f5a32060", "display_name": "uplink for vlan-router", "logical_router_id": "7744a9f8-302d-4e80-a5d1-b7e556db9c19", "mac_address": "02:50:56:00:00:01", "linked_logical_switch_port_id": { "target_display_name": "b7f69e2c-f42f-4fee-9313-c486b35a6d41", "is_valid": true, "target_type": "LogicalPort", "target_id": "b7f69e2c-f42f-4fee-9313-c486b35a6d41" }, "edge_cluster_member_index": [ 0 ], "subnets": [ { "ip_addresses": [ "192.168.100.2" ], "prefix_length": 24 } ], "urpf_mode": "STRICT", "_last_modified_time": 1457984403882, "_create_time": 1457984403882, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 } Required Permissions: read-api Additional Errors:

Get the ARP table for the Logical Router Port of the given id

Returns ARP table for the Logical Router Port of the given id, on a node if a query parameter "transport_node_id=" is given. The transport_node_id parameter is mandatory if the router port is not uplink type. Request:
Method:
GET
URI Path:
/api/v1/logical-router-ports/<logical-router-port-id>/arp-table
Request Headers:
n/a
Query Parameters:
ListByNodeIdParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/logical-router-ports/9b2ec1c5-cb54-4d69-8d64-14ccad6ae3cf/arp-table?source=realtime&transport_node_id=f8431964-f400-4da5-8c18-4ce4e6bd5fa5 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
LogicalRouterPortArpTable+

Example Response: { "sort_ascending": true, "sort_by": "displayName", "result_count": 3, "logical_router_port_id": "9b2ec1c5-cb54-4d69-8d64-14ccad6ae3cf", "results": [ { "mac_address": "00:50:56:8e:b4:21", "ip": "172.16.10.21" }, { "mac_address": "02:50:56:56:44:52", "ip": "172.16.10.1" }, { "mac_address": "00:50:56:8e:91:12", "ip": "172.16.10.11" } ] } Required Permissions: read-api Additional Errors:

Get the ARP table for the Logical Router Port of the given id

Returns ARP table in CSV format for the Logical Router Port of the given id, on a node if a query parameter "transport_node_id=" is given. The transport_node_id parameter is mandatory if the router port is not uplink type. Request:
Method:
GET
URI Path:
/api/v1/logical-router-ports/<logical-router-port-id>/arp-table?format=csv
Request Headers:
n/a
Query Parameters:
TransportNodeIdParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/logical-router-ports/b3f74ac8-0c83-4174-b3c3-6d120423290d/arp-table?source=realtime&transport_node_id=ebe174ac-e4f1-4135-ba72-3dd2eb7099e3&format=csv Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: text/csv
Response Body:
LogicalRouterPortArpTableInCsvFormat+

Example Response: mac_address,ip 02:50:56:56:44:52,172.16.20.1 Required Permissions: read-api Additional Errors:

Get the statistics of a specified logical router port on all or a specified node

Returns the statistics for the Logical Router Port. If query parameter "transport_node_id=" is given, only the statistics from the given node for the logical router port will be returned. Otherwise the statistics from each node for the same logical router port will be returned. The transport_node_id is mandatory if the router port is not uplink type. Request:
Method:
GET
URI Path:
/api/v1/logical-router-ports/<logical-router-port-id>/statistics
Request Headers:
n/a
Query Parameters:
TransportNodeIdParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/logical-router-ports/9b2ec1c5-cb54-4d69-8d64-14ccad6ae3cf/statistics?transport_node_id=f8431964-f400-4da5-8c18-4ce4e6bd5fa5 Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
LogicalRouterPortStatistics+

Example Response: { "logical_router_port_id": "9b2ec1c5-cb54-4d69-8d64-14ccad6ae3cf", "per_node_statistics": [ { "tx": { "dropped_packets": 0, "total_bytes": 1193822, "total_packets": 19695 }, "last_update_timestamp": 1457125914113, "rx": { "dropped_packets": 0, "total_bytes": 1492866, "total_packets": 24077 }, "transport_node_id": "f8431964-f400-4da5-8c18-4ce4e6bd5fa5" } ] } Required Permissions: read-api Additional Errors:

Get the statistics summary of a specified logical router port

Returns the summation of statistics from all nodes for the Specified Logical Router Port. Request:
Method:
GET
URI Path:
/api/v1/logical-router-ports/<logical-router-port-id>/statistics/summary
Request Headers:
n/a
Query Parameters:
DataSourceParameters+
Request Body:
n/a

Example Request: GET https://<nsx-mgr>/api/v1/logical-router-ports/9b2ec1c5-cb54-4d69-8d64-14ccad6ae3cf/statistics/summary Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
LogicalRouterPortStatisticsSummary+

Example Response: { "tx": { "dropped_packets": 10, "total_bytes": 12172280, "total_packets": 60789 }, "last_update_timestamp": 1457125987869, "rx": { "dropped_packets": 8535, "total_bytes": 2085660, "total_packets": 33952 }, "logical_router_port_id": "9b2ec1c5-cb54-4d69-8d64-14ccad6ae3cf" } Required Permissions: read-api Additional Errors:

Logical Routing And Services: Logical Routers

Associated URIs: