Skip to content

Snapshots

This saves the files of the stopped sandbox web as a snapshot, then creates a new sandbox from it:

Terminal window
curl --unix-socket /var/lib/shard/shard.sock -X POST -H 'Content-Type: application/json' -d '{"sandbox":"web","name":"web-base"}' http://localhost/v0/snapshots
curl --unix-socket /var/lib/shard/shard.sock -X POST -H 'Content-Type: application/json' -d '{"snapshot":"web-base","name":"web-3","resources":{"memory_mib":512}}' http://localhost/v0/sandboxes

To create a sandbox from a snapshot, use the create route in Sandboxes.

Each route answers an error with the Error body, unless its responses say otherwise.

POST /v0/snapshots · scope sandbox:write

Request body

SnapshotRequest as application/json, required.

Responses

Status Body
201 Snapshot as application/json

GET /v0/snapshots · scope sandbox:read

Parameters

Name In Type Required Description
limit query integer (int64) no The most items on a page; absent returns the whole list. At least 1.
cursor query string no The next value of the previous page; this page starts after it.

Responses

Status Body
200 SnapshotsResponse as application/json

GET /v0/snapshots/{ref} · scope sandbox:read

Parameters

Name In Type Required Description
ref path string yes The snapshot id or name.

Responses

Status Body
200 Snapshot as application/json

DELETE /v0/snapshots/{ref} · scope sandbox:delete

Parameters

Name In Type Required Description
ref path string yes The snapshot id or name.

Responses

Status Body
204 none
Field Type Required Description
created_at string (date-time) yes
digest string yes
disk_mib integer (int64) yes
id string yes
image string yes
memory_mib integer (int64) yes
name string no
provider string yes
size integer (int64) yes The bytes the snapshot takes on the host disk; not disk_mib and not the logical size of its files.
source string yes
source_name string no
Field Type Required Description
name string no
sandbox string yes At least 1 character.
Field Type Required
next string or null yes
snapshots array of Snapshot yes