GET
/api/application/address-poolsFetching pools
Query parameters
pageinteger- The page to return.
per_pageinteger- Results per page. Defaults to
50; the most is100. filter[name]string- Pools whose name contains this text, ignoring case.
Request
GET
/api/application/address-poolscurl "https://panel.example.com/api/application/address-pools" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json"
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->get('https://panel.example.com/api/application/address-pools');
const response = await fetch('https://panel.example.com/api/application/address-pools', { headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', }, })
Response
{ "data": [ { "id": 2, "name": "Node dc01.local", "nodes_count": 1, "addresses_count": 6 }, { "id": 1, "name": "Node 172.16.141.50", "nodes_count": 1, "addresses_count": 5 } ], "meta": { "pagination": { "total": 2, "count": 2, "per_page": 50, "current_page": 1, "total_pages": 1, "links": {} } } }
GET
/api/application/address-pools/<pool_id>Fetching a pool
Request
GET
/api/application/address-pools/<pool_id>curl "https://panel.example.com/api/application/address-pools/<pool_id>" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json"
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->get('https://panel.example.com/api/application/address-pools/<pool_id>');
const response = await fetch('https://panel.example.com/api/application/address-pools/<pool_id>', { headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', }, })
Response
{ "data": { "id": 1, "name": "Node 172.16.141.50", "nodes_count": 1, "addresses_count": 5 } }
GET
/api/application/address-pools/<pool_id>/addressesFetching a pool addresess
Query parameters
pageinteger- The page to return.
per_pageinteger- Results per page. Defaults to
50; the most is999999. filter[type]stringipv4oripv6.filter[address]string- The address, ignoring case.
filter[*]string- An address's ID, the address itself, or its MAC address, ignoring case. Separate several with commas.
filter[server_id]integer- Addresses allocated to the server with this ID. Leave it empty (
?filter[server_id]=) to list unallocated addresses.
Request
GET
/api/application/address-pools/<pool_id>/addressescurl "https://panel.example.com/api/application/address-pools/<pool_id>/addresses" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json"
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->get('https://panel.example.com/api/application/address-pools/<pool_id>/addresses');
const response = await fetch('https://panel.example.com/api/application/address-pools/<pool_id>/addresses', { headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', }, })
Response
{ "data": [ { "id": 11, "address_pool_id": 2, "server_id": null, "type": "ipv4", "address": "172.16.141.70", "cidr": 24, "gateway": "172.16.141.1", "mac_address": null }, { "id": 10, "address_pool_id": 2, "server_id": null, "type": "ipv4", "address": "172.16.141.69", "cidr": 24, "gateway": "172.16.141.1", "mac_address": null }, { "id": 9, "address_pool_id": 2, "server_id": null, "type": "ipv4", "address": "172.16.141.68", "cidr": 24, "gateway": "172.16.141.1", "mac_address": null }, { "id": 8, "address_pool_id": 2, "server_id": null, "type": "ipv4", "address": "172.16.141.67", "cidr": 24, "gateway": "172.16.141.1", "mac_address": null } ], "meta": { "pagination": { "total": 4, "count": 4, "per_page": 50, "current_page": 1, "total_pages": 1, "links": {} } } }
POST
/api/application/address-poolsCreating a pool
Body parameters
namestringrequired- The pool's name. Up to 191 characters.
node_idsarray of integers- IDs of the nodes that can use this pool.
Request
POST
/api/application/address-poolscurl -X POST "https://panel.example.com/api/application/address-pools" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ --data '{ "name": "Node dc01.local", "node_ids": [ 1 ] }'
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->post('https://panel.example.com/api/application/address-pools', [ 'name' => 'Node dc01.local', 'node_ids' => [ 1, ], ]);
const response = await fetch('https://panel.example.com/api/application/address-pools', { method: 'POST', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "Node dc01.local", "node_ids": [ 1 ] }), })
Response
{ "data": { "id": 4, "name": "Node dc01.local", "nodes_count": 1, "addresses_count": 0 } }
POST
/api/application/address-pools/<pool_id>/addressesAdding an Address
Adds one address to a pool.
Body parameters
is_bulk_actionbooleanrequired- Always
falsewhen adding one address. addressstringrequired- The IP address to add.
typestringrequiredipv4oripv6.addressandgatewaymust be of this type.cidrintegerrequired- The network's prefix length, from
0to128. gatewaystringrequired- The network's gateway address.
mac_addressstring or null- MAC address for the address.
nullleaves it empty. server_idinteger or nullrequired- ID of the server to allocate the address to.
nullleaves it unallocated.
Request
POST
/api/application/address-pools/<pool_id>/addressescurl -X POST "https://panel.example.com/api/application/address-pools/<pool_id>/addresses" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ --data '{ "is_bulk_action": false, "mac_address": null, "server_id": 10, "address": "172.16.141.71", "type": "ipv4", "cidr": 24, "gateway": "172.16.141.1" }'
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->post('https://panel.example.com/api/application/address-pools/<pool_id>/addresses', [ 'is_bulk_action' => false, 'mac_address' => null, 'server_id' => 10, 'address' => '172.16.141.71', 'type' => 'ipv4', 'cidr' => 24, 'gateway' => '172.16.141.1', ]);
const response = await fetch('https://panel.example.com/api/application/address-pools/<pool_id>/addresses', { method: 'POST', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ "is_bulk_action": false, "mac_address": null, "server_id": 10, "address": "172.16.141.71", "type": "ipv4", "cidr": 24, "gateway": "172.16.141.1" }), })
Response
{ "data": { "id": 14, "address_pool_id": 2, "server_id": 10, "type": "ipv4", "address": "172.16.141.71", "cidr": 24, "gateway": "172.16.141.1", "mac_address": null } }
POST
/api/application/address-pools/<pool_id>/addressesAdding a Range of Addresses
Adds every address from a starting address to an ending address. A range holds at most 65,536 addresses.
Body parameters
is_bulk_actionbooleanrequired- Always
truewhen adding a range. starting_addressstringrequired- The first IP address of the range.
ending_addressstringrequired- The last IP address of the range.
typestringrequiredipv4oripv6.starting_address,ending_address, andgatewaymust be of this type.cidrintegerrequired- The network's prefix length, from
0to128. gatewaystringrequired- The network's gateway address.
mac_addressstring or nullrequired- MAC address for every address in the range.
nullleaves them empty. server_idinteger or nullrequired- ID of the server to allocate every address in the range to.
nullleaves them unallocated.
Returns no content
Request
POST
/api/application/address-pools/<pool_id>/addressescurl -X POST "https://panel.example.com/api/application/address-pools/<pool_id>/addresses" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ --data '{ "is_bulk_action": true, "starting_address": "172.16.141.80", "ending_address": "172.16.141.85", "mac_address": null, "server_id": 10, "type": "ipv4", "cidr": 24, "gateway": "172.16.141.1" }'
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->post('https://panel.example.com/api/application/address-pools/<pool_id>/addresses', [ 'is_bulk_action' => true, 'starting_address' => '172.16.141.80', 'ending_address' => '172.16.141.85', 'mac_address' => null, 'server_id' => 10, 'type' => 'ipv4', 'cidr' => 24, 'gateway' => '172.16.141.1', ]);
const response = await fetch('https://panel.example.com/api/application/address-pools/<pool_id>/addresses', { method: 'POST', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ "is_bulk_action": true, "starting_address": "172.16.141.80", "ending_address": "172.16.141.85", "mac_address": null, "server_id": 10, "type": "ipv4", "cidr": 24, "gateway": "172.16.141.1" }), })
PUT
/api/application/address-pools/<pool_id>Updating a pool
Body parameters
namestringrequired- The pool's new name. Up to 191 characters.
node_idsarray of integersrequired- IDs of every node that can use this pool. Nodes left out are detached, so leaving the field out detaches them all. The request is refused if a node you detach has servers using the pool's addresses.
Request
PUT
/api/application/address-pools/<pool_id>curl -X PUT "https://panel.example.com/api/application/address-pools/<pool_id>" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ --data '{ "name": "Network Node dc01.local", "node_ids": [ 1 ] }'
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->put('https://panel.example.com/api/application/address-pools/<pool_id>', [ 'name' => 'Network Node dc01.local', 'node_ids' => [ 1, ], ]);
const response = await fetch('https://panel.example.com/api/application/address-pools/<pool_id>', { method: 'PUT', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ "name": "Network Node dc01.local", "node_ids": [ 1 ] }), })
Response
{ "data": { "id": 2, "name": "Network Node dc01.local", "nodes_count": 1, "addresses_count": 6 } }
PUT
/api/application/address-pools/<pool_id>/addresses/<address_id>Updating an address
Body parameters
typestringrequiredipv4oripv6.addressmust be of this type.cidrintegerrequired- The network's prefix length, from
0to128. addressstringrequired- The IP address.
gatewaystring- The network's gateway address.
mac_addressstring or null- MAC address for the address.
nullleaves it empty. server_idinteger or null- ID of the server to allocate the address to.
nullleaves it unallocated.
Request
PUT
/api/application/address-pools/<pool_id>/addresses/<address_id>curl -X PUT "https://panel.example.com/api/application/address-pools/<pool_id>/addresses/<address_id>" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ --data '{ "mac_address": null, "server_id": 10, "address": "172.16.141.71", "type": "ipv4", "cidr": 24, "gateway": "172.16.141.2" }'
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->put('https://panel.example.com/api/application/address-pools/<pool_id>/addresses/<address_id>', [ 'mac_address' => null, 'server_id' => 10, 'address' => '172.16.141.71', 'type' => 'ipv4', 'cidr' => 24, 'gateway' => '172.16.141.2', ]);
const response = await fetch('https://panel.example.com/api/application/address-pools/<pool_id>/addresses/<address_id>', { method: 'PUT', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ "mac_address": null, "server_id": 10, "address": "172.16.141.71", "type": "ipv4", "cidr": 24, "gateway": "172.16.141.2" }), })
Response
{ "data": { "id": 14, "address_pool_id": 2, "server_id": 10, "type": "ipv4", "address": "172.16.141.71", "cidr": 24, "gateway": "172.16.141.2", "mac_address": null } }
DELETE
/api/application/address-pools/<pool_id>Deleting a pool
- Note: make sure that there are no nodes associated with that pool before deleting. If there are nodes, an HTTP exception will be thrown and the action won't be processed.
Returns no content
Request
DELETE
/api/application/address-pools/<pool_id>curl -X DELETE "https://panel.example.com/api/application/address-pools/<pool_id>" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json"
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->delete('https://panel.example.com/api/application/address-pools/<pool_id>');
const response = await fetch('https://panel.example.com/api/application/address-pools/<pool_id>', { method: 'DELETE', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', }, })
DELETE
/api/application/address-pools/<pool_id>/addresses/<address_id>Deleting an address
Returns no content
Request
DELETE
/api/application/address-pools/<pool_id>/addresses/<address_id>curl -X DELETE "https://panel.example.com/api/application/address-pools/<pool_id>/addresses/<address_id>" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json"
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->delete('https://panel.example.com/api/application/address-pools/<pool_id>/addresses/<address_id>');
const response = await fetch('https://panel.example.com/api/application/address-pools/<pool_id>/addresses/<address_id>', { method: 'DELETE', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', }, })