Network Pools APIs

Network Pools APIs

APIs for managing Network Pools

Table of Contents

1. Create a Network Pool

  • Used to create a Network pool in the system. The added network pool would be used during domain deployments, host commission/expansion flows.

  • If a network pool which is already added before is added, you will get an error with HTTP status 400.

  • If a malformed network pool is added (payload for network parameters, name which is already exist), you will get an error.

1.1. Prerequisites

The following data is required

  • Name

  • List of networks associated with network pool in which each network has

    • Network type - It can be VSAN, VMOTION or NFS Type.

    • VLAN ID - Valid Vlan id range is 0 to 4096.

    • MTU - Valid MTU range is 1500 to 9216.

    • Subnet - Networks of diferent types (e.g. VSAN/VMOTION/NFS) must not have overlapping subnets

    • Subnet mask

    • gateway - The gateway defined for the specified subnet

    • List of IP address ranges - the start and end IP address of each IP Pool should be part of the subnet

1.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "name" : "engineering-networkpool",
  "networks" : [ {
    "type" : "VSAN",
    "vlanId" : 3002,
    "mtu" : 9001,
    "subnet" : "192.168.8.0",
    "mask" : "255.255.252.0",
    "gateway" : "192.168.8.1",
    "ipPools" : [ {
      "start" : "192.168.8.5",
      "end" : "192.168.8.8"
    } ]
  } ]
}'

HTTP Request

POST /v1/network-pools HTTP/1.1
Content-Type: application/json
Content-Length: 304
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "name" : "engineering-networkpool",
  "networks" : [ {
    "type" : "VSAN",
    "vlanId" : 3002,
    "mtu" : 9001,
    "subnet" : "192.168.8.0",
    "mask" : "255.255.252.0",
    "gateway" : "192.168.8.1",
    "ipPools" : [ {
      "start" : "192.168.8.5",
      "end" : "192.168.8.8"
    } ]
  } ]
}

HTTP Response

HTTP/1.1 201 Created
Location: /v1/network-pools/cb0aea48-8e7a-4993-a8a8-2933dd7ed5be
Content-Type: application/json
Content-Length: 165

{
  "id" : "cb0aea48-8e7a-4993-a8a8-2933dd7ed5be",
  "name" : "engineering-networkpool",
  "networks" : [ {
    "id" : "c6a06df5-b69f-42d2-8f19-f3e85e9e549b"
  } ]
}

2. Get the Network Pools

2.1. Prerequisites

None

2.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/network-pools HTTP/1.1
Content-Type: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "elements" : [ {
    "id" : "bec5857d-e999-4f79-b216-c26c24cc6ee6",
    "name" : "engineering-networkpool",
    "networks" : [ {
      "id" : "b1feeb52-5c59-46de-b941-b30e2ba708f0"
    } ]
  }, {
    "id" : "2b1d7f46-bcb0-4019-b8db-bbcf3ec72739",
    "name" : "finance-networkpool",
    "networks" : [ {
      "id" : "4cbcace4-54aa-4fd6-beee-e24bd50cd391"
    } ]
  } ],
  "pageMetadata" : {
    "totalElements" : 2
  }
}

3. Get a Network Pool

3.1. Prerequisites

The following data is required

  • ID of the network pool

3.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/accbb91b-e77c-4a13-8d7d-3a497d76142a' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/network-pools/accbb91b-e77c-4a13-8d7d-3a497d76142a HTTP/1.1
Content-Type: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

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

{
  "id" : "accbb91b-e77c-4a13-8d7d-3a497d76142a",
  "name" : "engineering-networkpool",
  "networks" : [ {
    "id" : "4f6a5197-4035-4dd0-a9b2-ba1ad1997f58"
  } ]
}

4. Get a Network of a Network Pool

4.1. Prerequisites

The following data is required

  • ID of the network

4.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/467de5db-c5de-4761-830e-6c60dff9d79c/networks/b8fe93ab-dd0e-4d9d-8102-d746ebf27d7c' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Response

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

{
  "id" : "b8fe93ab-dd0e-4d9d-8102-d746ebf27d7c",
  "type" : "VSAN",
  "vlanId" : 3002,
  "mtu" : 9216,
  "subnet" : "192.168.8.0",
  "mask" : "255.255.252.0",
  "gateway" : "192.168.8.1",
  "ipPools" : [ {
    "start" : "192.168.8.5",
    "end" : "192.168.8.8"
  } ]
}

5. Rename a Network Pool

5.1. Prerequisites

  • Network pool must exist.

5.2. Steps

  • Get the ID of the network pool. Filter the response by the network pool's current name to get the corresponding ID.

