Snapshots
This saves the files of the stopped sandbox web as a snapshot, then creates a new sandbox from it:
curl --unix-socket /var/lib/shard/shard.sock -X POST -H 'Content-Type: application/json' -d '{"sandbox":"web","name":"web-base"}' http://localhost/v0/snapshotscurl --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/sandboxesTo 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.
Snapshot a sandbox
Section titled “Snapshot a sandbox”POST /v0/snapshots · scope sandbox:write
Request body
SnapshotRequest as application/json, required.
Responses
| Status | Body |
|---|---|
| 201 | Snapshot as application/json |
List snapshots
Section titled “List snapshots”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 |
Read a snapshot
Section titled “Read a snapshot”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 |
Remove a snapshot
Section titled “Remove a snapshot”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 |
Objects
Section titled “Objects”Snapshot
Section titled “Snapshot”| 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 |
SnapshotRequest
Section titled “SnapshotRequest”| Field | Type | Required | Description |
|---|---|---|---|
name |
string | no | |
sandbox |
string | yes | At least 1 character. |
SnapshotsResponse
Section titled “SnapshotsResponse”| Field | Type | Required |
|---|---|---|
next |
string or null | yes |
snapshots |
array of Snapshot | yes |