IP groups

An IP group is a named set of addresses an ACL can match on, so one rule can cover many clients.

IP groups

GET /ipgroups

Return all floating ip groups and IP’s

curl
curl -X GET "https://appliance.example.com/api/v1/ipgroups" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ipgroups';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/ipgroups", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ipgroups', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "IP Groups",
  "data": [
    {
      "id": "5e1-db5-4e8-345",
      "name": "group-a",
      "networkIp": "10.10.10.0",
      "networkMask": 24,
      "gateway": "10.10.10.1",
      "defaultGateway": true,
      "assignedInterfaces": [
        {
          "nodeId": "5e1-db5-673-344",
          "interfaceId": "ce6-973-281-e56"
        },
        {
          "nodeId": "5e1-e56-4e8-483",
          "interfaceId": "763-a23-453-b34"
        },
        {
          "nodeId": "5e1-a78-d45-876",
          "interfaceId": "542-456-3d5-234"
        }
      ]
    }
  ]
}

POST /ipgroups

Add a IP Group

This change is staged. Send PUT /services/apply to apply it.

Body parameters
name string Required
networkIp string
networkMask integer
gateway string
defaultGateway boolean
curl
curl -X POST "https://appliance.example.com/api/v1/ipgroups" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "networkIp": "<networkIp>",
  "networkMask": 0,
  "gateway": "<gateway>",
  "defaultGateway": true
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ipgroups';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
    'networkIp' => '<networkIp>',
    'networkMask' => 0,
    'gateway' => '<gateway>',
    'defaultGateway' => true,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "name": "<name>",
    "networkIp": "<networkIp>",
    "networkMask": 0,
    "gateway": "<gateway>",
    "defaultGateway": true
}

response = requests.post("https://appliance.example.com/api/v1/ipgroups", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ipgroups', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "networkIp": "<networkIp>",
  "networkMask": 0,
  "gateway": "<gateway>",
  "defaultGateway": true
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "IP group: {name} added successfully",
  "data": {
    "id": "189-1e2-8b1-85e"
  }
}

Count the unassigned IP groups

GET /ipgroups/unassigned

Get a count of Subnet that have unassigned interfaces

curl
curl -X GET "https://appliance.example.com/api/v1/ipgroups/unassigned" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ipgroups/unassigned';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/ipgroups/unassigned", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ipgroups/unassigned', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Unassigned IP groups",
  "data": [],
  "count": 1
}

By ID

GET /ipgroups/{id}

Get a IP Group by ID

Path parameters
id string Required
curl
curl -X GET "https://appliance.example.com/api/v1/ipgroups/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ipgroups/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/ipgroups/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ipgroups/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "IP Group",
  "data": {
    "id": "5e1-db5-4e8-345",
    "name": "group-a",
    "networkIp": "10.10.10.0",
    "networkMask": 24,
    "gateway": "10.10.10.1",
    "defaultGateway": true,
    "assignedInterfaces": [
      {
        "nodeId": "5e1-db5-673-344",
        "interfaceId": "ce6-973-281-e56"
      },
      {
        "nodeId": "5e1-e56-4e8-483",
        "interfaceId": "763-a23-453-b34"
      },
      {
        "nodeId": "5e1-a78-d45-876",
        "interfaceId": "542-456-3d5-234"
      }
    ]
  }
}

PUT /ipgroups/{id}

Edit a IP Group

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

.Body parameters

name string Required
networkIp string
networkMask integer
gateway string
defaultGateway boolean
curl
curl -X PUT "https://appliance.example.com/api/v1/ipgroups/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "networkIp": "<networkIp>",
  "networkMask": 0,
  "gateway": "<gateway>",
  "defaultGateway": true
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ipgroups/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
    'networkIp' => '<networkIp>',
    'networkMask' => 0,
    'gateway' => '<gateway>',
    'defaultGateway' => true,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "name": "<name>",
    "networkIp": "<networkIp>",
    "networkMask": 0,
    "gateway": "<gateway>",
    "defaultGateway": true
}

response = requests.put("https://appliance.example.com/api/v1/ipgroups/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ipgroups/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "networkIp": "<networkIp>",
  "networkMask": 0,
  "gateway": "<gateway>",
  "defaultGateway": true
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "IP group: {name} edited successfully",
  "data": {
    "id": "189-1e2-8b1-85e"
  }
}

DELETE /ipgroups/{id}

Delete a IP Group by ID

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/ipgroups/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ipgroups/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/ipgroups/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ipgroups/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "IP group: {id} deleted successfully"
}