# Snapshot (/docs/go-sdk/snapshot)

> For AI agents: the complete documentation index is at https://www.daytona.com/llms.txt.

## Snapshots [#snapshots]

```go
type Snapshots struct {
	// contains filtered or unexported fields
}
```

Snapshots manages saved sandbox memory and disk. Obtain it with
Client.Snapshots. Its methods are safe for concurrent use.

#### Snapshots.Delete [#snapshotsdelete]

```go
func (s *Snapshots) Delete(ctx context.Context, id string) error
```

Delete deletes a snapshot by ID or name. Missing snapshots return ErrNotFound.

#### Snapshots.Get [#snapshotsget]

```go
func (s *Snapshots) Get(ctx context.Context, id string, opts *GetArtifactOptions) (*Snapshot, error)
```

Get reads a snapshot by ID or name. "search" must be read by ID instead.
A failed/error snapshot is returned for inspection, even when waiting.

#### Snapshots.List [#snapshotslist]

```go
func (s *Snapshots) List(ctx context.Context, opts *ListSnapshotsOptions) (*Page[Snapshot], error)
```

List returns one page of snapshot values, preferring eventually consistent
search and falling back only on 404 or SEARCH_NOT_CONFIGURED.

#### Snapshots.ListAll [#snapshotslistall]

```go
func (s *Snapshots) ListAll(ctx context.Context, opts *ListSnapshotsOptions) iter.Seq2[Snapshot, error]
```

ListAll lazily visits snapshot pages until exhaustion, a repeated cursor,
an error, cancellation or an early consumer break.

## ListSnapshotsOptions [#listsnapshotsoptions]

```go
type ListSnapshotsOptions struct {
	// Cursor is the opaque continuation cursor.
	Cursor string
	// Limit is 1–200; zero uses the server default.
	Limit int
	// Name filters by snapshot name.
	Name string
	// SandboxID filters by the captured sandbox.
	SandboxID string
}
```

ListSnapshotsOptions filters one snapshot page. Zero values use defaults.

## Snapshot [#snapshot]

```go
type Snapshot struct {
	// ID is the stable snapshot identifier.
	ID string
	// Name is the snapshot name.
	Name string
	// Class is the normalized sandbox class.
	Class SnapshotClass
	// RawClass preserves the server class.
	RawClass string
	// Kind is the snapshot format.
	Kind SnapshotKind
	// RawKind preserves the server kind.
	RawKind string
	// AvailableIn lists regions where the snapshot is available.
	AvailableIn []string
	// Region is the snapshot's home region.
	Region string
	// Status is its normalized readiness status.
	Status SnapshotStatus
	// RawStatus preserves the server status.
	RawStatus string
	// Error is the recorded failure.
	Error string
	// CreatedAt is the creation time.
	CreatedAt time.Time
	// UpdatedAt is the last update time.
	UpdatedAt time.Time
	// Bytes is the disk size, or nil when unreported.
	Bytes *int64
	// MemoryBytes is the saved memory size, or nil when unreported.
	MemoryBytes *int64
	// SandboxID identifies the captured sandbox, when reported.
	SandboxID string
}
```

Snapshot is a caller-owned observation of a saved sandbox's memory and disk.

## SnapshotClass [#snapshotclass]

```go
type SnapshotClass string
```

SnapshotClass identifies a snapshot's operating-system class.

```go
const (
	// SnapshotClassUnknown identifies a future class.
	SnapshotClassUnknown SnapshotClass = "unknown"
	// SnapshotClassLinux identifies Linux snapshots.
	SnapshotClassLinux SnapshotClass = "linux"
)
```

## SnapshotKind [#snapshotkind]

```go
type SnapshotKind string
```

SnapshotKind describes the captured state.

```go
const (
	// SnapshotKindUnknown identifies a future kind.
	SnapshotKindUnknown SnapshotKind = "unknown"
	// SnapshotKindFull captures memory and disk.
	SnapshotKindFull SnapshotKind = "full"
)
```

## SnapshotStatus [#snapshotstatus]

```go
type SnapshotStatus string
```

SnapshotStatus identifies snapshot readiness.

```go
const (
	// SnapshotStatusUnknown identifies a future status.
	SnapshotStatusUnknown SnapshotStatus = "unknown"
	// SnapshotStatusPending means capture is queued.
	SnapshotStatusPending SnapshotStatus = "pending"
	// SnapshotStatusCreating means capture is in progress.
	SnapshotStatusCreating SnapshotStatus = "creating"
	// SnapshotStatusReady means the snapshot is usable.
	SnapshotStatusReady SnapshotStatus = "ready"
	// SnapshotStatusFailed means capture failed.
	SnapshotStatusFailed SnapshotStatus = "failed"
	// SnapshotStatusError is the alternative failure status.
	SnapshotStatusError SnapshotStatus = "error"
)
```
