Endurance

Backup & restore

Backup

GET /backup

Get Backup as a single json File

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

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

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

DELETE /backup

Delete every backup

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

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "All backup deleted"
}

Delete every automatic backup

DELETE /backup/auto

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

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "Auto backup deleted"
}

List the backups

GET /backup/list

List All Backups

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "Backups",
  "data": {
    "uploads": [
      {
        "file": "LB_Backup_2023-01-27_09_23_02+0000.json",
        "dateTime": "27/01/2023 09:23:02 +0000",
        "nodes": [
          {
            "id": "22c-438-13a-cda",
            "hostname": "mc-lbnode-1"
          },
          {
            "id": "251-759-cc5-a14",
            "hostname": "mc-lbnode-2"
          }
        ],
        "sections": [
          {
            "name": "rbac",
            "nameFull": "RBAC",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "gslb",
            "nameFull": "GSLB",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "certs",
            "nameFull": "Certificates",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "haproxy",
            "nameFull": "HAProxy",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "fallbackServer",
            "nameFull": "Fallback Pages",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "pulseha",
            "nameFull": "PulseHA",
            "version": 1,
            "partRestore": false
          },
          {
            "name": "fip",
            "nameFull": "FIPs",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "healthchecks",
            "nameFull": "Health Checks",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "system",
            "nameFull": "System",
            "version": 1,
            "partRestore": false
          },
          {
            "name": "licence",
            "nameFull": "Licence",
            "version": 1,
            "partRestore": false
          }
        ]
      }
    ],
    "auto": [
      {
        "file": "lbConfig_20230131235207_POST-api-v1-haproxy-frontends.json",
        "dateTime": "31/01/2023 23:52:07 +0000",
        "nodes": [
          {
            "id": "22c-438-13a-cda",
            "hostname": "mc-lbnode-1"
          },
          {
            "id": "251-759-cc5-a14",
            "hostname": "mc-lbnode-2"
          }
        ],
        "sections": [
          {
            "name": "rbac",
            "nameFull": "RBAC",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "gslb",
            "nameFull": "GSLB",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "certs",
            "nameFull": "Certificates",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "haproxy",
            "nameFull": "HAProxy",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "fallbackServer",
            "nameFull": "Fallback Pages",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "pulseha",
            "nameFull": "PulseHA",
            "version": 1,
            "partRestore": false
          },
          {
            "name": "fip",
            "nameFull": "FIPs",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "healthchecks",
            "nameFull": "Health Checks",
            "version": 1,
            "partRestore": true
          },
          {
            "name": "system",
            "nameFull": "System",
            "version": 1,
            "partRestore": false
          },
          {
            "name": "licence",
            "nameFull": "Licence",
            "version": 1,
            "partRestore": false
          }
        ]
      }
    ]
  }
}

A backup

POST /backup/restore

Restore a Backup from File

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

Body parameters
file string Required

Name of the file to restore

nodeId string

Backup node whose identity to assume (set for a full restore)

ip string

Management IP for a full restore (admin-supplied, not from the backup)

mask integer

Management IP mask for a full restore

gateway string

Gateway for the management IP

interface string

Local interface to bind the management IP to

sections array

Names of sections to only restore (part restore; omit nodeId)

fipActive boolean default: "false"

Part restore only; full restore always disables FIPs

curl
curl -X POST "https://appliance.example.com/api/v1/backup/restore" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "file": "<file>",
  "nodeId": "<nodeId>",
  "ip": "<ip>",
  "mask": 0,
  "gateway": "<gateway>",
  "interface": "<interface>",
  "sections": [
    "<sections>"
  ],
  "fipActive": "false"
}'
PHP
<?php

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

$payload = [
    'file' => '<file>',
    'nodeId' => '<nodeId>',
    'ip' => '<ip>',
    'mask' => 0,
    'gateway' => '<gateway>',
    'interface' => '<interface>',
    'sections' => [
        '<sections>',
    ],
    'fipActive' => 'false',
];

$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 = {
    "file": "<file>",
    "nodeId": "<nodeId>",
    "ip": "<ip>",
    "mask": 0,
    "gateway": "<gateway>",
    "interface": "<interface>",
    "sections": [
        "<sections>"
    ],
    "fipActive": "false"
}

response = requests.post("https://appliance.example.com/api/v1/backup/restore", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/backup/restore', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "file": "<file>",
  "nodeId": "<nodeId>",
  "ip": "<ip>",
  "mask": 0,
  "gateway": "<gateway>",
  "interface": "<interface>",
  "sections": [
    "<sections>"
  ],
  "fipActive": "false"
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Backup Restored"
}

Upload a backup

POST /backup/upload

Upload a Backup from File

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

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

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

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

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "File uploaded: {filename}"
}

Delete every uploaded backup

DELETE /backup/uploads

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

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "Uploaded backup deleted"
}

Delete a backup

DELETE /backup/{filename}

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

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "Backup deleted"
}