Endurance

System

Updated

Shut the appliance down

PUT /{applianceId}/system/halt

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

Path parameters
applianceId string Required

The id of the cluster node the request is for.

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

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

const data = await response.json();
Bruno
meta {
  name: Shut the appliance down
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Server shutting down",
  "data": []
}

Reboot the appliance

PUT /{applianceId}/system/reboot

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

Path parameters
applianceId string Required

The id of the cluster node the request is for.

curl
curl -X PUT "https://appliance.example.com/api/v1/{applianceId}/system/reboot" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Bruno
meta {
  name: Reboot the appliance
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Server restarting",
  "data": []
}

Update

Upload a .tar.gz of RPMs, as the packages part of a multipart/form-data body, and install them. The part must declare its type as application/gzip or application/x-gzip; curl sends application/octet-stream unless told otherwise, as in -F 'packages=@update.tar.gz;type=application/gzip'. The archive is read and refused here if it cannot be installed; otherwise the update is started and this returns immediately, before anything is installed. Follow it with GET /ping, whose systemLock is held for the duration of the update, then GET /{applianceId}/system/update/status for the version now running. The request body may be at most maxUploadBytes from GET /{applianceId}/system/update/status (360MiB). A larger one is refused with 413 before it reaches the API.

POST /{applianceId}/system/update

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

Path parameters
applianceId string Required

The id of the cluster node the request is for.

Body parameters
packages string Required

The Update Archive: a gzipped tar of the RPMs to install.

curl
curl -X POST "https://appliance.example.com/api/v1/{applianceId}/system/update" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "packages": "<packages>"
}'
PHP
<?php

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

$payload = [
    'packages' => '<packages>',
];

$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 = {
    "packages": "<packages>"
}

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

const data = await response.json();
Bruno
meta {
  name: Upload a software update archive and start the update
  type: http
  seq: 1
}

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

headers {
  Content-Type: application/json
}

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

body:json {
  {
    "packages": "<packages>"
  }
}
Response
{
  "status": "success",
  "message": "System update started",
  "data": []
}

Apply System Update

PUT /{applianceId}/system/update

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

Path parameters
applianceId string Required

The id of the cluster node the request is for.

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

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

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

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "System updating",
  "data": []
}

Update to a new major version

Set system to update to next major version

PUT /{applianceId}/system/update/majorversion

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

Path parameters
applianceId string Required

The id of the cluster node the request is for.

Body parameters
versionNumber string Required
curl
curl -X PUT "https://appliance.example.com/api/v1/{applianceId}/system/update/majorversion" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "versionNumber": "<versionNumber>"
}'
PHP
<?php

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

$payload = [
    'versionNumber' => '<versionNumber>',
];

$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 = {
    "versionNumber": "<versionNumber>"
}

response = requests.put("https://appliance.example.com/api/v1/{applianceId}/system/update/majorversion", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/system/update/majorversion', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "versionNumber": "<versionNumber>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Update to a new major version
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/system/update/majorversion
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

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

body:json {
  {
    "versionNumber": "<versionNumber>"
  }
}
Response
{
  "status": "success",
  "message": "System has been set to major version {versionNumber}"
}

Get the software update status

currentVersion is what this node is running now: release is the product release, and build is the lb_api build that POST /cluster/join compares between two nodes. Either is null when it cannot be read. majorVersion lists the major versions this node can be updated to, so it is empty on a node already on the newest. maxUploadBytes is the largest request body POST /{applianceId}/system/update accepts, so a client can refuse an Update Archive that is too big before sending it.

GET /{applianceId}/system/update/status

Path parameters
applianceId string Required

The id of the cluster node the request is for.

curl
curl -X GET "https://appliance.example.com/api/v1/{applianceId}/system/update/status" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Bruno
meta {
  name: Get the software update status
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/system/update/status
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "System update status",
  "data": {
    "restartRequired": false,
    "currentVersion": {
      "release": "3.2.1.1",
      "build": "9.14.5.17"
    },
    "majorVersion": [
      {
        "versionNumber": "5.0",
        "rockyRelease": "r9.2",
        "changelogURL": "www.loadbalancer.org",
        "osUpdate": true
      }
    ],
    "packages": [
      {
        "name": "lb_api",
        "summary": "Loadbalancer.org API Files",
        "description": "Package containing our API for the loadbalancer",
        "url": "http://www.loadbalancer.org",
        "license": "GPLv2",
        "architecture": "noarch",
        "repository": "lbBase",
        "release": "12",
        "currentVersion": "4.0.1"
      }
    ],
    "onLineUpdates": true,
    "maxUploadBytes": 377487360
  }
}

Force a check for software updates

Check the repositories again rather than using the cached answer. currentVersion is what this node is running now: release is the product release, and build is the lb_api build that POST /cluster/join compares between two nodes. Either is null when it cannot be read. majorVersion lists the major versions this node can be updated to, so it is empty on a node already on the newest. maxUploadBytes is the largest request body POST /{applianceId}/system/update accepts, so a client can refuse an Update Archive that is too big before sending it.

GET /{applianceId}/system/update/status/force

Path parameters
applianceId string Required

The id of the cluster node the request is for.

curl
curl -X GET "https://appliance.example.com/api/v1/{applianceId}/system/update/status/force" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Bruno
meta {
  name: Force a check for software updates
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/system/update/status/force
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "System update status",
  "data": {
    "restartRequired": false,
    "currentVersion": {
      "release": "3.2.1.1",
      "build": "9.14.5.17"
    },
    "majorVersion": [
      "4.0",
      "4.1"
    ],
    "packages": [
      {
        "name": "lb_api",
        "summary": "Loadbalancer.org API Files",
        "description": "Package containing our API for the loadbalancer",
        "url": "http://www.loadbalancer.org",
        "license": "GPLv2",
        "architecture": "noarch",
        "repository": "lbBase",
        "release": "12",
        "currentVersion": "4.0.1",
        "pendingVersion": "4.0.2"
      }
    ],
    "onLineUpdates": true,
    "maxUploadBytes": 377487360
  }
}