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
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"
}
]
}
]
}
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
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"
}
]
}
}
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"
}
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"
}