Skip to content

Retrieve an Existing Snapshot

client.GPUDroplets.Snapshots.Get(ctx, snapshotID) (*GPUDropletSnapshotGetResponse, error)
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

The ID of a Droplet snapshot.

Accepts one of the following:
UnionInt
UnionString
ReturnsExpand Collapse
type GPUDropletSnapshotGetResponse struct{…}
Snapshot Snapshotsoptional
ID string

The unique identifier for the snapshot.

CreatedAt Time

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

formatdate-time
MinDiskSize int64

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

Name string

A human-readable name for the snapshot.

Regions []string

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

ResourceID string

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

ResourceType SnapshotsResourceType

The type of resource that the snapshot originated from.

Accepts one of the following:
const SnapshotsResourceTypeDroplet SnapshotsResourceType = "droplet"
const SnapshotsResourceTypeVolume SnapshotsResourceType = "volume"
SizeGigabytes float64

The billable size of the snapshot in gigabytes.

formatfloat
Tags []string

An array of Tags the snapshot has been tagged with.

Requires tag:read scope.

Retrieve an Existing Snapshot
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
  "github.com/stainless-sdks/-go/shared"
)

func main() {
  client := gradient.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  snapshot, err := client.GPUDroplets.Snapshots.Get(context.TODO(), shared.UnionInt(int64(6372321)))
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
    ]
  }
}