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 API
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 API
- 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/0d94b5c7-dd79-4cfa-b845-37078adb2461
Content-Type: application/json
Content-Length: 165
{
"id" : "0d94b5c7-dd79-4cfa-b845-37078adb2461",
"name" : "engineering-networkpool",
"networks" : [ {
"id" : "5531e40a-8c2b-43cb-b24d-ea450fe67b0c"
} ]
}
1.3. Related APIs API
[_createnetworkpool] API
2. Get the Network Pools
2.1. Prerequisites API
None
2.2. Steps API
- 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" : "351b9c25-de74-4e89-b6b2-f73c3e8411a6",
"name" : "engineering-networkpool",
"networks" : [ {
"id" : "03466d8c-8c92-49d2-9fae-5bc47d1d60f0"
} ]
}, {
"id" : "665379b6-7d40-4f38-899f-5bbcddfedff9",
"name" : "finance-networkpool",
"networks" : [ {
"id" : "4ef196db-328b-4b91-8f8d-e927842ee4e3"
} ]
} ],
"pageMetadata" : {
"totalElements" : 2
}
}
2.3. Related APIs API
[_getnetworkpools] API [_getnetworkpool] API [_getnetworksofnetworkpool] API [_getnetworkofnetworkpool] API
3. Get a Network Pool
3.1. Prerequisites API
The following data is required
- ID of the network pool
3.2. Steps API
- Invoke the API
cURL Request
$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/06725c4f-63a7-43e9-963b-b87f4b4fdf97' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
GET /v1/network-pools/06725c4f-63a7-43e9-963b-b87f4b4fdf97 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" : "06725c4f-63a7-43e9-963b-b87f4b4fdf97",
"name" : "engineering-networkpool",
"networks" : [ {
"id" : "58d6c999-8069-4ac1-a5a8-7e1540ea918f"
} ]
}
3.3. Related APIs API
[_getnetworkpools] API [_getnetworkpool] API [_getnetworksofnetworkpool] API [_getnetworkofnetworkpool] API
4. Get a Network of a Network Pool
4.1. Prerequisites API
The following data is required
- ID of the network
4.2. Steps API
- Invoke the API
cURL Request
$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/748b84d8-9b10-4824-a00b-d63aaa476beb/networks/3c7c382f-184f-4c56-b5a9-3e1e074f7672' -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" : "3c7c382f-184f-4c56-b5a9-3e1e074f7672",
"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"
} ]
}
4.3. Related APIs API
[_getnetworkpools] API [_getnetworkpool] API [_getnetworksofnetworkpool] API [_getnetworkofnetworkpool] API
5. Rename a Network Pool
5.1. Prerequisites API
- Network pool must exist.
5.2. Steps API
- 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/3f177ae8-dffd-4435-b062-38594cb5dd53' -i -X PATCH \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....' \
-d '{
"name" : "new_name"
}'
HTTP Request
PATCH /v1/network-pools/3f177ae8-dffd-4435-b062-38594cb5dd53 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" : "3f177ae8-dffd-4435-b062-38594cb5dd53",
"name" : "engineering-networkpool",
"networks" : [ {
"id" : "70bbaaf0-97f0-4eec-9042-15e6b8c4dd46"
} ]
}
5.3. Related APIs API
[_updatenetworkpool] API [_getnetworkpool] API [_getnetworkpools] API
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 API
The following data is required
- ID of the network pool
6.2. Steps API
- 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/cf0f3f87-e599-42a2-b78e-d07a71b13baf' -i -X DELETE \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
DELETE /v1/network-pools/cf0f3f87-e599-42a2-b78e-d07a71b13baf HTTP/1.1
Content-Type: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....
HTTP Response
HTTP/1.1 204 No Content
6.3. Related APIs API
[_deletenetworkpool] API [_getnetworkpools] API [_getnetworkpool] API
7. Add an IP Pool to a Network of a Network Pool
7.1. Prerequisites API
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 API
- Invoke the API
cURL Request
$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/abff6676-4d0a-4254-ae20-c6e0780caf6f/networks/9a8d7fb8-d52c-4d5b-bde1-a7c01a63a561/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/abff6676-4d0a-4254-ae20-c6e0780caf6f/networks/9a8d7fb8-d52c-4d5b-bde1-a7c01a63a561/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" : "1065875a-b1c8-4e14-a83b-36233a551f71",
"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"
} ]
}
7.3. Related APIs API
[_addippooltonetworkofnetworkpool] API [_getnetworkpools] API [_getnetworkpool] API [_getnetworksofnetworkpool] API [_getnetworkofnetworkpool] API
8. Delete an IP Pool from a Network of a Network Pool
8.1. Prerequisites API
The following data is required
- ID of the IP pool
8.2. Steps API
- Invoke the API
cURL Request
$ curl 'https://sfo-vcf01.rainpole.io/v1/network-pools/a3d8be9d-1b2f-488b-8942-278f59e2f788/networks/184458eb-f9f7-45dc-92e5-fe392ac6c0d2/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/a3d8be9d-1b2f-488b-8942-278f59e2f788/networks/184458eb-f9f7-45dc-92e5-fe392ac6c0d2/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
8.3. Related APIs API
[_deleteippoolfromnetworkofnetworkpool] API [_getnetworkpools] API [_getnetworkpool] API [_getnetworksofnetworkpool] API [_getnetworkofnetworkpool] API
Last updated 2024-08-27 16:13:54 -0700