This feature is currently in private preview and is not recommended for production use.
Snapshot identity
A snapshot has aname that is unique in your workspace and that every operation addresses it by. Pick the name at creation time, or let Blaxel generate one:
Creating a snapshot with a name that is already taken in the workspace fails with a
409 error. Delete the existing snapshot first, or pick another name.
Create a snapshot
A snapshot always has a source. Pass the name of the object to capture assource, and a name if you want to choose it:
source.kind defaults to sandbox, the only kind of object you can capture today.Retrieve a snapshot
List snapshots
Listing at the workspace level returns every snapshot, including the ones whose source sandbox no longer exists.q parameter:
meta.nextCursor as cursor on the next request and repeat until meta.hasMore is false. For more information, refer to the API reference documentation.
To list only the snapshots captured from one sandbox, list from the sandbox instead:
Fork a snapshot into a new sandbox
A snapshot carries the image, the memory size, the ports, the infrastructure generation, the region, and the volumes of what it captured, so you can fork it into a new sandbox even after its source sandbox is deleted.targetType to application to start an application from the snapshot instead of a sandbox, and pass envs to give the fork a different environment. Both work the same way as when forking a sandbox.
When the source sandbox still exists, the fork also inherits what the snapshot does not carry, such as environment variables, lifecycle policies, and network configuration. When the source sandbox is gone, the fork runs with the configuration stored on the snapshot.
Restore a sandbox to a snapshot
Restoring rolls a running sandbox back to a snapshot in place, keeping its name, its URLs, and its previews. Refer to restoring a sandbox for the full behavior.Delete a snapshot
There is a single snapshot object, so deleting it removes it for the whole workspace. Deleting it from the sandbox it was captured from does the same thing.Snapshot lifecycle and sandbox deletion
Deleting a sandbox does not delete its snapshots. The snapshots stay in your workspace, keep their names, and stay usable. The only visible change is on the link back to the source, whosedeleted field becomes true:
Snapshots and forking for sandboxes
Snapshot, restore, and fork from the sandbox side.
Sandbox overview
Learn more about sandbox lifecycle and configuration.