Real servers

Real Servers are the servers behind a Virtual Service that answer client requests. Each is health checked, and is taken out of service automatically when it fails.

Real servers

GET /haproxy/rips

Get all real servers from the configuration

curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/rips" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/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/rips", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "RIPs retrieved successfully",
  "data": {
    "rips": [
      {
        "name": "testingrealserver",
        "ipDomain": "192.168.79.101",
        "port": 80,
        "weight": 100,
        "previousweight": 100,
        "minconns": 0,
        "maxconns": 0,
        "ipversion": 4,
        "id": "5ce-e78-8d6-008"
      },
      {
        "name": "testingrealserver2",
        "ipDomain": "192.168.79.101",
        "port": 81,
        "weight": 100,
        "previousweight": 100,
        "minconns": 0,
        "maxconns": 0,
        "ipversion": 4,
        "id": "5ce-ea7-cc0-72a"
      }
    ]
  }
}

POST /haproxy/rips

Add a real server to a backend.

This change is staged. Send PUT /services/apply to apply it.

Body parameters
name string

The identifying name for the real server.

ipDomain string Required

The IP address or Domain of the real server.

port integer Required

The port that the traffic will be sent to. Leave blank for multiple ports.

weight integer default: "100"

The weighting of the real server. Higher weights relative to other real servers mean more likely to receive traffic.

minconns integer default: "0"

The minimum number of concurrent connections that HAProxy will try to maintain on the real server. When combined with maxconns HAProxy will try to maintain a connection number between those 2 values

maxconns integer default: "0"

The maximum number of concurrent connections permitted until traffic is passed onto another real server.

backup boolean default: "false"

set as backup

count integer

The count of how many RIPs to add, ip address will be added incrementally

curl
curl -X POST "https://appliance.example.com/api/v1/haproxy/rips" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "ipDomain": "<ipDomain>",
  "port": 0,
  "weight": "100",
  "minconns": "0",
  "maxconns": "0",
  "backup": "false",
  "count": 0
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/rips';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
    'ipDomain' => '<ipDomain>',
    'port' => 0,
    'weight' => '100',
    'minconns' => '0',
    'maxconns' => '0',
    'backup' => 'false',
    'count' => 0,
];

$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>",
    "ipDomain": "<ipDomain>",
    "port": 0,
    "weight": "100",
    "minconns": "0",
    "maxconns": "0",
    "backup": "false",
    "count": 0
}

response = requests.post("https://appliance.example.com/api/v1/haproxy/rips", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "ipDomain": "<ipDomain>",
  "port": 0,
  "weight": "100",
  "minconns": "0",
  "maxconns": "0",
  "backup": "false",
  "count": 0
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "RIP added successfully",
  "data": [
    {
      "id": "5cf-7a3-706-ab8"
    },
    {
      "id": "5cf-7a3-06a-bg6"
    },
    {
      "id": "5c7-a37-065-86a"
    }
  ]
}

List the Layer 7 real servers with pending changes

GET /haproxy/rips/hanging

Get all hanging HAProxy Real Servers

curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/rips/hanging" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/rips/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/rips/hanging", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips/hanging', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Hanging real servers retrieved successfully",
  "data": [
    "111-111-111-111",
    "222-222-222-222"
  ]
}

By ID

GET /haproxy/rips/{id}

Get a real server by Id

Path parameters
id string Required

The id of the rip.

curl
curl -X GET "https://appliance.example.com/api/v1/haproxy/rips/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/rips/{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/rips/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "RIPs retrieved successfully",
  "data": {
    "rip": {
      "name": "testingrealserver2",
      "ipDomain": "192.168.79.101",
      "port": 81,
      "weight": 100,
      "previousweight": 100,
      "minconns": 0,
      "maxconns": 0,
      "ipversion": 4,
      "id": "5ce-ea7-cc0-72a"
    }
  }
}

PUT /haproxy/rips/{id}

Edit a real server.

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

The id of the rip. traffic is passed onto another real server.

Body parameters
name string

The identifying name for the real server.

ipDomain string

The IP address or Domain of the real server.

port integer

The port that the traffic will be sent to. Leave blank for multiple ports.

weight integer default: "100"

The weighting of the real server. Higher weights relative to other real servers mean more likely to receive traffic.

minconns integer default: "0"

The minimum number of concurrent connections that HAProxy will try to maintain on the real server. When combined with maxconns HAProxy will try to maintain a connection number between those 2 values

maxconns integer default: "0"

The maximum number of concurrent connections permitted until

curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/rips/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "ipDomain": "<ipDomain>",
  "port": 0,
  "weight": "100",
  "minconns": "0",
  "maxconns": "0"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/rips/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
    'ipDomain' => '<ipDomain>',
    'port' => 0,
    'weight' => '100',
    'minconns' => '0',
    'maxconns' => '0',
];

$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>",
    "ipDomain": "<ipDomain>",
    "port": 0,
    "weight": "100",
    "minconns": "0",
    "maxconns": "0"
}

response = requests.put("https://appliance.example.com/api/v1/haproxy/rips/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "ipDomain": "<ipDomain>",
  "port": 0,
  "weight": "100",
  "minconns": "0",
  "maxconns": "0"
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "RIP Updated Successfully.",
  "data": []
}

DELETE /haproxy/rips/{id}

Delete a real server.

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

The id of the rip.

curl
curl -X DELETE "https://appliance.example.com/api/v1/haproxy/rips/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/rips/{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/rips/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "RIP deleted successfully",
  "data": [
    "5cee788d60084"
  ]
}

Drain a Layer 7 real server

PUT /haproxy/rips/{id}/drain

Drain a real server

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

The id of the rip.

curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/rips/{id}/drain" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/rips/{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/rips/{id}/drain", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips/{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 real server

PUT /haproxy/rips/{id}/halt

Halt a real server.

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

The id of the rip.

curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/rips/{id}/halt" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/rips/{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/rips/{id}/halt", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips/{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 real server online

PUT /haproxy/rips/{id}/online

Online a real server

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

The id of the rip.

curl
curl -X PUT "https://appliance.example.com/api/v1/haproxy/rips/{id}/online" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/haproxy/rips/{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/rips/{id}/online", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/haproxy/rips/{id}/online', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "The service has been enabled successfully",
  "data": []
}