OpenAPI Türkçe gyrohosting.com ↗

Snapshots and backups

Point-in-time images of a server disk. Snapshot space is an add-on quota in GB.

#GET/cloud/servers/{id}/snapshots

List snapshots and the snapshot quotaScope: cloud_readlistSnapshotsOpenAPI for this operation

Billing (tr-ist-1, prepaid): the first snapshot is free; every additional snapshot is its own hourly item and is billed at least 1 hour, even if it is deleted within minutes (the oldest snapshot counts as the free one). tr-ist-1: quota = number of snapshots allowed on the plan (add-on), snapshot ids are stable numbers derived by the API. Prepaid tr-ist-1 servers also return pricing {billing, free, extra_monthly_eur, extra_hourly_eur, billable}: the first snapshot(s) are free, each extra snapshot is charged hourly from the balance while it exists. 2.14.0 (Gyro Compute): snapshot ids are the platform's own ids; name is returned too.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

200Snapshots — data: object
404Not found — also returned for objects owned by someone else

Examples

curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server snapshot list 12345
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#POST/cloud/servers/{id}/snapshots

Take a snapshotScope: cloud_writecreateSnapshotOpenAPI for this operation

Billing (tr-ist-1, prepaid): the first snapshot is free; every additional snapshot is its own hourly item and is billed at least 1 hour, even if it is deleted within minutes (the oldest snapshot counts as the free one).

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

202Snapshot is being created (poll the list until status is available) — data: object
404Not found — also returned for objects owned by someone else
409State conflict (server_locked, not_actionable, ssh_key_exists, server_limit, idempotency_in_flight)
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server snapshot create 12345
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#POST/cloud/servers/{id}/snapshots/{sid}/restore

Restore a snapshot onto the server (overwrites the disk)Scope: cloud_writerestoreSnapshotOpenAPI for this operation

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)
sid requiredpathinteger

Request body

FieldTypeDescription
confirm requiredboolean = true

Responses

202Accepted
404Not found — also returned for objects owned by someone else
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots/123/restore' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
gyro server snapshot restore 12345 --help    # all flags
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots/123/restore", headers=h, json={"confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots/123/restore", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#DELETE/cloud/servers/{id}/snapshots/{sid}

Delete a snapshotScope: cloud_writedeleteSnapshotOpenAPI for this operation

Billing (tr-ist-1, prepaid): the first snapshot is free; every additional snapshot is its own hourly item and is billed at least 1 hour, even if it is deleted within minutes (the oldest snapshot counts as the free one).

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)
sid requiredpathinteger

Responses

202Accepted
404Not found — also returned for objects owned by someone else

Examples

curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots/123' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server snapshot delete 12345
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots/123", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/snapshots/123", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#GET/cloud/servers/{id}/backups

List automatic backupsScope: cloud_readlistBackupsOpenAPI for this operation

tr-ist-1: always enabled: false.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

200Backups (enabled=false when the backup add-on is not active) — data: object
404Not found — also returned for objects owned by someone else

Examples

curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/backups' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server backup list 12345
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/backups", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/backups", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#POST/cloud/servers/{id}/backups

Take a manual backup (backup add-on required)Scope: cloud_writecreateBackupOpenAPI for this operation

Not available in tr-ist-1 (422 not_supported_in_region; use snapshots).

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

202Accepted
404Not found — also returned for objects owned by someone else
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/backups' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server backup create 12345
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/backups", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/backups", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);