Application API

IPAM API

GET/api/application/address-pools

Fetching pools

Query parameters

pageinteger
The page to return.
per_pageinteger
Results per page. Defaults to 50; the most is 100.
filter[name]string
Pools whose name contains this text, ignoring case.
Request
GET/api/application/address-pools
curl "https://panel.example.com/api/application/address-pools" \
  -H "Authorization: Bearer <token>" \
  -H "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"
Response
{
  "data": {
    "id": 1,
    "name": "Node 172.16.141.50",
    "nodes_count": 1,
    "addresses_count": 5
  }
}
GET/api/application/address-pools/<pool_id>/addresses

Fetching a pool addresess

Query parameters

pageinteger
The page to return.
per_pageinteger
Results per page. Defaults to 50; the most is 999999.
filter[type]string
ipv4 or ipv6.
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>/addresses
curl "https://panel.example.com/api/application/address-pools/<pool_id>/addresses" \
  -H "Authorization: Bearer <token>" \
  -H "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-pools

Creating 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-pools
curl -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
    ]
  }'
Response
{
  "data": {
    "id": 4,
    "name": "Node dc01.local",
    "nodes_count": 1,
    "addresses_count": 0
  }
}
POST/api/application/address-pools/<pool_id>/addresses

Adding an Address

Adds one address to a pool.

Body parameters

is_bulk_actionbooleanrequired
Always false when adding one address.
addressstringrequired
The IP address to add.
typestringrequired
ipv4 or ipv6. address and gateway must be of this type.
cidrintegerrequired
The network's prefix length, from 0 to 128.
gatewaystringrequired
The network's gateway address.
mac_addressstring or null
MAC address for the address. null leaves it empty.
server_idinteger or nullrequired
ID of the server to allocate the address to. null leaves it unallocated.
Request
POST/api/application/address-pools/<pool_id>/addresses
curl -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"
  }'
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>/addresses

Adding 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 true when adding a range.
starting_addressstringrequired
The first IP address of the range.
ending_addressstringrequired
The last IP address of the range.
typestringrequired
ipv4 or ipv6. starting_address, ending_address, and gateway must be of this type.
cidrintegerrequired
The network's prefix length, from 0 to 128.
gatewaystringrequired
The network's gateway address.
mac_addressstring or nullrequired
MAC address for every address in the range. null leaves them empty.
server_idinteger or nullrequired
ID of the server to allocate every address in the range to. null leaves them unallocated.

Returns no content

Request
POST/api/application/address-pools/<pool_id>/addresses
curl -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"
  }'
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
    ]
  }'
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

typestringrequired
ipv4 or ipv6. address must be of this type.
cidrintegerrequired
The network's prefix length, from 0 to 128.
addressstringrequired
The IP address.
gatewaystring
The network's gateway address.
mac_addressstring or null
MAC address for the address. null leaves it empty.
server_idinteger or null
ID of the server to allocate the address to. null leaves 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"
  }'
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"
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"