Skip to content
  • Auto
  • Light
  • Dark

Retrieve

Retrieve an Existing Snapshot
gpu_droplets.snapshots.retrieve(Union[int, str]snapshot_id) -> SnapshotRetrieveResponse
get/v2/snapshots/{snapshot_id}

To retrieve information about a snapshot, send a GET request to /v2/snapshots/$SNAPSHOT_ID.

The response will be a JSON object with a key called snapshot. The value of this will be an snapshot object containing the standard snapshot attributes.

ParametersExpand Collapse
snapshot_id: Union[int, str]

The ID of a Droplet snapshot.

Accepts one of the following:
SnapshotIDUnionMember0 = int

The ID of a Droplet snapshot.

SnapshotIDUnionMember1 = str

The ID of a volume snapshot.

ReturnsExpand Collapse
class SnapshotRetrieveResponse:
snapshot: Optional[Snapshots]
id: str

The unique identifier for the snapshot.

created_at: datetime

A time value given in ISO8601 combined date and time format that represents when the snapshot was created.

formatdate-time
min_disk_size: int

The minimum size in GB required for a volume or Droplet to use this snapshot.

name: str

A human-readable name for the snapshot.

regions: List[str]

An array of the regions that the snapshot is available in. The regions are represented by their identifying slug values.

resource_id: str

The unique identifier for the resource that the snapshot originated from.

resource_type: Literal["droplet", "volume"]

The type of resource that the snapshot originated from.

Accepts one of the following:
"droplet"
"volume"
size_gigabytes: float

The billable size of the snapshot in gigabytes.

formatfloat
tags: Optional[List[str]]

An array of Tags the snapshot has been tagged with.

Requires tag:read scope.

Retrieve an Existing Snapshot
from gradient import Gradient

client = Gradient(
    access_token="My Access Token",
)
snapshot = client.gpu_droplets.snapshots.retrieve(
    6372321,
)
print(snapshot.snapshot)
{
  "snapshot": {
    "id": "6372321",
    "created_at": "2020-07-28T16:47:44Z",
    "min_disk_size": 25,
    "name": "web-01-1595954862243",
    "regions": [
      "nyc3",
      "sfo3"
    ],
    "resource_id": "200776916",
    "resource_type": "droplet",
    "size_gigabytes": 2.34,
    "tags": [
      "web",
      "env:prod"
    ]
  }
}
Returns Examples
{
  "snapshot": {
    "id": "6372321",
    "created_at": "2020-07-28T16:47:44Z",
    "min_disk_size": 25,
    "name": "web-01-1595954862243",
    "regions": [
      "nyc3",
      "sfo3"
    ],
    "resource_id": "200776916",
    "resource_type": "droplet",
    "size_gigabytes": 2.34,
    "tags": [
      "web",
      "env:prod"
    ]
  }
}