Frontends
A frontend is the address and port a Virtual Service listens on — what clients connect to — and the rules that decide which backend serves a request.
Frontends
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/frontends" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends';
$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/frontends", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Frontends retrieved successfully.",
"data": [
{
"name": "testingVIP",
"ports": [
7554
],
"sslPorts": [
7888
],
"id": "5cf-0e9-6fa-3f5",
"fipId": "c24-fb1-563-1c3",
"aclIds": [],
"mode": "tcp",
"httpPipeLine": "httpKeepAlive",
"httpPretendKeepalive": false,
"httpAcceptInvalidRequest": false,
"httpRequestTimeout": true,
"tcpKeepalive": false,
"maximumConnections": 40000,
"enableClientConnTimeout": true,
"clientTimeout": "42s",
"setXForwardedforHeader": false,
"httpsForceToRedirect": false,
"httpsRedirectCode": 301,
"acceptProxyProtocol": false,
"hstsEnable": false,
"hstsTimeout": 6,
"headerIds": [],
"unixSocket": false,
"SSLEnable": false,
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": false,
"sslCerts": [],
"statsId": 653199455,
"monitorUri": "",
"type": "frontend"
}
]
}
curl
curl -X POST "https://appliance.example.com/api/v1/haproxy/frontends" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"ports": [
"<ports>"
],
"sslPorts": [
"<sslPorts>"
],
"fipId": "<fipId>",
"serviceIPId": "<serviceIPId>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepAlive": "false",
"httpAcceptInvalidRequest": "false",
"httpRequestTimeout": "true",
"TCPKeepalive": "false",
"maximumConnections": "40000",
"enableClientConnTimeout": "true",
"clientTimeout": "42s",
"setXForwardedForHeader": "false",
"HTTPSForceToRedirect": "false",
"HTTPSRedirectCode": "301",
"acceptProxyProtocol": "false",
"HSTSenable": "false",
"HSTSTimeout": "6",
"headerIds": [
"<headerIds>"
],
"unixSocket": "false",
"SSLEnable": "false",
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": "false",
"sslCerts": [
"<sslCerts>"
],
"mtlsCAId": "",
"mtlsCRLId": "",
"mtlsVerify": "required",
"monitorUri": "<monitorUri>",
"type": "frontend"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'name' => '<name>',
'ports' => [
'<ports>',
],
'sslPorts' => [
'<sslPorts>',
],
'fipId' => '<fipId>',
'serviceIPId' => '<serviceIPId>',
'mode' => 'tcp',
'httpPipeline' => 'httpKeepAlive',
'httpPretendKeepAlive' => 'false',
'httpAcceptInvalidRequest' => 'false',
'httpRequestTimeout' => 'true',
'TCPKeepalive' => 'false',
'maximumConnections' => '40000',
'enableClientConnTimeout' => 'true',
'clientTimeout' => '42s',
'setXForwardedForHeader' => 'false',
'HTTPSForceToRedirect' => 'false',
'HTTPSRedirectCode' => '301',
'acceptProxyProtocol' => 'false',
'HSTSenable' => 'false',
'HSTSTimeout' => '6',
'headerIds' => [
'<headerIds>',
],
'unixSocket' => 'false',
'SSLEnable' => 'false',
'SSLMinVer' => 'TLSv1.1',
'SSLMaxVer' => 'TLSv1.3',
'SSLTLSv130rttEnable' => 'false',
'sslCerts' => [
'<sslCerts>',
],
'mtlsCAId' => '',
'mtlsCRLId' => '',
'mtlsVerify' => 'required',
'monitorUri' => '<monitorUri>',
'type' => 'frontend',
];
$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>",
"ports": [
"<ports>"
],
"sslPorts": [
"<sslPorts>"
],
"fipId": "<fipId>",
"serviceIPId": "<serviceIPId>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepAlive": "false",
"httpAcceptInvalidRequest": "false",
"httpRequestTimeout": "true",
"TCPKeepalive": "false",
"maximumConnections": "40000",
"enableClientConnTimeout": "true",
"clientTimeout": "42s",
"setXForwardedForHeader": "false",
"HTTPSForceToRedirect": "false",
"HTTPSRedirectCode": "301",
"acceptProxyProtocol": "false",
"HSTSenable": "false",
"HSTSTimeout": "6",
"headerIds": [
"<headerIds>"
],
"unixSocket": "false",
"SSLEnable": "false",
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": "false",
"sslCerts": [
"<sslCerts>"
],
"mtlsCAId": "",
"mtlsCRLId": "",
"mtlsVerify": "required",
"monitorUri": "<monitorUri>",
"type": "frontend"
}
response = requests.post("https://appliance.example.com/api/v1/haproxy/frontends", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends', {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<name>",
"ports": [
"<ports>"
],
"sslPorts": [
"<sslPorts>"
],
"fipId": "<fipId>",
"serviceIPId": "<serviceIPId>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepAlive": "false",
"httpAcceptInvalidRequest": "false",
"httpRequestTimeout": "true",
"TCPKeepalive": "false",
"maximumConnections": "40000",
"enableClientConnTimeout": "true",
"clientTimeout": "42s",
"setXForwardedForHeader": "false",
"HTTPSForceToRedirect": "false",
"HTTPSRedirectCode": "301",
"acceptProxyProtocol": "false",
"HSTSenable": "false",
"HSTSTimeout": "6",
"headerIds": [
"<headerIds>"
],
"unixSocket": "false",
"SSLEnable": "false",
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": "false",
"sslCerts": [
"<sslCerts>"
],
"mtlsCAId": "",
"mtlsCRLId": "",
"mtlsVerify": "required",
"monitorUri": "<monitorUri>",
"type": "frontend"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Frontend Added Successfully.",
"data": {
"vip": {
"id": "5cf0e96fa3f54"
}
}
}
By ID
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/frontends/{id}" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{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/frontends/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Frontends retrieved successfully.",
"data": {
"name": "testingVIP",
"ports": [
7554
],
"sslPorts": [
7888
],
"id": "5cf-0e9-6fa-3f5",
"fipId": "c24-fb1-563-1c3",
"aclIds": [],
"mode": "tcp",
"httpPipeLine": "httpKeepAlive",
"httpPretendKeepalive": false,
"httpAcceptInvalidRequest": false,
"httpRequestTimeout": true,
"tcpKeepalive": false,
"maximumConnections": 40000,
"enableClientConnTimeout": true,
"clientTimeout": "42s",
"setXForwardedforHeader": false,
"httpsForceToRedirect": false,
"httpsRedirectCode": 301,
"acceptProxyProtocol": false,
"hstsEnable": false,
"hstsTimeout": 6,
"headerIds": [],
"unixSocket": false,
"SSLEnable": false,
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": false,
"sslCerts": [],
"statsId": 653199455,
"monitorUri": "",
"type": "frontend"
}
}
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/frontends/{id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"ports": [
"<ports>"
],
"sslPorts": [
"<sslPorts>"
],
"fipId": "<fipId>",
"serviceIPId": "<serviceIPId>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepAlive": "false",
"httpAcceptInvalidRequest": "false",
"httpRequestTimeout": "true",
"TCPKeepalive": "false",
"maximumConnections": "40000",
"enableClientConnTimeout": "true",
"clientTimeout": "42s",
"setXForwardedForHeader": "false",
"HTTPSForceToRedirect": "false",
"HTTPSRedirectCode": "301",
"acceptProxyProtocol": "false",
"HSTSenable": "false",
"HSTSTimeout": "6",
"headerIds": [
"<headerIds>"
],
"unixSocket": "false",
"SSLEnable": "false",
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": "false",
"sslCerts": [
"<sslCerts>"
],
"mtlsCAId": "",
"mtlsCRLId": "",
"mtlsVerify": "required",
"monitorUri": "<monitorUri>",
"type": "frontend"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{id}';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'name' => '<name>',
'ports' => [
'<ports>',
],
'sslPorts' => [
'<sslPorts>',
],
'fipId' => '<fipId>',
'serviceIPId' => '<serviceIPId>',
'mode' => 'tcp',
'httpPipeline' => 'httpKeepAlive',
'httpPretendKeepAlive' => 'false',
'httpAcceptInvalidRequest' => 'false',
'httpRequestTimeout' => 'true',
'TCPKeepalive' => 'false',
'maximumConnections' => '40000',
'enableClientConnTimeout' => 'true',
'clientTimeout' => '42s',
'setXForwardedForHeader' => 'false',
'HTTPSForceToRedirect' => 'false',
'HTTPSRedirectCode' => '301',
'acceptProxyProtocol' => 'false',
'HSTSenable' => 'false',
'HSTSTimeout' => '6',
'headerIds' => [
'<headerIds>',
],
'unixSocket' => 'false',
'SSLEnable' => 'false',
'SSLMinVer' => 'TLSv1.1',
'SSLMaxVer' => 'TLSv1.3',
'SSLTLSv130rttEnable' => 'false',
'sslCerts' => [
'<sslCerts>',
],
'mtlsCAId' => '',
'mtlsCRLId' => '',
'mtlsVerify' => 'required',
'monitorUri' => '<monitorUri>',
'type' => 'frontend',
];
$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>",
"ports": [
"<ports>"
],
"sslPorts": [
"<sslPorts>"
],
"fipId": "<fipId>",
"serviceIPId": "<serviceIPId>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepAlive": "false",
"httpAcceptInvalidRequest": "false",
"httpRequestTimeout": "true",
"TCPKeepalive": "false",
"maximumConnections": "40000",
"enableClientConnTimeout": "true",
"clientTimeout": "42s",
"setXForwardedForHeader": "false",
"HTTPSForceToRedirect": "false",
"HTTPSRedirectCode": "301",
"acceptProxyProtocol": "false",
"HSTSenable": "false",
"HSTSTimeout": "6",
"headerIds": [
"<headerIds>"
],
"unixSocket": "false",
"SSLEnable": "false",
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": "false",
"sslCerts": [
"<sslCerts>"
],
"mtlsCAId": "",
"mtlsCRLId": "",
"mtlsVerify": "required",
"monitorUri": "<monitorUri>",
"type": "frontend"
}
response = requests.put("https://appliance.example.com/api/v1/haproxy/frontends/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<name>",
"ports": [
"<ports>"
],
"sslPorts": [
"<sslPorts>"
],
"fipId": "<fipId>",
"serviceIPId": "<serviceIPId>",
"mode": "tcp",
"httpPipeline": "httpKeepAlive",
"httpPretendKeepAlive": "false",
"httpAcceptInvalidRequest": "false",
"httpRequestTimeout": "true",
"TCPKeepalive": "false",
"maximumConnections": "40000",
"enableClientConnTimeout": "true",
"clientTimeout": "42s",
"setXForwardedForHeader": "false",
"HTTPSForceToRedirect": "false",
"HTTPSRedirectCode": "301",
"acceptProxyProtocol": "false",
"HSTSenable": "false",
"HSTSTimeout": "6",
"headerIds": [
"<headerIds>"
],
"unixSocket": "false",
"SSLEnable": "false",
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": "false",
"sslCerts": [
"<sslCerts>"
],
"mtlsCAId": "",
"mtlsCRLId": "",
"mtlsVerify": "required",
"monitorUri": "<monitorUri>",
"type": "frontend"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Frontend Edited Successfully.",
"data": {
"vip": {
"name": "testingVIP1",
"ports": [
7554
],
"id": "5cf-0fe-9e3-985",
"fipId": "c24-fb1-563-1c3",
"aclIds": [],
"mode": "tcp",
"httpPipeLine": "httpKeepAlive",
"httpPretendKeepalive": false,
"httpAcceptInvalidRequest": false,
"httpRequestTimeout": true,
"tcpKeepalive": false,
"maximumConnections": 40000,
"enableClientConnTimeout": true,
"clientTimeout": "42s",
"setXForwardedforHeader": false,
"httpsForceToRedirect": false,
"httpsRedirectCode": 301,
"acceptProxyProtocol": false,
"hstsEnable": false,
"hstsTimeout": 6,
"headerIds": [],
"unixSocket": false,
"SSLEnable": false,
"SSLMinVer": "TLSv1.1",
"SSLMaxVer": "TLSv1.3",
"SSLTLSv130rttEnable": false,
"sslCerts": [],
"statsId": 653199455,
"monitorUri": "",
"type": "frontend"
}
}
}
curl
curl -X DELETE "https://appliance.example.com/api/v1/haproxy/frontends/{id}" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{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/frontends/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Frontend config deleted successfully.",
"data": []
}
List the ACLs of a Layer 7 frontend
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/frontends/{id}/acls" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{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/frontends/{id}/acls", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}/acls', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "ACL retrieved successfully",
"data": [
{
"id": "111-111-111-111",
"conditionType": "path",
"condition": "eq",
"conditionValues": [
"/test.stuff",
"/cheese.com"
],
"redirectType": "backend",
"redirectLocation": "333-333-333-333"
}
]
}
Delete a Layer 7 frontend and everything attached to it
curl
curl -X DELETE "https://appliance.example.com/api/v1/haproxy/frontends/{id}/all" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{id}/all';
$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/frontends/{id}/all", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}/all', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Frontend config and all associated deleted successfully.",
"data": []
}
List the backends of a Layer 7 frontend
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/frontends/{id}/backends" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{id}/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/frontends/{id}/backends", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}/backends', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Backends linked to frontend retrieved successfully.",
"data": []
}
Certificates
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs';
$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/frontends/{id}/certs", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "The associated certificates for the frontend",
"data": {
"certs": [
{
"certificateId": "123-123-123-123",
"certMatchHostnames": [],
"certDenyHostnames": [],
"cipherListId": "123-123-123-123"
}
]
}
}
curl
curl -X POST "https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"certificateId": "<certificateId>",
"certMatchHostnames": [
"<certMatchHostnames>"
],
"certDenyHostnames": [
"<certDenyHostnames>"
],
"cipherListId": "<cipherListId>"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'certificateId' => '<certificateId>',
'certMatchHostnames' => [
'<certMatchHostnames>',
],
'certDenyHostnames' => [
'<certDenyHostnames>',
],
'cipherListId' => '<cipherListId>',
];
$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 = {
"certificateId": "<certificateId>",
"certMatchHostnames": [
"<certMatchHostnames>"
],
"certDenyHostnames": [
"<certDenyHostnames>"
],
"cipherListId": "<cipherListId>"
}
response = requests.post("https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs', {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"certificateId": "<certificateId>",
"certMatchHostnames": [
"<certMatchHostnames>"
],
"certDenyHostnames": [
"<certDenyHostnames>"
],
"cipherListId": "<cipherListId>"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "The certificate has been added to the VIP successfully",
"data": []
}
Certificates by ID
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs/{certId}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"certificateId": "<certificateId>",
"certMatchHostnames": [
"<certMatchHostnames>"
],
"certDenyHostnames": [
"<certDenyHostnames>"
],
"cipherListId": "<cipherListId>"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs/{certId}';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'certificateId' => '<certificateId>',
'certMatchHostnames' => [
'<certMatchHostnames>',
],
'certDenyHostnames' => [
'<certDenyHostnames>',
],
'cipherListId' => '<cipherListId>',
];
$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 = {
"certificateId": "<certificateId>",
"certMatchHostnames": [
"<certMatchHostnames>"
],
"certDenyHostnames": [
"<certDenyHostnames>"
],
"cipherListId": "<cipherListId>"
}
response = requests.put("https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs/{certId}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs/{certId}', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"certificateId": "<certificateId>",
"certMatchHostnames": [
"<certMatchHostnames>"
],
"certDenyHostnames": [
"<certDenyHostnames>"
],
"cipherListId": "<cipherListId>"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "The certificate has been edited successfully",
"data": []
}
curl
curl -X DELETE "https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs/{certId}" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs/{certId}';
$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/frontends/{id}/certs/{certId}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}/certs/{certId}', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Certificate Removed Successfully.",
"data": []
}
Drain a Layer 7 frontend
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/frontends/{id}/drain" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{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/frontends/{id}/drain", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{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 frontend
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/frontends/{id}/halt" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{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/frontends/{id}/halt", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{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 frontend online
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/frontends/{id}/online" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/frontends/{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/frontends/{id}/online", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/frontends/{id}/online', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "The service has been enabled successfully"
}