Backends
A backend is the group of Real Servers a Virtual Service distributes traffic across, together with the load balancing method and health check it uses.
Backends
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/backends" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends';
$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/haproxy/backends", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Backend configuration retrieved successfully",
"data": [
{
"id": "5cf-4f3-1a5-977",
"name": "testingbackend",
"ripIds": [],
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepalive": false,
"httpAcceptInvalidResponse": false,
"httpRequestTimeout": true,
"httpReuseConnection": false,
"TCPKeepalive": false,
"balanceMode": "leastconn",
"persistenceMode": "sourceIP",
"persistenceTimeout": "15m",
"persistenceTableSize": 10240,
"httpCookieName": "SERVERID",
"httpCookieMaxIdle": "30m",
"httpCookieMaxLife": "12h",
"applicationCookieName": "",
"XFFIPPosition": -1,
"persistenceClearStickOnDrain": false,
"enableFeedbackAgent": false,
"feedbackAgentPort": 3333,
"feedbackAgentInterval": "2s",
"fallbackPersistence": false,
"fallbackKillConnections": false,
"healthCheck": "connectToPort",
"healthCheckPort": 80,
"healthCheckInterval": "4s",
"healthCheckRise": 2,
"healthCheckFall": 2,
"healthCheckRequestToSend": "/",
"enableServerConnTimeout": true,
"serverTimeout": "43s",
"sendProxyProtocol": "disabled",
"enableTProxy": false,
"enableGzipCompression": false,
"connectionRedispatch": true,
"tunnelTimeout": "1h",
"slowStartTime": "6s",
"aclIds": [],
"headerIds": [],
"fallbackServerId": ""
}
]
}
curl
curl -X POST "https://appliance.example.com/api/v1/haproxy/backends" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepalive": "false",
"httpAcceptInvalidResponse": "false",
"httpRequestTimeout": "true",
"httpReuseConnection": "false",
"TCPKeepalive": "false",
"abortOnClose": "false",
"balanceMode": "leastconn",
"persistenceMode": "sourceIP",
"persistenceTimeout": "15m",
"persistenceTableSize": "10240",
"persistenceTableIPVersion": "4",
"httpCookieName": "<httpCookieName>",
"httpCookieMaxIdle": "30m",
"httpCookieMaxLife": "12h",
"httpCookieHttpOnly": false,
"httpCookieSecure": false,
"httpCookieDomain": "",
"applicationCookieName": "<applicationCookieName>",
"XFFIPPosition": "-1",
"persistenceClearStickOnDrain": "false",
"enableFeedbackAgent": "false",
"feedbackAgentPort": "3333",
"feedbackAgentInterval": "2s",
"fallbackPersistence": "false",
"fallbackKillConnections": "false",
"healthCheck": "connectToPort",
"healthCheckPort": "80",
"healthCheckInterval": "4s",
"healthCheckRise": "2",
"healthCheckFall": "2",
"healthCheckRequestToSend": "/",
"healthCheckResponseExpected": "<healthCheckResponseExpected>",
"healthCheckHostHeader": "<healthCheckHostHeader>",
"healthCheckScriptId": "<healthCheckScriptId>",
"healthCheckParameters": {},
"healthCheckUsername": "<healthCheckUsername>",
"healthCheckPassword": "<healthCheckPassword>",
"enableServerConnTimeout": "true",
"serverTimeout": "43s",
"tunnelTimeout": "1h",
"sendProxyProtocol": "disabled",
"backendSourceAddress": "<backendSourceAddress>",
"enableTProxy": "false",
"enableGzipCompression": "false",
"connectionRedispatch": "true",
"slowStartTime": "6s",
"encryptToRealServers": "false",
"backendCAId": "",
"backendClientCertId": "",
"verifyRealServers": "none",
"verifyHost": ""
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'name' => '<name>',
'mode' => 'tcp',
'httpPipeline' => 'httpKeepAlive',
'httpPretendKeepalive' => 'false',
'httpAcceptInvalidResponse' => 'false',
'httpRequestTimeout' => 'true',
'httpReuseConnection' => 'false',
'TCPKeepalive' => 'false',
'abortOnClose' => 'false',
'balanceMode' => 'leastconn',
'persistenceMode' => 'sourceIP',
'persistenceTimeout' => '15m',
'persistenceTableSize' => '10240',
'persistenceTableIPVersion' => '4',
'httpCookieName' => '<httpCookieName>',
'httpCookieMaxIdle' => '30m',
'httpCookieMaxLife' => '12h',
'httpCookieHttpOnly' => false,
'httpCookieSecure' => false,
'httpCookieDomain' => '',
'applicationCookieName' => '<applicationCookieName>',
'XFFIPPosition' => '-1',
'persistenceClearStickOnDrain' => 'false',
'enableFeedbackAgent' => 'false',
'feedbackAgentPort' => '3333',
'feedbackAgentInterval' => '2s',
'fallbackPersistence' => 'false',
'fallbackKillConnections' => 'false',
'healthCheck' => 'connectToPort',
'healthCheckPort' => '80',
'healthCheckInterval' => '4s',
'healthCheckRise' => '2',
'healthCheckFall' => '2',
'healthCheckRequestToSend' => '/',
'healthCheckResponseExpected' => '<healthCheckResponseExpected>',
'healthCheckHostHeader' => '<healthCheckHostHeader>',
'healthCheckScriptId' => '<healthCheckScriptId>',
'healthCheckParameters' => [],
'healthCheckUsername' => '<healthCheckUsername>',
'healthCheckPassword' => '<healthCheckPassword>',
'enableServerConnTimeout' => 'true',
'serverTimeout' => '43s',
'tunnelTimeout' => '1h',
'sendProxyProtocol' => 'disabled',
'backendSourceAddress' => '<backendSourceAddress>',
'enableTProxy' => 'false',
'enableGzipCompression' => 'false',
'connectionRedispatch' => 'true',
'slowStartTime' => '6s',
'encryptToRealServers' => 'false',
'backendCAId' => '',
'backendClientCertId' => '',
'verifyRealServers' => 'none',
'verifyHost' => '',
];
$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>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepalive": "false",
"httpAcceptInvalidResponse": "false",
"httpRequestTimeout": "true",
"httpReuseConnection": "false",
"TCPKeepalive": "false",
"abortOnClose": "false",
"balanceMode": "leastconn",
"persistenceMode": "sourceIP",
"persistenceTimeout": "15m",
"persistenceTableSize": "10240",
"persistenceTableIPVersion": "4",
"httpCookieName": "<httpCookieName>",
"httpCookieMaxIdle": "30m",
"httpCookieMaxLife": "12h",
"httpCookieHttpOnly": false,
"httpCookieSecure": false,
"httpCookieDomain": "",
"applicationCookieName": "<applicationCookieName>",
"XFFIPPosition": "-1",
"persistenceClearStickOnDrain": "false",
"enableFeedbackAgent": "false",
"feedbackAgentPort": "3333",
"feedbackAgentInterval": "2s",
"fallbackPersistence": "false",
"fallbackKillConnections": "false",
"healthCheck": "connectToPort",
"healthCheckPort": "80",
"healthCheckInterval": "4s",
"healthCheckRise": "2",
"healthCheckFall": "2",
"healthCheckRequestToSend": "/",
"healthCheckResponseExpected": "<healthCheckResponseExpected>",
"healthCheckHostHeader": "<healthCheckHostHeader>",
"healthCheckScriptId": "<healthCheckScriptId>",
"healthCheckParameters": {},
"healthCheckUsername": "<healthCheckUsername>",
"healthCheckPassword": "<healthCheckPassword>",
"enableServerConnTimeout": "true",
"serverTimeout": "43s",
"tunnelTimeout": "1h",
"sendProxyProtocol": "disabled",
"backendSourceAddress": "<backendSourceAddress>",
"enableTProxy": "false",
"enableGzipCompression": "false",
"connectionRedispatch": "true",
"slowStartTime": "6s",
"encryptToRealServers": "false",
"backendCAId": "",
"backendClientCertId": "",
"verifyRealServers": "none",
"verifyHost": ""
}
response = requests.post("https://appliance.example.com/api/v1/haproxy/backends", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends', {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<name>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepalive": "false",
"httpAcceptInvalidResponse": "false",
"httpRequestTimeout": "true",
"httpReuseConnection": "false",
"TCPKeepalive": "false",
"abortOnClose": "false",
"balanceMode": "leastconn",
"persistenceMode": "sourceIP",
"persistenceTimeout": "15m",
"persistenceTableSize": "10240",
"persistenceTableIPVersion": "4",
"httpCookieName": "<httpCookieName>",
"httpCookieMaxIdle": "30m",
"httpCookieMaxLife": "12h",
"httpCookieHttpOnly": false,
"httpCookieSecure": false,
"httpCookieDomain": "",
"applicationCookieName": "<applicationCookieName>",
"XFFIPPosition": "-1",
"persistenceClearStickOnDrain": "false",
"enableFeedbackAgent": "false",
"feedbackAgentPort": "3333",
"feedbackAgentInterval": "2s",
"fallbackPersistence": "false",
"fallbackKillConnections": "false",
"healthCheck": "connectToPort",
"healthCheckPort": "80",
"healthCheckInterval": "4s",
"healthCheckRise": "2",
"healthCheckFall": "2",
"healthCheckRequestToSend": "/",
"healthCheckResponseExpected": "<healthCheckResponseExpected>",
"healthCheckHostHeader": "<healthCheckHostHeader>",
"healthCheckScriptId": "<healthCheckScriptId>",
"healthCheckParameters": {},
"healthCheckUsername": "<healthCheckUsername>",
"healthCheckPassword": "<healthCheckPassword>",
"enableServerConnTimeout": "true",
"serverTimeout": "43s",
"tunnelTimeout": "1h",
"sendProxyProtocol": "disabled",
"backendSourceAddress": "<backendSourceAddress>",
"enableTProxy": "false",
"enableGzipCompression": "false",
"connectionRedispatch": "true",
"slowStartTime": "6s",
"encryptToRealServers": "false",
"backendCAId": "",
"backendClientCertId": "",
"verifyRealServers": "none",
"verifyHost": ""
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Backend added successfully",
"data": {
"id": "5cf-4f3-1a5-977",
"name": "BackendGroup"
}
}
List the Layer 7 backends with pending changes
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/backends/hanging" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/hanging';
$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/haproxy/backends/hanging", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/hanging', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Hanging backends retrieved successfully",
"data": [
"111-111-111-111",
"222-222-222-222"
]
}
By ID
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/backends/{id}" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/{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/haproxy/backends/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/{id}', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Backend configuration retrieved successfully",
"data": {
"id": "5cf-4f3-1a5-977-",
"name": "testingbackend",
"ripIds": [],
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepalive": false,
"httpAcceptInvalidResponse": false,
"httpRequestTimeout": true,
"httpReuseConnection": false,
"TCPKeepalive": false,
"balanceMode": "leastconn",
"persistenceMode": "sourceIP",
"persistenceTimeout": "15m",
"persistenceTableSize": 10240,
"httpCookieName": "",
"httpCookieMaxIdle": "30m",
"httpCookieMaxLife": "12h",
"applicationCookieName": "",
"XFFIPPosition": -1,
"persistenceClearStickOnDrain": false,
"enableFeedbackAgent": false,
"feedbackAgentPort": 3333,
"feedbackAgentInterval": "2s",
"fallbackPersistence": false,
"fallbackKillConnections": false,
"healthCheck": "connectToPort",
"healthCheckPort": 80,
"healthCheckInterval": "4s",
"healthCheckRise": 2,
"healthCheckFall": 2,
"healthCheckRequestToSend": "/",
"enableServerConnTimeout": true,
"serverTimeout": "43s",
"sendProxyProtocol": "disabled",
"enableTProxy": false,
"enableGzipCompression": false,
"connectionRedispatch": true,
"tunnelTimeout": "1h",
"slowStartTime": "6s",
"aclIds": [],
"headerIds": [],
"fallbackServerId": ""
}
}
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/backends/{id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepalive": "false",
"httpAcceptInvalidResponse": "false",
"httpRequestTimeout": "true",
"httpReuseConnection": "false",
"TCPKeepalive": "false",
"abortOnClose": "false",
"balanceMode": "leastconn",
"persistenceMode": "sourceIP",
"persistenceTimeout": "15m",
"persistenceTableSize": "10240",
"persistenceTableIPVersion": "4",
"httpCookieName": "<httpCookieName>",
"httpCookieMaxIdle": "30m",
"httpCookieMaxLife": "12h",
"httpCookieHttpOnly": false,
"httpCookieSecure": false,
"httpCookieDomain": "",
"applicationCookieName": "<applicationCookieName>",
"XFFIPPosition": "-1",
"persistenceClearStickOnDrain": "false",
"enableFeedbackAgent": "false",
"feedbackAgentPort": "3333",
"feedbackAgentInterval": "2s",
"fallbackPersistence": "false",
"fallbackKillConnections": "false",
"healthCheck": "connectToPort",
"healthCheckPort": "80",
"healthCheckInterval": "4s",
"healthCheckRise": "2",
"healthCheckFall": "2",
"healthCheckRequestToSend": "/",
"healthCheckResponseExpected": "<healthCheckResponseExpected>",
"healthCheckHostHeader": "<healthCheckHostHeader>",
"healthCheckScriptId": "<healthCheckScriptId>",
"healthCheckParameters": {},
"healthCheckUsername": "<healthCheckUsername>",
"healthCheckPassword": "<healthCheckPassword>",
"enableServerConnTimeout": "true",
"serverTimeout": "43s",
"tunnelTimeout": "1h",
"sendProxyProtocol": "disabled",
"backendSourceAddress": "<backendSourceAddress>",
"enableTProxy": "false",
"enableGzipCompression": "false",
"connectionRedispatch": "true",
"slowStartTime": "6s",
"encryptToRealServers": "false",
"backendCAId": "",
"backendClientCertId": "",
"verifyRealServers": "none",
"verifyHost": ""
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/{id}';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'name' => '<name>',
'mode' => 'tcp',
'httpPipeline' => 'httpKeepAlive',
'httpPretendKeepalive' => 'false',
'httpAcceptInvalidResponse' => 'false',
'httpRequestTimeout' => 'true',
'httpReuseConnection' => 'false',
'TCPKeepalive' => 'false',
'abortOnClose' => 'false',
'balanceMode' => 'leastconn',
'persistenceMode' => 'sourceIP',
'persistenceTimeout' => '15m',
'persistenceTableSize' => '10240',
'persistenceTableIPVersion' => '4',
'httpCookieName' => '<httpCookieName>',
'httpCookieMaxIdle' => '30m',
'httpCookieMaxLife' => '12h',
'httpCookieHttpOnly' => false,
'httpCookieSecure' => false,
'httpCookieDomain' => '',
'applicationCookieName' => '<applicationCookieName>',
'XFFIPPosition' => '-1',
'persistenceClearStickOnDrain' => 'false',
'enableFeedbackAgent' => 'false',
'feedbackAgentPort' => '3333',
'feedbackAgentInterval' => '2s',
'fallbackPersistence' => 'false',
'fallbackKillConnections' => 'false',
'healthCheck' => 'connectToPort',
'healthCheckPort' => '80',
'healthCheckInterval' => '4s',
'healthCheckRise' => '2',
'healthCheckFall' => '2',
'healthCheckRequestToSend' => '/',
'healthCheckResponseExpected' => '<healthCheckResponseExpected>',
'healthCheckHostHeader' => '<healthCheckHostHeader>',
'healthCheckScriptId' => '<healthCheckScriptId>',
'healthCheckParameters' => [],
'healthCheckUsername' => '<healthCheckUsername>',
'healthCheckPassword' => '<healthCheckPassword>',
'enableServerConnTimeout' => 'true',
'serverTimeout' => '43s',
'tunnelTimeout' => '1h',
'sendProxyProtocol' => 'disabled',
'backendSourceAddress' => '<backendSourceAddress>',
'enableTProxy' => 'false',
'enableGzipCompression' => 'false',
'connectionRedispatch' => 'true',
'slowStartTime' => '6s',
'encryptToRealServers' => 'false',
'backendCAId' => '',
'backendClientCertId' => '',
'verifyRealServers' => 'none',
'verifyHost' => '',
];
$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>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepalive": "false",
"httpAcceptInvalidResponse": "false",
"httpRequestTimeout": "true",
"httpReuseConnection": "false",
"TCPKeepalive": "false",
"abortOnClose": "false",
"balanceMode": "leastconn",
"persistenceMode": "sourceIP",
"persistenceTimeout": "15m",
"persistenceTableSize": "10240",
"persistenceTableIPVersion": "4",
"httpCookieName": "<httpCookieName>",
"httpCookieMaxIdle": "30m",
"httpCookieMaxLife": "12h",
"httpCookieHttpOnly": false,
"httpCookieSecure": false,
"httpCookieDomain": "",
"applicationCookieName": "<applicationCookieName>",
"XFFIPPosition": "-1",
"persistenceClearStickOnDrain": "false",
"enableFeedbackAgent": "false",
"feedbackAgentPort": "3333",
"feedbackAgentInterval": "2s",
"fallbackPersistence": "false",
"fallbackKillConnections": "false",
"healthCheck": "connectToPort",
"healthCheckPort": "80",
"healthCheckInterval": "4s",
"healthCheckRise": "2",
"healthCheckFall": "2",
"healthCheckRequestToSend": "/",
"healthCheckResponseExpected": "<healthCheckResponseExpected>",
"healthCheckHostHeader": "<healthCheckHostHeader>",
"healthCheckScriptId": "<healthCheckScriptId>",
"healthCheckParameters": {},
"healthCheckUsername": "<healthCheckUsername>",
"healthCheckPassword": "<healthCheckPassword>",
"enableServerConnTimeout": "true",
"serverTimeout": "43s",
"tunnelTimeout": "1h",
"sendProxyProtocol": "disabled",
"backendSourceAddress": "<backendSourceAddress>",
"enableTProxy": "false",
"enableGzipCompression": "false",
"connectionRedispatch": "true",
"slowStartTime": "6s",
"encryptToRealServers": "false",
"backendCAId": "",
"backendClientCertId": "",
"verifyRealServers": "none",
"verifyHost": ""
}
response = requests.put("https://appliance.example.com/api/v1/haproxy/backends/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/{id}', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<name>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepalive": "false",
"httpAcceptInvalidResponse": "false",
"httpRequestTimeout": "true",
"httpReuseConnection": "false",
"TCPKeepalive": "false",
"abortOnClose": "false",
"balanceMode": "leastconn",
"persistenceMode": "sourceIP",
"persistenceTimeout": "15m",
"persistenceTableSize": "10240",
"persistenceTableIPVersion": "4",
"httpCookieName": "<httpCookieName>",
"httpCookieMaxIdle": "30m",
"httpCookieMaxLife": "12h",
"httpCookieHttpOnly": false,
"httpCookieSecure": false,
"httpCookieDomain": "",
"applicationCookieName": "<applicationCookieName>",
"XFFIPPosition": "-1",
"persistenceClearStickOnDrain": "false",
"enableFeedbackAgent": "false",
"feedbackAgentPort": "3333",
"feedbackAgentInterval": "2s",
"fallbackPersistence": "false",
"fallbackKillConnections": "false",
"healthCheck": "connectToPort",
"healthCheckPort": "80",
"healthCheckInterval": "4s",
"healthCheckRise": "2",
"healthCheckFall": "2",
"healthCheckRequestToSend": "/",
"healthCheckResponseExpected": "<healthCheckResponseExpected>",
"healthCheckHostHeader": "<healthCheckHostHeader>",
"healthCheckScriptId": "<healthCheckScriptId>",
"healthCheckParameters": {},
"healthCheckUsername": "<healthCheckUsername>",
"healthCheckPassword": "<healthCheckPassword>",
"enableServerConnTimeout": "true",
"serverTimeout": "43s",
"tunnelTimeout": "1h",
"sendProxyProtocol": "disabled",
"backendSourceAddress": "<backendSourceAddress>",
"enableTProxy": "false",
"enableGzipCompression": "false",
"connectionRedispatch": "true",
"slowStartTime": "6s",
"encryptToRealServers": "false",
"backendCAId": "",
"backendClientCertId": "",
"verifyRealServers": "none",
"verifyHost": ""
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Backend edited successfully",
"data": {
"id": "5cf-4f3-1a5-977"
}
}
curl
curl -X DELETE "https://appliance.example.com/api/v1/haproxy/backends/{id}" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/{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/haproxy/backends/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/{id}', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Backend deleted successfully",
"data": []
}
List the ACLs of a Layer 7 backend
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/backends/{id}/acls" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/{id}/acls';
$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/haproxy/backends/{id}/acls", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/{id}/acls', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "ACL retrieved successfully.",
"data": []
}
Drain a Layer 7 backend
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/backends/{id}/drain" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/{id}/drain';
$headers = [
'Authorization: Bearer ' . $token,
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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.put("https://appliance.example.com/api/v1/haproxy/backends/{id}/drain", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/{id}/drain', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "The service has been drained successfully",
"data": []
}
Halt a Layer 7 backend
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/backends/{id}/halt" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/{id}/halt';
$headers = [
'Authorization: Bearer ' . $token,
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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.put("https://appliance.example.com/api/v1/haproxy/backends/{id}/halt", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/{id}/halt', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "The service has been halted successfully",
"data": []
}
Bring a Layer 7 backend online
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/backends/{id}/online" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/{id}/online';
$headers = [
'Authorization: Bearer ' . $token,
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
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.put("https://appliance.example.com/api/v1/haproxy/backends/{id}/online", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/{id}/online', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "The service has been enabled successfully",
"data": []
}
List the real servers of a Layer 7 backend
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/backends/{id}/rips" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/backends/{id}/rips';
$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/haproxy/backends/{id}/rips", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/backends/{id}/rips', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "RIPs retrieved successfully",
"data": {
"rips": [
{
"name": "testingrealserver",
"ip": "192.168.79.101",
"port": 80,
"weight": 100,
"previousweight": 100,
"minconns": 0,
"maxconns": 0,
"ipversion": 4,
"id": "5cee788d60084"
},
{
"name": "testingrealserver2",
"ip": "192.168.79.101",
"port": 81,
"weight": 100,
"previousweight": 100,
"minconns": 0,
"maxconns": 0,
"ipversion": 4,
"id": "5ceea7cc072ab"
}
]
}
}