Endurance

Real servers

Updated

Real servers

Every Layer 4 and Layer 7 Real Server. usage lists the Backends that use each, as the Layer 4 and Layer 7 modules report them.

GET /realservers

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

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

const data = await response.json();
Bruno
meta {
  name: List the Layer 4 and Layer 7 Real Servers
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Real Servers",
  "data": [
    {
      "id": "189-1e2-8b1-85e",
      "name": "web-1",
      "address": "10.10.12.21",
      "enabled": true,
      "disableMode": null,
      "usage": []
    }
  ]
}

Refused when another Real Server has the name or the address, or the address is one of the appliance’s own floating or static IPs.

POST /realservers

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

Body parameters
name string

Unique across Real Servers. The address when omitted.

address string Required

An IP address or a host name. Two spellings of one address (10.0.0.5 and 010.0.0.5, two forms of one IPv6 address, a host name in another case) are the same Real Server, and a host name is never resolved. It cannot be one of the appliance’s own floating or static IPs.

enabled boolean default: true

Whether the Real Server takes traffic in every Backend that uses it. Disabling it overrides each assignment’s own state without changing it, so enabling it restores them.

disableMode soft | hard

How a disabled Real Server stops taking traffic: soft drains it (established connections finish, no new ones arrive), hard stops it at once. Null while enabled. An enabled Real Server disabled without one is disabled soft; a disabled one keeps its mode. Can only be sent for a disabled Real Server. Null is the same as leaving it out.

curl
curl -X POST "https://appliance.example.com/api/v1/realservers" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "address": "<address>",
  "enabled": true,
  "disableMode": "soft"
}'
PHP
<?php

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

$payload = [
    'name' => '<name>',
    'address' => '<address>',
    'enabled' => true,
    'disableMode' => 'soft',
];

$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>",
    "address": "<address>",
    "enabled": true,
    "disableMode": "soft"
}

response = requests.post("https://appliance.example.com/api/v1/realservers", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/realservers', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "address": "<address>",
  "enabled": true,
  "disableMode": "soft"
}),
});

const data = await response.json();
Bruno
meta {
  name: Create a Layer 4 and Layer 7 Real Server
  type: http
  seq: 1
}

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

headers {
  Content-Type: application/json
}

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

body:json {
  {
    "name": "<name>",
    "address": "<address>",
    "enabled": true,
    "disableMode": "soft"
  }
}
Response
{
  "status": "success",
  "message": "Real Server {name} added successfully",
  "data": {
    "id": "189-1e2-8b1-85e"
  }
}

By ID

Get a Layer 4 and Layer 7 Real Server

GET /realservers/{id}

Path parameters
id string Required
curl
curl -X GET "https://appliance.example.com/api/v1/realservers/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Bruno
meta {
  name: Get a Layer 4 and Layer 7 Real Server
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Real Server",
  "data": {
    "id": "189-1e2-8b1-85e",
    "name": "web-1",
    "address": "10.10.12.21",
    "enabled": true,
    "disableMode": null,
    "usage": []
  }
}

Change its name, its address, or whether it is enabled. A field left out keeps its value. Backends reference a Real Server by id, so a new address applies to every Backend that uses it, under the same rules as a new Real Server.

PUT /realservers/{id}

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

Path parameters
id string Required

.Body parameters

name string

Unique across Real Servers.

address string

An IP address or a host name. Two spellings of one address (10.0.0.5 and 010.0.0.5, two forms of one IPv6 address, a host name in another case) are the same Real Server, and a host name is never resolved. It cannot be one of the appliance’s own floating or static IPs.

enabled boolean

Whether the Real Server takes traffic in every Backend that uses it. Disabling it overrides each assignment’s own state without changing it, so enabling it restores them.

disableMode soft | hard

How a disabled Real Server stops taking traffic: soft drains it (established connections finish, no new ones arrive), hard stops it at once. Null while enabled. An enabled Real Server disabled without one is disabled soft; a disabled one keeps its mode. Can only be sent for a disabled Real Server. Null is the same as leaving it out.

curl
curl -X PUT "https://appliance.example.com/api/v1/realservers/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "address": "<address>",
  "enabled": true,
  "disableMode": "soft"
}'
PHP
<?php

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

$payload = [
    'name' => '<name>',
    'address' => '<address>',
    'enabled' => true,
    'disableMode' => 'soft',
];

$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>",
    "address": "<address>",
    "enabled": true,
    "disableMode": "soft"
}

response = requests.put("https://appliance.example.com/api/v1/realservers/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/realservers/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "address": "<address>",
  "enabled": true,
  "disableMode": "soft"
}),
});

const data = await response.json();
Bruno
meta {
  name: Update a Layer 4 and Layer 7 Real Server
  type: http
  seq: 1
}

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

headers {
  Content-Type: application/json
}

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

body:json {
  {
    "name": "<name>",
    "address": "<address>",
    "enabled": true,
    "disableMode": "soft"
  }
}
Response
{
  "status": "success",
  "message": "Real Server updated successfully"
}

Refused while a Layer 4 or Layer 7 Backend reports using it; the error names each one.

DELETE /realservers/{id}

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

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/realservers/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Bruno
meta {
  name: Delete a Layer 4 and Layer 7 Real Server
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Real Server {name} deleted successfully"
}