Tip : Get the Network Pools

  • Create a network pool update spec. Create a JSON with the "name" field containing the desired new network pool name.

Tip : NetworkPoolUpdateSpec.

  • Invoke the network pool rename (update) task using the input spec and network pool ID.

Note : Running the updateNetworkPool API will ensure that the requested new name is valid. The API call will fail if the requested new name is invalid.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/1bd0e5ec-2f4d-4e24-ac7e-1a3ce7b0e7e4' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "name" : "new_name"
}'

HTTP Request

PATCH /v1/network-pools/1bd0e5ec-2f4d-4e24-ac7e-1a3ce7b0e7e4 HTTP/1.1
Content-Type: application/json
Content-Length: 25
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "name" : "new_name"
}

HTTP Response

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

{
  "id" : "1bd0e5ec-2f4d-4e24-ac7e-1a3ce7b0e7e4",
  "name" : "engineering-networkpool",
  "networks" : [ {
    "id" : "96754a05-db64-4059-a6f2-cf565ac7d212"
  } ]
}

6. Delete a Network Pool

  • Used to delete a Network pool.

  • Deleting a networkpool which is being used, will give an error.

  • Deleting a networkpool which does not exist, will give a HTTP response code 404.

6.1. Prerequisites

The following data is required

  • ID of the network pool

6.2. Steps

  • Invoke the API

Tip : Refer to: Get the Network Pools to retrieve all network pools in the system and use the ID of network pool to be deleted.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/500e7618-8bfd-48da-9fab-652f51635b76' -i -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

DELETE /v1/network-pools/500e7618-8bfd-48da-9fab-652f51635b76 HTTP/1.1
Content-Type: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 204 No Content

7. Add an IP Pool to a Network of a Network Pool

7.1. Prerequisites

The following data is required

  • ID of the network pool

Tip : Refer to: Get the Network Pools

  • ID of the network.

Tip : Refer to: Get a Network of a Network Pool

  • The start and end IP addresses for the IP pool

7.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/3d09b363-4b51-4e04-961d-2da37c79fa38/networks/82a8680a-4e9d-4195-bef0-dc950a1c5ce3/ip-pools' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "start" : "192.168.8.5",
  "end" : "192.168.8.8"
}'

HTTP Request

POST /v1/network-pools/3d09b363-4b51-4e04-961d-2da37c79fa38/networks/82a8680a-4e9d-4195-bef0-dc950a1c5ce3/ip-pools HTTP/1.1
Content-Type: application/json
Content-Length: 54
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "start" : "192.168.8.5",
  "end" : "192.168.8.8"
}

HTTP Response

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

{
  "id" : "859bf04a-b2a8-47bd-a849-a0ee90907dbf",
  "type" : "VSAN",
  "vlanId" : 3002,
  "mtu" : 9216,
  "subnet" : "192.168.8.0",
  "mask" : "255.255.252.0",
  "gateway" : "192.168.8.1",
  "ipPools" : [ {
    "start" : "192.168.8.5",
    "end" : "192.168.8.8"
  } ]
}

8. Delete an IP Pool from a Network of a Network Pool

8.1. Prerequisites

The following data is required

  • ID of the IP pool

8.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/e66d55f2-bc13-42e2-b526-00c9fd9803a5/networks/85f346e3-0d50-47de-996b-b4408dcba2d8/ip-pools' -i -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "start" : "192.168.8.5",
  "end" : "192.168.8.8"
}'

HTTP Request

DELETE /v1/network-pools/e66d55f2-bc13-42e2-b526-00c9fd9803a5/networks/85f346e3-0d50-47de-996b-b4408dcba2d8/ip-pools HTTP/1.1
Content-Type: application/json
Content-Length: 54
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "start" : "192.168.8.5",
  "end" : "192.168.8.8"
}

HTTP Response

HTTP/1.1 204 No Content

Last updated 2024-02-29 05:35:20 -0800

Operations
GET
Get Network Pool
Get the list of all Network Pools
POST
Create Network Pool
Create a Network Pool
POST
Add Ip Pool To Network Of Network Pool
Add an IP Pool to a Network of a Network Pool
DELETE
Delete Ip Pool From Network Of Network Pool
Delete an IP Pool from a Network of a Network Pool
GET
Get Network Pool By ID
Get a Network Pool
DELETE
Delete Network Pool
Delete a Network Pool
PATCH
Update Network Pool
Update Network Pool
GET
Get Networks Of Network Pool
Get the Networks of a Network Pool
GET
Get Network Of Network Pool
Get a Network of a Network Pool