沙箱
列出沙箱
分页列出你当前运行中的沙箱,可按状态筛选。
GET
/sandbox/v1/sandboxes● 支持请求参数
metadatastring可选query: Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod"). Each key and values must be URL encoded.
statearray可选query: live:运行中;exited:已退出;all:全部保留记录。默认 live。
orderstring可选query: Sort direction by sandbox start time. Defaults to desc (newest first).
startedAfterstring可选query: Return sandboxes started at or after this timestamp.
templatestring可选query: Filter sandboxes by a template ID or alias.
nextTokenstring可选query: Cursor to start the list from
limitinteger可选query: Maximum number of items to return per page
namestring可选query: 按名称子串搜索,不区分大小写;中文、%、_ 和反斜杠按原样匹配。去除首尾空白后须为 1–64 个字符。可与状态及分页参数组合;历史空名称不匹配。
返回
200
错误按 E2B 格式返回,参见 错误码
响应
HTTP 200
Successfully returned all running sandboxes
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].templateID | string | Identifier of the template from which is the sandbox created |
| [].alias | string | Alias of the template |
| [].sandboxID | string | Identifier of the sandbox |
| [].clientID | string | Identifier of the client |
| [].startedAt | string | Time when the sandbox was started |
| [].endAt | string | Time when the sandbox will expire |
| [].cpuCount | integer | CPU cores for the sandbox |
| [].memoryMB | integer | Memory for the sandbox in MiB |
| [].diskSizeMB | integer | Disk size for the sandbox in MiB |
| [].metadata | any | Your own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes. |
| [].state | string | State of the sandbox |
| [].envdVersion | string | Version of the envd running in the sandbox |
| [].volumeMounts | array<object> | Volumes mounted into the sandbox. |
| [].volumeMounts[].name | string | Name of the volume |
| [].volumeMounts[].path | string | Path of the volume |