Configuration snapshots

Database

GET /{applianceId}/snapshots/db

List all Snapshots DB

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}/snapshots/db" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "Database snapshots",
  "data": [
    {
      "id": "5f6-4b2-cf5-df6",
      "name": "snapshot1",
      "description": "None",
      "created": "None"
    }
  ]
}

POST /{applianceId}/snapshots/db

Create a new Snapshot DB

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
name string
description string
curl
curl -X POST "https://appliance.example.com/api/v1/{applianceId}/snapshots/db" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "description": "<description>"
}'
PHP
<?php

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

$payload = [
    'name' => '<name>',
    'description' => '<description>',
];

$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>",
    "description": "<description>"
}

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "Database snapshot created",
  "data": {
    "id": "5f6-338-a3a-61d"
  }
}

DELETE /{applianceId}/snapshots/db

Delete all Snapshots DB

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 DELETE "https://appliance.example.com/api/v1/{applianceId}/snapshots/db" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

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

Database by ID

PUT /{applianceId}/snapshots/db/{id}

Restore a Snapshot DB by Name

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.

id string Required

The id of the db.

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "Database snapshot restored"
}

DELETE /{applianceId}/snapshots/db/{id}

Delete a Snapshot DB

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.

id string Required

The id of the db.

curl
curl -X DELETE "https://appliance.example.com/api/v1/{applianceId}/snapshots/db/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

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