Nsx T Clusters APIs

Nsx T Clusters APIs

APIs for managing NSX Clusters

Table of Contents

1. Get an NSX Cluster

1.1. Prerequisites

The following data is required

  • ID of the NSX Cluster

1.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/nsxt-clusters/d77231ad-bf61-4331-88f3-b52534d564ba' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/nsxt-clusters/d77231ad-bf61-4331-88f3-b52534d564ba HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 877

{
  "id" : "d77231ad-bf61-4331-88f3-b52534d564ba",
  "nativeId" : "3b9d3d69-cbac-4ea2-aad8-b8203f2ff05a",
  "vipFqdn" : "sfo-w01-nsx01.sfo.rainpole.io",
  "vip" : "172.19.10.81",
  "domains" : [ {
    "id" : "5c6e4716-b069-4481-aa6e-4eca8bf5596a",
    "name" : "sfo-w01"
  } ],
  "nodes" : [ {
    "id" : "7d69b00d-6e5c-41a0-aa21-7152c6647c54",
    "fqdn" : "sfo-w01-nsx01a.sfo.rainpole.io",
    "ipAddress" : "172.19.10.84",
    "name" : "sfo-w01-nsx01a"
  }, {
    "id" : "c9662d07-fa06-41b9-8253-bbbe17251658",
    "fqdn" : "sfo-w01-nsx01b.sfo.rainpole.io",
    "ipAddress" : "172.19.10.83",
    "name" : "sfo-w01-nsx01b"
  }, {
    "id" : "39a6ca0b-5071-473f-8f45-e1aefeba371d",
    "fqdn" : "sfo-w01-nsx01c.sfo.rainpole.io",
    "ipAddress" : "172.19.10.82",
    "name" : "sfo-w01-nsx01c"
  } ],
  "isShared" : false,
  "isShareable" : true,
  "isVlcmCompatible" : false
}

2. Get the NSX Clusters

2.1. Prerequisites

None
Get All NSX Clusters

2.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/nsxt-clusters' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/nsxt-clusters HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 960

{
  "elements" : [ [ {
    "id" : "d77231ad-bf61-4331-88f3-b52534d564ba",
    "nativeId" : "3b9d3d69-cbac-4ea2-aad8-b8203f2ff05a",
    "vipFqdn" : "sfo-w01-nsx01.sfo.rainpole.io",
    "vip" : "172.19.10.81",
    "domains" : [ {
      "id" : "5c6e4716-b069-4481-aa6e-4eca8bf5596a",
      "name" : "sfo-w01"
    } ],
    "nodes" : [ {
      "id" : "7d69b00d-6e5c-41a0-aa21-7152c6647c54",
      "fqdn" : "sfo-w01-nsx01a.sfo.rainpole.io",
      "ipAddress" : "172.19.10.84",
      "name" : "sfo-w01-nsx01a"
    }, {
      "id" : "c9662d07-fa06-41b9-8253-bbbe17251658",
      "fqdn" : "sfo-w01-nsx01b.sfo.rainpole.io",
      "ipAddress" : "172.19.10.83",
      "name" : "sfo-w01-nsx01b"
    }, {
      "id" : "39a6ca0b-5071-473f-8f45-e1aefeba371d",
      "fqdn" : "sfo-w01-nsx01c.sfo.rainpole.io",
      "ipAddress" : "172.19.10.82",
      "name" : "sfo-w01-nsx01c"
    } ],
    "isShared" : false,
    "isShareable" : true,
    "isVlcmCompatible" : false
  } ] ]
}

3. Get the NSX cluster(s) based on a Criterion

This API is used to get the NSX clusters that meets a specific criterion.

3.1. Prerequisites

None
Get the NSX cluster(s) based on a criterion

3.2. Steps

  • Invoke the Get NSX Clusters Criterion API to list all the criteria supported.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/nsxt-clusters/criteria' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/nsxt-clusters/criteria HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 128

{
  "elements" : [ {
    "name" : "NSXT_CLUSTERS_WITH_STATUS",
    "description" : "Return the NSX clusters with status"
  } ]
}
  • Pick one of the criterion and post a query

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/nsxt-clusters/queries' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "name" : "NSXT_CLUSTERS_WITH_STATUS"
}'

HTTP Request

POST /v1/nsxt-clusters/queries HTTP/1.1
Content-Type: application/json
Content-Length: 42
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "name" : "NSXT_CLUSTERS_WITH_STATUS"
}

HTTP Response

HTTP/1.1 202 Accepted
Location: /v1/nsxt-clusters/queries/b5eb63e2-182e-49b3-900c-d0c69cbfcd0b
Content-Type: application/json
Content-Length: 127

{
  "queryInfo" : {
    "status" : "IN_PROGRESS",
    "completed" : false,
    "processing" : true,
    "failure" : false
  }
}
  • Read the tracking URL returned as Location header in the previous step.

  • Poll the tracking URL until the "status" is not "IN_PROGRESS".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/nsxt-clusters/queries/23abc8bc-4981-4006-bf2d-5f0b9467ab79' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/nsxt-clusters/queries/23abc8bc-4981-4006-bf2d-5f0b9467ab79 HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1164

