Skip to content

Get an NFS snapshot by ID

client.Nfs.Snapshots.Get(ctx, nfsSnapshotID, query) (*NfSnapshotGetResponse, error)
get/v2/nfs/snapshots/{nfs_snapshot_id}

To get an NFS snapshot, send a GET request to /v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}.

A successful request will return the NFS snapshot.

ParametersExpand Collapse
nfsSnapshotID string
query NfSnapshotGetParams
Region param.Field[string]optional

The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.

ReturnsExpand Collapse
type NfSnapshotGetResponse struct{…}
Snapshot NfSnapshotGetResponseSnapshotoptional

Represents an NFS snapshot.

ID string

The unique identifier of the snapshot.

CreatedAt Time

The timestamp when the snapshot was created.

formatdate-time
Name string

The human-readable name of the snapshot.

Region string

The DigitalOcean region slug where the snapshot is located.

ShareID string

The unique identifier of the share from which this snapshot was created.

formatuuid
SizeGib int64

The size of the snapshot in GiB.

formatuint64
Status NfSnapshotGetResponseSnapshotStatus

The current status of the snapshot.

Accepts one of the following:
const NfSnapshotGetResponseSnapshotStatusUnknown NfSnapshotGetResponseSnapshotStatus = "UNKNOWN"
const NfSnapshotGetResponseSnapshotStatusCreating NfSnapshotGetResponseSnapshotStatus = "CREATING"
const NfSnapshotGetResponseSnapshotStatusActive NfSnapshotGetResponseSnapshotStatus = "ACTIVE"
const NfSnapshotGetResponseSnapshotStatusFailed NfSnapshotGetResponseSnapshotStatus = "FAILED"
const NfSnapshotGetResponseSnapshotStatusDeleted NfSnapshotGetResponseSnapshotStatus = "DELETED"
Get an NFS snapshot by ID
package main

import (
  "context"
  "fmt"

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

func main() {
  client := gradient.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  snapshot, err := client.Nfs.Snapshots.Get(
    context.TODO(),
    "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
    gradient.NfSnapshotGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", snapshot.Snapshot)
}
{
  "snapshot": {
    "id": "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
    "created_at": "2023-11-14T16:29:21Z",
    "name": "daily-backup",
    "region": "atl1",
    "share_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
    "size_gib": 1024,
    "status": "CREATING"
  }
}
Returns Examples
{
  "snapshot": {
    "id": "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
    "created_at": "2023-11-14T16:29:21Z",
    "name": "daily-backup",
    "region": "atl1",
    "share_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
    "size_gib": 1024,
    "status": "CREATING"
  }
}