Endurance

Services

List the services and their state

Get services info

GET /services

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

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

const data = await response.json();
Bruno
meta {
  name: List the services and their state
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Successfully returned all services info",
  "data": [
    {
      "name": "nftables",
      "fullName": "NF Tables",
      "canReload": true,
      "canUpdate": true
    },
    {
      "name": "gslb",
      "fullName": "GSLB",
      "canReload": false,
      "canUpdate": false
    }
  ]
}

Apply pending changes on every node

Apply pending states to services on all nodes

PUT /services/apply

Applies every staged change on every node and restarts the services affected. Nothing configured through the API takes effect until this runs.

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

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

const data = await response.json();
Bruno
meta {
  name: Apply pending changes on every node
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/services/apply
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Successfully applied all service pending states",
  "data": []
}

Reload a service on every node

Apply reload to a service on all nodes

PUT /services/{service}/reload

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

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

const data = await response.json();
Bruno
meta {
  name: Reload a service on every node
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/services/{service}/reload
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service {service} reload request sent",
  "data": []
}

Restart a service on every node

Apply restart to a service on all nodes

PUT /services/{service}/restart

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

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

const data = await response.json();
Bruno
meta {
  name: Restart a service on every node
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/services/{service}/restart
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service {service} restart request sent",
  "data": []
}

Apply an update to a service on every node

Apply update to a service on all nodes

PUT /services/{service}/update

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

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

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

const data = await response.json();
Bruno
meta {
  name: Apply an update to a service on every node
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/services/{service}/update
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service {service} update request sent",
  "data": []
}

Apply pending changes

Apply pending states to services

PUT /{applianceId}/services/apply

Applies the staged changes on one node and restarts the services affected.

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

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

const data = await response.json();
Bruno
meta {
  name: Apply pending changes
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/services/apply
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Successfully applied all service pending states",
  "data": []
}

Reload a service

Apply reload to a service

PUT /{applianceId}/services/{service}/reload

Path parameters
applianceId string Required
service string Required
curl
curl -X PUT "https://appliance.example.com/api/v1/{applianceId}/services/{service}/reload" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Bruno
meta {
  name: Reload a service
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/services/{service}/reload
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service {service} reload request sent",
  "data": []
}

Restart a service

Apply restart to a service

PUT /{applianceId}/services/{service}/restart

Path parameters
applianceId string Required
service string Required
curl
curl -X PUT "https://appliance.example.com/api/v1/{applianceId}/services/{service}/restart" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Bruno
meta {
  name: Restart a service
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/services/{service}/restart
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service {service} restart request sent",
  "data": []
}

Apply an update to a service

Apply update to a service

PUT /{applianceId}/services/{service}/update

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

Path parameters
applianceId string Required
service string Required
curl
curl -X PUT "https://appliance.example.com/api/v1/{applianceId}/services/{service}/update" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Bruno
meta {
  name: Apply an update to a service
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/services/{service}/update
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service {service} update request sent",
  "data": []
}