Skip to content

Delete a Snapshot

client.GPUDroplets.Snapshots.Delete(ctx, snapshotID) error
delete/v2/snapshots/{snapshot_id}

Both Droplet and volume snapshots are managed through the /v2/snapshots/ endpoint. To delete a snapshot, send a DELETE request to /v2/snapshots/$SNAPSHOT_ID.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

ParametersExpand Collapse

The ID of a Droplet snapshot.

Accepts one of the following:
UnionInt
UnionString
Delete a Snapshot
package main

import (
  "context"

  "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"),
  )
  err := client.GPUDroplets.Snapshots.Delete(context.TODO(), shared.UnionInt(int64(6372321)))
  if err != nil {
    panic(err.Error())
  }
}
Returns Examples