Global settings
Settings that apply to the whole Layer 7 service rather than to one Virtual Service.
Global settings
curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/global" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/global';
$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/global", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/global', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Global Config Retrieved Successfully",
"data": {
"global": {
"loggingLevel": false,
"connectionTimeout": "4s",
"clientTimeout": "42s",
"serverTimeout": "43s",
"maximumConns": 40000,
"haproxyStatsEnable": false,
"haproxyStatsPassword": "loadbalancer1",
"haproxyStatsServiceId": "111-111-111-111",
"haproxyStatsPort": 7777,
"haproxyStatsAdvanced": false,
"haproxyStatsSSL": true,
"haproxyStatsCertId": "",
"haproxySSLMinVer": "TLSv1.1",
"haproxySSLMaxVer": "TLSv1.3",
"requestBuffLen": 16384,
"headerBuffLen": 1024,
"enablePersistenceReplication": false,
"persistenceReplicationPort": 7778,
"emailMailerPort": 25,
"enableMaxThreads": false,
"numberOfThreads": 3,
"sslCacheSize": 20000,
"sslCacheLifetime": 300,
"enableResolvers": true,
"resolverPreference": "ipv4",
"replicationServiceIP": "111-111-111-111",
"replicationServicePort": 7779
}
}
}
curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/global" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"loggingLevel": "false",
"connectionTimeout": "4s",
"clientTimeout": "42s",
"serverTimeout": "43s",
"maximumConns": "40000",
"haproxyStatsEnable": "false",
"haproxyStatsPassword": "loadbalancer1",
"haproxyStatsServiceId": "<haproxyStatsServiceId>",
"haproxyStatsPort": "7777",
"haproxyStatsAdvanced": "false",
"haproxyStatsSSL": "true",
"haproxyStatsCertId": "null",
"haproxyStatsSSLMinVer": "TLSv1.1",
"haproxyStatsSSLMaxVer": "TLSv1.3",
"requestBuffLen": "16384",
"headerBuffLen": "1024",
"persistenceReplicationServiceIP": "<persistenceReplicationServiceIP>",
"persistenceReplicationPort": "7778",
"emailMailerPort": "25",
"emailAlertFrom": "<emailAlertFrom>",
"emailAlertTo": "<emailAlertTo>",
"emailAlertMailer": "<emailAlertMailer>",
"enableMaxThreads": "false",
"numberOfThreads": "3",
"sslCacheSize": "20000",
"sslCacheLifetime": "300",
"enableResolvers": "true",
"resolverPreference": "ipv4"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/haproxy/global';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'loggingLevel' => 'false',
'connectionTimeout' => '4s',
'clientTimeout' => '42s',
'serverTimeout' => '43s',
'maximumConns' => '40000',
'haproxyStatsEnable' => 'false',
'haproxyStatsPassword' => 'loadbalancer1',
'haproxyStatsServiceId' => '<haproxyStatsServiceId>',
'haproxyStatsPort' => '7777',
'haproxyStatsAdvanced' => 'false',
'haproxyStatsSSL' => 'true',
'haproxyStatsCertId' => 'null',
'haproxyStatsSSLMinVer' => 'TLSv1.1',
'haproxyStatsSSLMaxVer' => 'TLSv1.3',
'requestBuffLen' => '16384',
'headerBuffLen' => '1024',
'persistenceReplicationServiceIP' => '<persistenceReplicationServiceIP>',
'persistenceReplicationPort' => '7778',
'emailMailerPort' => '25',
'emailAlertFrom' => '<emailAlertFrom>',
'emailAlertTo' => '<emailAlertTo>',
'emailAlertMailer' => '<emailAlertMailer>',
'enableMaxThreads' => 'false',
'numberOfThreads' => '3',
'sslCacheSize' => '20000',
'sslCacheLifetime' => '300',
'enableResolvers' => 'true',
'resolverPreference' => 'ipv4',
];
$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 = {
"loggingLevel": "false",
"connectionTimeout": "4s",
"clientTimeout": "42s",
"serverTimeout": "43s",
"maximumConns": "40000",
"haproxyStatsEnable": "false",
"haproxyStatsPassword": "loadbalancer1",
"haproxyStatsServiceId": "<haproxyStatsServiceId>",
"haproxyStatsPort": "7777",
"haproxyStatsAdvanced": "false",
"haproxyStatsSSL": "true",
"haproxyStatsCertId": "null",
"haproxyStatsSSLMinVer": "TLSv1.1",
"haproxyStatsSSLMaxVer": "TLSv1.3",
"requestBuffLen": "16384",
"headerBuffLen": "1024",
"persistenceReplicationServiceIP": "<persistenceReplicationServiceIP>",
"persistenceReplicationPort": "7778",
"emailMailerPort": "25",
"emailAlertFrom": "<emailAlertFrom>",
"emailAlertTo": "<emailAlertTo>",
"emailAlertMailer": "<emailAlertMailer>",
"enableMaxThreads": "false",
"numberOfThreads": "3",
"sslCacheSize": "20000",
"sslCacheLifetime": "300",
"enableResolvers": "true",
"resolverPreference": "ipv4"
}
response = requests.put("https://appliance.example.com/api/v1/haproxy/global", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/global', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"loggingLevel": "false",
"connectionTimeout": "4s",
"clientTimeout": "42s",
"serverTimeout": "43s",
"maximumConns": "40000",
"haproxyStatsEnable": "false",
"haproxyStatsPassword": "loadbalancer1",
"haproxyStatsServiceId": "<haproxyStatsServiceId>",
"haproxyStatsPort": "7777",
"haproxyStatsAdvanced": "false",
"haproxyStatsSSL": "true",
"haproxyStatsCertId": "null",
"haproxyStatsSSLMinVer": "TLSv1.1",
"haproxyStatsSSLMaxVer": "TLSv1.3",
"requestBuffLen": "16384",
"headerBuffLen": "1024",
"persistenceReplicationServiceIP": "<persistenceReplicationServiceIP>",
"persistenceReplicationPort": "7778",
"emailMailerPort": "25",
"emailAlertFrom": "<emailAlertFrom>",
"emailAlertTo": "<emailAlertTo>",
"emailAlertMailer": "<emailAlertMailer>",
"enableMaxThreads": "false",
"numberOfThreads": "3",
"sslCacheSize": "20000",
"sslCacheLifetime": "300",
"enableResolvers": "true",
"resolverPreference": "ipv4"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Global Config Edited Successfully",
"data": {
"global": {
"loggingLevel": false,
"connectionTimeout": "10s",
"clientTimeout": "42s",
"serverTimeout": "43s",
"maximumConns": 10000,
"haproxyStatsEnable": false,
"haproxyStatsPassword": "loadbalancer1",
"haproxyStatsServiceId": "111-111-111-111",
"haproxyStatsPort": 7777,
"haproxyStatsAdvanced": false,
"haproxyStatsSSL": true,
"haproxyStatsCertId": "5e9ee566c7b30",
"haproxySSLMinVer": "TLSv1.1",
"requestBuffLen": 16384,
"headerBuffLen": 1024,
"persistenceReplicationServiceIP": "111-111-111-111",
"persistenceReplicationPort": 7778,
"emailMailerPort": 25,
"enableMaxThreads": false,
"numberOfThreads": 3,
"sslCacheSize": 20000,
"sslCacheLifetime": 300,
"enableResolvers": true,
"resolverPreference": "ipv4"
}
}
}