Skip to main content
See Snapshots for capture behavior and compatibility. Ruby does not expose sandbox restore, branching, or full-capture options.

SandboxHandle

handle.snapshot()

Capture a named snapshot using the selected backend’s default capture behavior. Local group members are immutable; choose a new name for each checkpoint.

Parameters

nameString
Snapshot name.

Returns

Hash
String keys: digest, reference, reference_kind, and size_bytes.

Snapshot

Microsandbox::Snapshot.open()

Open a snapshot using the selected backend.

Parameters

referenceString
Snapshot reference or name.

Returns

Snapshot
Open a snapshot using the selected backend.

Microsandbox::Snapshot.get()

Look up snapshot metadata using the selected backend.

Parameters

nameString
Snapshot reference or name.

Returns

SnapshotHandle
Look up snapshot metadata using the selected backend.

Microsandbox::Snapshot.list()

Returns

Array<SnapshotHandle>
List snapshots using the selected backend.

Microsandbox::Snapshot.remove()

Remove a snapshot using the selected backend.

Parameters

nameString
Snapshot reference or name.
forceBoolean
Force removal; optional positional argument, defaults to false.

Returns

nil
No return value.

Microsandbox::Snapshot.save()

Export a local snapshot archive. See snapshot exports for parent chains and incremental exports.

Parameters

referenceString
Snapshot reference.
output_pathString
Destination archive path on the host.
with_parentsBoolean
Include parent snapshots; defaults to false.
with_imageBoolean
Include the source image; defaults to false.
plain_tarBoolean
Write an uncompressed tar archive; defaults to false.
sinceString
Optional incremental export boundary; available only on this class method.
last_layersInteger
Optional number of most recent layers to export; available only on this class method.

Returns

nil
No return value.

snapshot.save_to()

Export through the backend retained by this snapshot. Archive export is local-only.

Parameters

output_pathString
Destination archive path on the host.
with_parentsBoolean
Include parent snapshots; defaults to false.
with_imageBoolean
Include the source image; defaults to false.
plain_tarBoolean
Write an uncompressed tar archive; defaults to false.

Returns

nil
No return value.

snapshot.digest

Returns

String
Snapshot digest.

snapshot.size_bytes

Returns

Integer | nil
Snapshot size.

snapshot.reference

Returns

String
Backend-specific reference.

snapshot.reference_kind

Returns

String
Kind of reference; preserve it with the value.

SnapshotHandle

handle.digest

Returns

String
Snapshot digest.

handle.size_bytes

Returns

Integer | nil
Snapshot size.

handle.reference

Returns

String
Backend-specific reference.

handle.reference_kind

Returns

String
Kind of reference; preserve it with the value.

handle.name

Returns

String | nil
Snapshot name.

handle.image_ref

Returns

String
Source image reference.

handle.state_kind

Returns

String
Captured state kind.

handle.open()

Returns

Snapshot
Open the snapshot through the retained backend.

handle.remove()

Remove the snapshot through the retained backend.

Parameters

forceBoolean
Whether to force removal. This positional argument is required.

Returns

nil
No return value.

handle.save_to()

Export through the backend retained by this handle. Archive export is local-only.

Parameters

output_pathString
Destination archive path on the host.
with_parentsBoolean
Include parent snapshots; defaults to false.
with_imageBoolean
Include the source image; defaults to false.
plain_tarBoolean
Write an uncompressed tar archive; defaults to false.

Returns

nil
No return value.