Endurance

Layer 7

Layer 7 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 all real servers from the configuration

GET /haproxy/rips

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();
Bruno
meta {
  name: List the Layer 7 real servers
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
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"
      }
    ]
  }
}

Add a real server to a backend.

POST /haproxy/rips

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();
Bruno
meta {
  name: Create a Layer 7 real server
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "name": "<name>",
    "ipDomain": "<ipDomain>",
    "port": 0,
    "weight": "100",
    "minconns": "0",
    "maxconns": "0",
    "backup": "false",
    "count": 0
  }
}
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 all hanging HAProxy Real Servers

GET /haproxy/rips/hanging

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();
Bruno
meta {
  name: List the Layer 7 real servers with pending changes
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips/hanging
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Hanging real servers retrieved successfully",
  "data": [
    "111-111-111-111",
    "222-222-222-222"
  ]
}

Real servers by ID

Get a real server by Id

GET /haproxy/rips/{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();
Bruno
meta {
  name: Get a Layer 7 real server
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
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"
    }
  }
}

Edit a real server.

PUT /haproxy/rips/{id}

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();
Bruno
meta {
  name: Update a Layer 7 real server
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips/{id}
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "name": "<name>",
    "ipDomain": "<ipDomain>",
    "port": 0,
    "weight": "100",
    "minconns": "0",
    "maxconns": "0"
  }
}
Response
{
  "status": "success",
  "message": "RIP Updated Successfully.",
  "data": []
}

Delete a real server.

DELETE /haproxy/rips/{id}

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();
Bruno
meta {
  name: Delete a Layer 7 real server
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "RIP deleted successfully",
  "data": [
    "5cee788d60084"
  ]
}

Drain a Layer 7 real server

Drain a real server

PUT /haproxy/rips/{id}/drain

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();
Bruno
meta {
  name: Drain a Layer 7 real server
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips/{id}/drain
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "The service has been drained successfully",
  "data": []
}

Halt a Layer 7 real server

Halt a real server.

PUT /haproxy/rips/{id}/halt

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();
Bruno
meta {
  name: Halt a Layer 7 real server
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips/{id}/halt
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "The service has been halted successfully",
  "data": []
}

Bring a Layer 7 real server online

Online a real server

PUT /haproxy/rips/{id}/online

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();
Bruno
meta {
  name: Bring a Layer 7 real server online
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/haproxy/rips/{id}/online
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "The service has been enabled successfully",
  "data": []
}