list_dir, reindex, save/save_to, load, and verify keep the same
API on every backend, but currently raise UnsupportedError in cloud.Take a snapshot
handle.snapshot()
Parameters
namestrReturns
Example
Example
Snapshot.create()
dest_dir, local
uses its default snapshot directory and cloud uses managed storage. A
dest_dir selects a local parent or cloud host-volume directory.
Parameters
namestrfrom_sandboxstrdest_dirstr | os.PathLike[str] | Nonelabelsdict[str, str] | NoneforceboolFalse.record_integrityboolFalse.resumablebool“resumable” snapshot (disk plus VM state). Accepted, but currently fails with an Unsupported error; resumable snapshots have not landed yet. Default False.Returns
Example
Example
Boot from a snapshot
Sandbox.create()
from_snapshot= as a peer of
image=. The two are mutually exclusive. Passing a Snapshot or
SnapshotHandle preserves its backend-relative reference automatically.
Parameters
namestrfrom_snapshotstr | os.PathLike | Snapshot | SnapshotHandle | Noneimage=.Returns
Example
Example
Manage artifacts
Snapshot.open()
Example
Example
verify() for content checks where supported.
Parameters
path_or_namestrReturns
Snapshot.get()
Example
Example
Parameters
name_or_digeststrReturns
Snapshot.list()
Example
Example
Returns
Snapshot.list_dir()
UnsupportedError.
Parameters
dirstr | os.PathLikeReturns
Snapshot.remove()
Example
Example
force=True.
Parameters
path_or_namestrforceboolFalse.Snapshot.reindex()
Example
Example
dir (default: configured snapshots dir) and rebuild the local index.
Returns the number of artifacts indexed. Cloud raises UnsupportedError.
Parameters
dirstr | os.PathLike | NoneReturns
Snapshot.save()
Example
Example
.tar.zst archive. The existing snapshot
manifest is archived as-is; create the snapshot with recorded integrity when
the archive will cross a trust boundary. Cloud raises UnsupportedError.
Parameters
name_or_pathstroutstr | os.PathLikewith_parentsboolFalse.with_imageboolFalse.plain_tarbool.tar instead of .tar.zst. Default False.Move artifacts
Snapshot.load()
.tar.zst or .tar) into the local snapshots
directory. Structural and archive-entry checks run during import; recorded
payload integrity is preserved for explicit verify().
Compression is detected from magic bytes. Cloud raises UnsupportedError.
Parameters
archivestr | os.PathLike.tar.zst or .tar).deststr | os.PathLike | NoneReturns
Example
Example
Inspect
snap.save_to()
UnsupportedError.
snap.verify()
Example
Example
not_recorded without reading payload contents when no integrity was stored. The cloud backend currently raises UnsupportedError.
Returns
upper.kind field is “not_recorded” when no integrity hash was stored, or “verified” with the recomputed digest.handle.open()
Example
Example
Snapshot metadata for this handle. Metadata-validated only; does not read the upper file.
Returns
handle.remove()
Example
Example
force=True.
Parameters
forceboolFalse.handle.save_to()
UnsupportedError.
Types
Snapshot
Returned by snapshot() · Snapshot.create() · Snapshot.open() · Snapshot.list_dir() · handle.open()
A fully parsed backend-neutral snapshot. Properties are read-only attributes.SnapshotHandle
Returned by Snapshot.get() · Snapshot.list() · Snapshot.load()
Lightweight handle returned by the active backend. Properties are read-only.SnapshotStateKind
Returned by Snapshot.state_kind · SnapshotHandle.state_kind
Snapshot state representation.SnapshotFormat
Returned by Snapshot.format · SnapshotHandle.format
On-disk format for file-backed snapshot state.SnapshotScope
Returned by Snapshot.scope · SnapshotHandle.scope
Captured snapshot state scope.