Skip to main content

Snapshots

Snapshot Schema

  • id String - A unique identifier for each snapshot. This is automatically generated.
  • name String - The human-readable name for the snapshot.
  • size Integer - The storage size of this snapshot given in GiB.
  • region String - The identifier for the region this snapshot exists in (eg. NORD-NO-KRS-1).
  • status String - The snapshot status. Possible values are creating, created, pending_delete and deleting.
  • resource_id String - The id of the resource (e.g. instance) that was snapshotted.
  • created_at String - A time value given in ISO8601 combined date and time format that represents when the snapshot was created.

List Snapshots

Lists all snapshots of an account.

GET /compute/v1/snapshots (HTTP 200 - OK)

Query parameters

  • per_page Integer Optional - A positive integer lower than or equal to 100 to select the number of items to return (default: 50).
  • page Integer Optional - A positive integer to choose the page to return.

Response body

The response will be a JSON object with pagination details and a key called snapshots. This will be set to an array of snapshot objects, each of which will contain the instance snapshot object, see Snapshot Schema:

{
"snapshots": [
{
"id": "ff942497-62f6-4a9d-8dc4-3766ebc2b8a2",
"name": "snapshot name",
"size": 128,
"region": "NORD-NO-KRS-1",
"status": "created",
"resource_id": "<snapshotted-resource-id>",
"created_at": "2020-04-06T10:47:46.786Z"
}
],
"total_count": 1,
"page": 1,
"per_page": 50
}

Create Snapshot

To create a new snapshot from a custom image URL, send a request to:

POST /compute/v1/snapshots (HTTP 201 - Created)

Please note that if you intend to create a snapshot from a running instance, you should use the Instance Snapshots endpoint instead.

The attribute values that must be set to successfully create a snapshot are:

Body parameters:

  • name String Required - The human-readable name set for the snapshot.
  • size Integer Required - The storage size of the uncompressed image given in GiB (Min: 1GiB).
  • url String Required - The url pointing to a raw or raw with zstd compressed image.
  • os_type String Optional - linux or windows.
  • region String Required - The region identifier in which this instance should be created in, see Regions.

Response body

The response will be a JSON object that contains the snapshot attributes, see Snapshot Schema:

{
"snapshot": {
"id": "ff942497-62f6-4a9d-8dc4-3766ebc2b8a2",
"name": "snapshot name",
"status": "creating",
"os_type": "linux",
"region": "NORD-NO-KRS-1",
"resource_id": "",
"created_at": "2024-01-23T10:47:46.786Z"
"updated_at": "2024-01-23T10:47:46.786Z"
}
}

Get Snapshot

Get details of one snapshot with a given ID.

GET /compute/v1/snapshots/<snapshot_id> (HTTP 200 - OK)

Path parameters:

  • snapshot_id String - Snapshot id

Response body

The response will be a JSON object that contains the snapshot attributes, see Snapshot Schema:

{
"snapshot": {
"id": "ff942497-62f6-4a9d-8dc4-3766ebc2b8a2",
"name": "snapshot name",
"size": 128,
"region": "NORD-NO-KRS-1",
"status": "created",
"resource_id": "<snapshotted-resource-id>",
"created_at": "2020-04-06T10:47:46.786Z"
}
}

Delete a Snapshot

Delete a snapshot with the given ID

DELETE /compute/v1/snapshots/<snapshot_id>  (HTTP 204 - No content)

Path parameters:

  • snapshot_id String - Snapshot id

Examples (cURL)

# List all snapshots
curl -H "Authorization: Bearer $TOKEN" \
"https://api.genesiscloud.com/compute/v1/snapshots"
# Get a snapshot by id
curl -H "Authorization: Bearer $TOKEN" \
"https://api.genesiscloud.com/compute/v1/snapshots/<snapshot_id>"
# Delete a snapshot by id
curl -H "Authorization: Bearer $TOKEN" \
-X DELETE "https://api.genesiscloud.com/compute/v1/snapshots/<snapshot_id>"