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/6e2cbb19-31ca-4eeb-a42a-83b34375ac27
Content-Type: application/json
Content-Length: 165

{
  "id" : "6e2cbb19-31ca-4eeb-a42a-83b34375ac27",
  "name" : "engineering-networkpool",
  "networks" : [ {
    "id" : "9687a54b-9f0e-4ab9-8669-ffd5d366ecff"
  } ]
}

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: 375

{
  "elements" : [ {
    "id" : "55052f83-9a43-4eee-a133-d13d73ee2156",
    "name" : "engineering-networkpool",
    "networks" : [ {
      "id" : "78b64554-6b25-478e-8a5d-2f37a162a704"
    } ]
  }, {
    "id" : "55d59b6b-db53-400e-970c-d7f9c7d71fdf",
    "name" : "finance-networkpool",
    "networks" : [ {
      "id" : "0f7982ef-5e9f-491f-bf31-9a8c6167e34d"
    } ]
  } ]
}

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/e55c22af-780a-494a-8bca-efde8e6558db' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/network-pools/e55c22af-780a-494a-8bca-efde8e6558db 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" : "e55c22af-780a-494a-8bca-efde8e6558db",
  "name" : "engineering-networkpool",
  "networks" : [ {
    "id" : "4343e884-c444-4645-886a-98e6ce33c836"
  } ]
}

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/fc4216c0-8165-4f6f-8760-8c2c26d2e2b6/networks/a39d9c7c-4edf-49f3-9536-fb87ce0954ad' -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" : "a39d9c7c-4edf-49f3-9536-fb87ce0954ad",
  "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/0d7478ae-4d13-4aea-ae11-67a7db58b55e' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "name" : "new_name"
}'

HTTP Request

PATCH /v1/network-pools/0d7478ae-4d13-4aea-ae11-67a7db58b55e 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" : "0d7478ae-4d13-4aea-ae11-67a7db58b55e",
  "name" : "engineering-networkpool",
  "networks" : [ {
    "id" : "527f8a17-1ee1-47bf-9d9d-13c80911e184"
  } ]
}

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/b6dfb3e6-d4e4-4ec5-9e46-06e7d6d1996c' -i -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

DELETE /v1/network-pools/b6dfb3e6-d4e4-4ec5-9e46-06e7d6d1996c 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/90f628d7-648b-470b-adf3-5e0ebf76aa81/networks/2139d286-9d68-47f8-ac9c-018083d45fbe/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/90f628d7-648b-470b-adf3-5e0ebf76aa81/networks/2139d286-9d68-47f8-ac9c-018083d45fbe/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" : "c54c43c1-444d-4232-81b1-2c6fbce6bd04",
  "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/9bec4653-42b7-4a4c-b2fe-775926e7fdc7/networks/c7a52586-0317-4a14-85d9-4856b6774970/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/9bec4653-42b7-4a4c-b2fe-775926e7fdc7/networks/c7a52586-0317-4a14-85d9-4856b6774970/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 2023-09-23 19:05:04 -0700

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