Fallback
A fallback page is shown to clients when every Real Server behind a Virtual Service is unavailable. Each page can be used by one or more Virtual Services.
Fallback
curl
curl -X GET "https://appliance.example.com/api/v1/fallback" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/fallback';
$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/fallback", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fallback', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Fallback server pages",
"data": [
{
"id": "5e1de36c8539f",
"name": "fallbackPage1",
"type": "internal",
"certId": ""
},
{
"id": "5e1de37819dd5",
"name": "fallbackPage2",
"type": "external",
"certId": "",
"ip": "1.1.1.1",
"port": 443
}
]
}
curl
curl -X POST "https://appliance.example.com/api/v1/fallback" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"type": "<type>",
"certId": "<certId>",
"pageContent": "<pageContent>",
"ip": "<ip>",
"port": "<port>"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/fallback';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'name' => '<name>',
'type' => '<type>',
'certId' => '<certId>',
'pageContent' => '<pageContent>',
'ip' => '<ip>',
'port' => '<port>',
];
$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>",
"type": "<type>",
"certId": "<certId>",
"pageContent": "<pageContent>",
"ip": "<ip>",
"port": "<port>"
}
response = requests.post("https://appliance.example.com/api/v1/fallback", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fallback', {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<name>",
"type": "<type>",
"certId": "<certId>",
"pageContent": "<pageContent>",
"ip": "<ip>",
"port": "<port>"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Fallback server successfully added",
"data": {
"id": "5e1de37819dd5"
}
}
By ID
curl
curl -X GET "https://appliance.example.com/api/v1/fallback/{id}" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/fallback/{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/fallback/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fallback/{id}', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Fallback server pages",
"data": {
"id": "5e1de36c8539f",
"name": "fallbackPage1",
"type": "internal",
"certId": "",
"pageContent": "<html>Hello World</html>"
}
}
curl
curl -X PUT "https://appliance.example.com/api/v1/fallback/{id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"type": "<type>",
"pageContent": "<pageContent>",
"port": "<port>",
"certId": "<certId>",
"ip": "<ip>"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/fallback/{id}';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'name' => '<name>',
'type' => '<type>',
'pageContent' => '<pageContent>',
'port' => '<port>',
'certId' => '<certId>',
'ip' => '<ip>',
];
$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>",
"type": "<type>",
"pageContent": "<pageContent>",
"port": "<port>",
"certId": "<certId>",
"ip": "<ip>"
}
response = requests.put("https://appliance.example.com/api/v1/fallback/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fallback/{id}', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<name>",
"type": "<type>",
"pageContent": "<pageContent>",
"port": "<port>",
"certId": "<certId>",
"ip": "<ip>"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Fallback server successfully edited"
}
curl
curl -X DELETE "https://appliance.example.com/api/v1/fallback/{id}" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/fallback/{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/fallback/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/fallback/{id}', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Fallback server successfully deleted"
}