Filesystem snapshots
Filesystem snapshots
curl
curl -X GET "https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots';
$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}/lvmsnapshots", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Bruno
meta {
name: Get the filesystem snapshot details
type: http
seq: 1
}
get {
url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/lvmsnapshots
body: none
auth: bearer
}
auth:bearer {
token: {{token}}
}
Response
{
"status": "success",
"message": "LVM Snapshot",
"data": {
"created": "2021-03-02 11:04:32 +0000",
"status": "available",
"size": "500.00 MiB",
"used": "0.02 %"
}
}
curl
curl -X POST "https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots';
$headers = [
'Authorization: Bearer ' . $token,
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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.post("https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots', {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Bruno
meta {
name: Create a filesystem snapshot
type: http
seq: 1
}
post {
url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/lvmsnapshots
body: none
auth: bearer
}
auth:bearer {
token: {{token}}
}
Response
{
"status": "success",
"message": "LVM Snapshot created"
}
curl
curl -X PUT "https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"reboot": "true"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'reboot' => 'true',
];
$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 = {
"reboot": "true"
}
response = requests.put("https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"reboot": "true"
}),
});
const data = await response.json();
Bruno
meta {
name: Restore the filesystem snapshot
type: http
seq: 1
}
put {
url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/lvmsnapshots
body: json
auth: bearer
}
headers {
Content-Type: application/json
}
auth:bearer {
token: {{token}}
}
body:json {
{
"reboot": "true"
}
}
Response
{
"status": "success",
"message": "success",
"data": []
}
curl
curl -X DELETE "https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots';
$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}/lvmsnapshots", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/lvmsnapshots', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Bruno
meta {
name: Delete the filesystem snapshot
type: http
seq: 1
}
delete {
url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/lvmsnapshots
body: none
auth: bearer
}
auth:bearer {
token: {{token}}
}
Response
{
"status": "success",
"message": "LVM Snapshot deleted"
}