Firewall marks

A firewall mark groups Layer 4 services so that a client keeps hitting the same Real Server across all of them.

Firewall marks

GET /fwmarks

Get all FW Marks with their configuration details

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

$url = 'https://appliance.example.com/api/v1/fwmarks';
$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/fwmarks", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fwmarks', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "FWMarks",
  "data": [
    {
      "id": "189-1e2-8b1-85e",
      "name": "example-fwmark",
      "number": 1,
      "protocol": "tcp",
      "destinationPorts": [
        80,
        443,
        [
          9000,
          9010
        ]
      ],
      "sourcePorts": [
        8080,
        8443,
        [
          10000,
          10010
        ]
      ],
      "destinationIPSubnets": [
        {
          "type": "manualIP",
          "value": "10.10.10.10"
        }
      ],
      "sourceIPSubnets": [
        {
          "type": "manualSubnet",
          "value": "10.10.10.10/24"
        }
      ]
    }
  ]
}

POST /fwmarks

Add a new FW Mark configuration

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

Body parameters
name string Required

FWMark name (required)

number integer

FWMark number

protocol default: "tcp" none | tcp | udp | tcpudp

Protocol type

destinationPorts array

Array of destination and/or range ports (1-65535)

sourcePorts array

Array of source and/or range ports (1-65535)

destinationIPSubnets array

Array of destination IP subnets

sourceIPSubnets array

Array of source IP subnets

curl
curl -X POST "https://appliance.example.com/api/v1/fwmarks" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "number": 0,
  "protocol": "tcp",
  "destinationPorts": [
    "<destinationPorts>"
  ],
  "sourcePorts": [
    "<sourcePorts>"
  ],
  "destinationIPSubnets": [
    "<destinationIPSubnets>"
  ],
  "sourceIPSubnets": [
    "<sourceIPSubnets>"
  ]
}'
PHP
<?php

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

$payload = [
    'name' => '<name>',
    'number' => 0,
    'protocol' => 'tcp',
    'destinationPorts' => [
        '<destinationPorts>',
    ],
    'sourcePorts' => [
        '<sourcePorts>',
    ],
    'destinationIPSubnets' => [
        '<destinationIPSubnets>',
    ],
    'sourceIPSubnets' => [
        '<sourceIPSubnets>',
    ],
];

$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>",
    "number": 0,
    "protocol": "tcp",
    "destinationPorts": [
        "<destinationPorts>"
    ],
    "sourcePorts": [
        "<sourcePorts>"
    ],
    "destinationIPSubnets": [
        "<destinationIPSubnets>"
    ],
    "sourceIPSubnets": [
        "<sourceIPSubnets>"
    ]
}

response = requests.post("https://appliance.example.com/api/v1/fwmarks", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fwmarks', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "number": 0,
  "protocol": "tcp",
  "destinationPorts": [
    "<destinationPorts>"
  ],
  "sourcePorts": [
    "<sourcePorts>"
  ],
  "destinationIPSubnets": [
    "<destinationIPSubnets>"
  ],
  "sourceIPSubnets": [
    "<sourceIPSubnets>"
  ]
}),
});

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

By ID

GET /fwmarks/{id}

Get a specific FW Mark by its unique identifier

Path parameters
id string Required

Unique identifier of the FWMark

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

$url = 'https://appliance.example.com/api/v1/fwmarks/{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/fwmarks/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fwmarks/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "FWMark",
  "data": {
    "id": "189-1e2-8b1-85e",
    "name": "example-fwmark",
    "number": 1,
    "protocol": "tcp",
    "destinationPorts": [
      80,
      443,
      [
        9000,
        9010
      ]
    ],
    "sourcePorts": [
      8080,
      8443,
      [
        10000,
        10010
      ]
    ],
    "destinationIPSubnets": [
      {
        "type": "manualIP",
        "value": "10.10.10.10"
      }
    ],
    "sourceIPSubnets": [
      {
        "type": "manualSubnet",
        "value": "10.10.10.10/24"
      }
    ]
  }
}

PUT /fwmarks/{id}

Edit an existing FW Mark configuration

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

Path parameters
id string Required

Unique identifier of the FWMark to edit

Body parameters
name string

FWMark name

number integer

FWMark number

protocol none | tcp | udp | tcpudp

Protocol type

destinationPorts array

Array of destination and/or range ports (1-65535)

sourcePorts array

Array of source and/or range ports (1-65535)

destinationIPSubnets array

Array of destination IP subnets

sourceIPSubnets array

Array of source IP subnets

curl
curl -X PUT "https://appliance.example.com/api/v1/fwmarks/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "number": 0,
  "protocol": "none",
  "destinationPorts": [
    "<destinationPorts>"
  ],
  "sourcePorts": [
    "<sourcePorts>"
  ],
  "destinationIPSubnets": [
    "<destinationIPSubnets>"
  ],
  "sourceIPSubnets": [
    "<sourceIPSubnets>"
  ]
}'
PHP
<?php

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

$payload = [
    'name' => '<name>',
    'number' => 0,
    'protocol' => 'none',
    'destinationPorts' => [
        '<destinationPorts>',
    ],
    'sourcePorts' => [
        '<sourcePorts>',
    ],
    'destinationIPSubnets' => [
        '<destinationIPSubnets>',
    ],
    'sourceIPSubnets' => [
        '<sourceIPSubnets>',
    ],
];

$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>",
    "number": 0,
    "protocol": "none",
    "destinationPorts": [
        "<destinationPorts>"
    ],
    "sourcePorts": [
        "<sourcePorts>"
    ],
    "destinationIPSubnets": [
        "<destinationIPSubnets>"
    ],
    "sourceIPSubnets": [
        "<sourceIPSubnets>"
    ]
}

response = requests.put("https://appliance.example.com/api/v1/fwmarks/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fwmarks/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "number": 0,
  "protocol": "none",
  "destinationPorts": [
    "<destinationPorts>"
  ],
  "sourcePorts": [
    "<sourcePorts>"
  ],
  "destinationIPSubnets": [
    "<destinationIPSubnets>"
  ],
  "sourceIPSubnets": [
    "<sourceIPSubnets>"
  ]
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "FWMark: {name} edited successfully"
}

DELETE /fwmarks/{id}

Delete an existing FW Mark by its unique identifier

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

Path parameters
id string Required

Unique identifier of the FWMark to delete

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

$url = 'https://appliance.example.com/api/v1/fwmarks/{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/fwmarks/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fwmarks/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

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