Network Pools APIs
APIs for managing Network Pools
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/009f7c89-7dd3-4f78-aa76-f983992c3be6
Content-Type: application/json
Content-Length: 165
{
"id" : "009f7c89-7dd3-4f78-aa76-f983992c3be6",
"name" : "engineering-networkpool",
"networks" : [ {
"id" : "ae061db8-6128-4bc0-a13f-96dc52b36350"
} ]
}
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" : "58aa76d9-24a6-4e58-934b-0f53e29f4018",
"name" : "engineering-networkpool",
"networks" : [ {
"id" : "69b7bba4-622b-4bc3-b75b-84c7aff88f8c"
} ]
}, {
"id" : "60540953-1008-4cf4-b680-c8dbb3d0f74b",
"name" : "finance-networkpool",
"networks" : [ {
"id" : "a50d9597-c3a9-4cc2-9869-d0a880c20fea"
} ]
} ]
}
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/5aaf4221-d296-45fb-b91e-a8d2ff421aae' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
GET /v1/network-pools/5aaf4221-d296-45fb-b91e-a8d2ff421aae 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" : "5aaf4221-d296-45fb-b91e-a8d2ff421aae",
"name" : "engineering-networkpool",
"networks" : [ {
"id" : "f401ef3d-260b-474b-8171-9dc95a9d8944"
} ]
}
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/f14ed0c6-a487-4aa9-ac6d-55c48e0d346c/networks/f9f73a8e-5e38-4762-902e-8bc84911864c' -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" : "f9f73a8e-5e38-4762-902e-8bc84911864c",
"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/d2ff3b40-2d5f-492e-80d5-183196b95ac3' -i -X PATCH \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....' \
-d '{
"name" : "new_name"
}'
HTTP Request
PATCH /v1/network-pools/d2ff3b40-2d5f-492e-80d5-183196b95ac3 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" : "d2ff3b40-2d5f-492e-80d5-183196b95ac3",
"name" : "engineering-networkpool",
"networks" : [ {
"id" : "85d7996b-c2ac-47fa-9a9f-4dd99c8a3dea"
} ]
}
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/a0d4e5db-ccfb-4961-b763-cf35540dcac3' -i -X DELETE \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
DELETE /v1/network-pools/a0d4e5db-ccfb-4961-b763-cf35540dcac3 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/33b14317-70a2-489b-8833-354271aaff03/networks/ed65d8a0-e9da-463a-afbb-7c483d2f60f7/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/33b14317-70a2-489b-8833-354271aaff03/networks/ed65d8a0-e9da-463a-afbb-7c483d2f60f7/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" : "c108c7a8-c262-47bd-99de-ee7651dfe355",
"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/a61ba100-bd2e-4101-ab9e-abec6d1d729c/networks/d2d357f9-9341-461a-9313-04632494d0b6/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/a61ba100-bd2e-4101-ab9e-abec6d1d729c/networks/d2d357f9-9341-461a-9313-04632494d0b6/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 2022-01-24 06:18:36 PST