{
  "queryInfo" : {
    "status" : "COMPLETED",
    "completed" : true,
    "processing" : false,
    "failure" : false
  },
  "result" : {
    "elements" : [ {
      "id" : "d77231ad-bf61-4331-88f3-b52534d564ba",
      "vipFqdn" : "sfo-w01-nsx01.sfo.rainpole.io",
      "vip" : "172.19.10.81",
      "domains" : [ {
        "id" : "5c6e4716-b069-4481-aa6e-4eca8bf5596a",
        "name" : "sfo-w01"
      } ],
      "nodes" : [ {
        "id" : "7d69b00d-6e5c-41a0-aa21-7152c6647c54",
        "fqdn" : "sfo-w01-nsx01a.sfo.rainpole.io",
        "ipAddress" : "172.19.10.84",
        "name" : "sfo-w01-nsx01a"
      }, {
        "id" : "c9662d07-fa06-41b9-8253-bbbe17251658",
        "fqdn" : "sfo-w01-nsx01b.sfo.rainpole.io",
        "ipAddress" : "172.19.10.83",
        "name" : "sfo-w01-nsx01b"
      }, {
        "id" : "39a6ca0b-5071-473f-8f45-e1aefeba371d",
        "fqdn" : "sfo-w01-nsx01c.sfo.rainpole.io",
        "ipAddress" : "172.19.10.82",
        "name" : "sfo-w01-nsx01c"
      } ],
      "version" : "3.1.2.0.0-17645047",
      "isShared" : false,
      "isShareable" : true,
      "isVlcmCompatible" : false,
      "status" : "STABLE"
    } ]
  }
}

4. Get an IP address pool from the NSX cluster

4.1. Prerequisites

The following data is required

  • ID of the NSX Cluster

  • Name of the IP address pool

4.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/nsxt-clusters/34e175b1-4d8d-4d74-a0e2-a555f1b1b469/ip-address-pools/static-ip-pool-01' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/nsxt-clusters/34e175b1-4d8d-4d74-a0e2-a555f1b1b469/ip-address-pools/static-ip-pool-01 HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 387

{
  "name" : "static-ip-pool-01",
  "availableIpAddresses" : 31,
  "totalIpAddresses" : 37,
  "blockSubnets" : [ {
    "size" : 16,
    "gatewayAssigned" : true,
    "cidr" : "10.0.15.0/24"
  } ],
  "staticSubnets" : [ {
    "ipAddressPoolRanges" : [ {
      "start" : "10.0.12.100",
      "end" : "10.0.12.120"
    } ],
    "gateway" : "10.0.12.250",
    "cidr" : "10.0.12.0/24"
  } ]
}

5. Get the IP address pools from the NSX cluster

5.1. Prerequisites

The following data is required

  • ID of the NSX Cluster

5.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/nsxt-clusters/0ee1f57b-ea24-4c3d-8b8d-5d1d83023e50/ip-address-pools' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/nsxt-clusters/0ee1f57b-ea24-4c3d-8b8d-5d1d83023e50/ip-address-pools HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 444

{
  "elements" : [ {
    "name" : "static-ip-pool-01",
    "availableIpAddresses" : 31,
    "totalIpAddresses" : 37,
    "blockSubnets" : [ {
      "size" : 16,
      "gatewayAssigned" : true,
      "cidr" : "10.0.15.0/24"
    } ],
    "staticSubnets" : [ {
      "ipAddressPoolRanges" : [ {
        "start" : "10.0.12.100",
        "end" : "10.0.12.120"
      } ],
      "gateway" : "10.0.12.250",
      "cidr" : "10.0.12.0/24"
    } ]
  } ]
}

6. Get the transport zones from the NSX cluster

6.1. Prerequisites

The following data is required

  • ID of the NSX Cluster

6.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/nsxt-clusters/9103ecc6-dada-4b70-9868-5edb1b93d4dd/transport-zones' -i -X GET \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/nsxt-clusters/9103ecc6-dada-4b70-9868-5edb1b93d4dd/transport-zones HTTP/1.1
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 801

{
  "elements" : [ {
    "name" : "nsx-overlay-transportzone-1",
    "id" : "a95c914d-a48d-197c-14ab-10d4647daeba",
    "type" : "OVERLAY"
  }, {
    "name" : "nsx-vlan-transportzone-1",
    "id" : "bb760c81-b50c-2f79-2ca9-2b08708bf8c4",
    "type" : "VLAN"
  }, {
    "name" : "nsx-overlay-transportzone-2",
    "id" : "ce821684-c8b4-31e8-35a1-3b81d6551107",
    "type" : "OVERLAY",
    "nsxtTags" : [ {
      "scope" : "vcf-orchestration",
      "tag" : "vcf"
    }, {
      "scope" : "Created by",
      "tag" : "VCF"
    } ]
  }, {
    "name" : "nsx-vlan-transportzone-2",
    "id" : "db3a2f36-dfd1-443e-40f6-4de01abc963e",
    "type" : "VLAN",
    "nsxtTags" : [ {
      "scope" : "vcf-orchestration",
      "tag" : "vcf"
    }, {
      "scope" : "Created by",
      "tag" : "VCF"
    } ]
  } ]
}

Last updated 2024-03-14 07:59:42 -0700

Operations
GET
Get Nsx Cluster
Retrieve the details of an NSX cluster by its ID
GET
Get Nsx Cluster Query Response
Get NSX cluster query response
GET
Get Nsx Clusters
Retrieve a list of NSX clusters
GET
Get Nsx Criteria
Get all NSX criteria
GET
Get Nsx Criterion
Get a NSX criterion
GET
Get Nsx Ip Address Pool
Retrieve an NSX IP Address Pool by its name
GET
Get Nsx Ip Address Pools
Retrive a list of NSX IP Address Pools by the NSX cluster ID
GET
Get Nsx Transport Zones
Retrieve list of all NSX transport zones
GET
Get Validation Result Using GET
getValidationResult
POST
Start Nsx Criteria Query
Start a query with NSX Criteria
POST
Validate Ip Pool Using POST
validateIpPool