查询沙盒组列表
GET https://sandbox.cn-sh-01.sensecoreapi.cn/studio/sandbox/v1/workspaces/{workspace_id}/sandboxGroups
请求头(Request Header)
请参考API 使用指南
请求参数(Request Parameters)
| 名称 | 类型 | 必须 | 位置 | 描述 |
|---|---|---|---|---|
| workspace_id | string | 是 | path | 工作空间id,获取方式可以参考快速开始 |
| filter | string | 否 | query | 过滤条件 |
| order_by | string | 否 | query | 排序,例:"create_time desc, name". |
| page_size | integer | 否 | query | 返回当前页的最大条目数. |
| page_token | string | 否 | query | 从上一个List请求返回的next_page_token值(如果有的话). |
请求示例(Request Example)
curl -L -X GET 'https://sandbox.cn-sh-01.sensecoreapi.cn/studio/sandbox/v1/workspaces/01993ca4-edfa-7382-8161-43a4919681ab/sandboxGroups' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
响应(Response)
异常情况请参考异常响应说明
| 名称 | 类型 | 描述 |
|---|---|---|
| sandbox_groups | array[object] | 已有的沙盒组列表 |
| next_page_token | string | 下一页的token. |
| total_size | integer | 沙盒组资源总数. |
其中,sandbox_groups中每个元素参数如下:
| 字段 | 类型 | 描述 |
|---|---|---|
| workspace_id | string | 工作空间ID |
| id | string | 沙盒组 ID |
| name | string | 沙盒组名称 |
| description | string | 沙盒组描述 |
| snapshot | object | 快照信息 |
| state | string | 沙盒实例创建进度: STATE_UPDATING(创建中), STATE_READY(创建结束) |
| volumes | array[object] | 挂载的存储,若未挂载存储,则不返回该字段 |
| environment | object | 环境变量(键值对),若未设置环境变量,则不返回该字段 |
| creator | string | 创建者 |
| updator | string | 更新者 |
| total_instance_count | integer | 沙盒组预期实例数量 |
| running_instance_count | integer | 正常运行中的实例数量 |
| create_time | string | 创建时间 |
| update_time | string | 更新时间 |
| auto_delete_after | integer | 自动删除时长,单位为秒,即从沙盒创建,存活设定时长后系统自动删除该沙盒。若为不自动删除,则不返回该字段 |
| auto_delete_at | string | 自动删除时间戳,若为不自动删除,则不返回该字段 |
其中,snapshot的参数如下:
| 名称 | 类型 | 描述 |
|---|---|---|
| workspace_id | string | 工作空间ID |
| id | string | 快照ID |
| name | string | 快照名称 |
| description | string | 快照描述,若为空,则不返回该字段 |
| image | object | 快照所用镜像信息 |
| resource_limits | object | 资源规格设置 |
| command | string | 启动命令 |
其中,image的参数如下:
| 名称 | 类型 | 描述 |
|---|---|---|
| id | string | 镜像ID |
| name | string | 镜像名称 |
| type | string | 镜像类型, IMAGE_TYPE_BUILT_IN为预置镜像 |
| description | string | 镜像描述,若为空,则不返回该字段 |
| repository | string | 镜像仓库地址 |
| create_time | string | 镜像创建时间 |
| update_time | string | 镜像更新时间 |
其中,resource_limits的参数如下:
| 名称 | 类型 | 描述 |
|---|---|---|
| cpu | integer | cpu核数,最小为1核 |
| memory | integer | 内存规格,单位GiB,最小为1GiB |
| storage | integer | 存储规格,单位GiB,最小为1GiB |
其中,volumes每个元素参数如下:
| 名称 | 类型 | 描述 |
|---|---|---|
| type | string | 卷类型,值可能为 VOLUME_TYPE_AFS(挂载文件存储), VOLUME_TYPE_AOSS(挂载对象存储) |
| afs | object | afs文件存储卷信息,当type为VOLUME_TYPE_AFS时不为空 |
| aoss | object | aoss存储桶信息,当type为VOLUME_TYPE_AOSS时不为空 |
其中,afs每个元素参数如下:
| 名称 | 类型 | 描述 |
|---|---|---|
| volume_id | string | 卷ID |
| source_path | string | NFS 源路径(主机端路径) |
| target_path | string | 容器内挂载路径(目标路径) |
其中,aoss每个元素参数如下:
| 名称 | 类型 | 描述 |
|---|---|---|
| bucket | string | 存储桶名称 |
| endpoint | string | 桶的Endpoint |
| access_key | string | 密钥ID |
| target_path | string | 沙盒内挂载路径 |
| mount_options | string | 挂载高级配置参数,若为空,则不返回该字段 |
响应示例(Response Example)
- 正常响应
{
"sandbox_groups": [
{
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "c9111309-2537-44e7-ad33-0fcb63755222",
"name": "test111",
"description": "www",
"snapshot": {
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "abb5331c-157b-42f1-928b-9d58a3271e5e",
"name": "4523",
"image": {
"id": "built_in_image_1",
"name": "vemlp-cn-beijing.cr.volces.com/preset-images/code-sandbox:server-20250609",
"type": "IMAGE_TYPE_BUILT_IN",
"create_time": "2025-09-12T06:24:36.918629Z",
"update_time": "2025-09-12T06:24:36.918629Z"
},
"resource_limits": {
"cpu": 1,
"memory": 3,
"storage": 4
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"create_time": "2025-10-10T02:53:27.711061Z",
"update_time": "2025-10-10T02:53:27.711061Z"
},
"state": "STATE_READY",
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"updator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"total_instance_count": 1,
"create_time": "2025-10-13T07:52:19.301472Z",
"update_time": "2025-10-13T08:04:45.314169Z",
"auto_delete_at": "2025-10-13T08:09:45.315634Z",
"running_instance_count": 1
},
{
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "5837aaee-c1c6-4293-beec-3b888a004caa",
"name": "233",
"description": "112",
"snapshot": {
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "abb5331c-157b-42f1-928b-9d58a3271e5e",
"name": "4523",
"image": {
"id": "built_in_image_1",
"name": "vemlp-cn-beijing.cr.volces.com/preset-images/code-sandbox:server-20250609",
"type": "IMAGE_TYPE_BUILT_IN",
"create_time": "2025-09-12T06:24:36.918629Z",
"update_time": "2025-09-12T06:24:36.918629Z"
},
"resource_limits": {
"cpu": 1,
"memory": 3,
"storage": 4
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"create_time": "2025-10-10T02:53:27.711061Z",
"update_time": "2025-10-10T02:53:27.711061Z"
},
"state": "STATE_READY",
"environment": {
"sdfdsgdg": "232312"
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"updator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"total_instance_count": 1,
"create_time": "2025-10-13T07:51:32.415639Z",
"update_time": "2025-10-13T07:51:35.746015Z",
"running_instance_count": 1
},
{
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "aa60f65e-ea66-4100-86b7-efb2fb77d9d3",
"name": "lzmtest",
"description": "test",
"snapshot": {
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "5e3de167-9206-4fae-85e9-8456c8912877",
"name": "lzm_test_1",
"image": {
"id": "built_in_image_1",
"name": "vemlp-cn-beijing.cr.volces.com/preset-images/code-sandbox:server-20250609",
"type": "IMAGE_TYPE_BUILT_IN",
"create_time": "2025-09-12T06:24:36.918629Z",
"update_time": "2025-09-12T06:24:36.918629Z"
},
"resource_limits": {
"cpu": 1,
"memory": 1,
"storage": 1
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"create_time": "2025-09-12T06:38:01.099985Z",
"update_time": "2025-09-12T06:38:01.099985Z"
},
"state": "STATE_READY",
"environment": {
"pythonenv1": "test"
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"updator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"total_instance_count": 2,
"create_time": "2025-10-13T07:38:05.759991Z",
"update_time": "2025-10-13T07:39:53.677478Z",
"auto_delete_at": "2025-10-13T12:39:53.678893Z"
},
{
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "bac38990-88e7-408a-8072-3460c28d882e",
"name": "test3333",
"description": "3444",
"snapshot": {
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "abb5331c-157b-42f1-928b-9d58a3271e5e",
"name": "4523",
"image": {
"id": "built_in_image_1",
"name": "vemlp-cn-beijing.cr.volces.com/preset-images/code-sandbox:server-20250609",
"type": "IMAGE_TYPE_BUILT_IN",
"create_time": "2025-09-12T06:24:36.918629Z",
"update_time": "2025-09-12T06:24:36.918629Z"
},
"resource_limits": {
"cpu": 1,
"memory": 3,
"storage": 4
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"create_time": "2025-10-10T02:53:27.711061Z",
"update_time": "2025-10-10T02:53:27.711061Z"
},
"state": "STATE_READY",
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"updator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"total_instance_count": 1,
"create_time": "2025-10-13T03:25:18.141177Z",
"update_time": "2025-10-13T07:12:34.352733Z",
"auto_delete_at": "2025-10-14T03:45:34.354009Z",
"running_instance_count": 1
},
{
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "535ea435-57ab-49aa-be2d-9092fa23448c",
"name": "12",
"snapshot": {
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "2665cba7-4791-47be-96e6-98c53092b47e",
"name": "22222222222222222222222222222222222222222222223fdfgdgfgfgfgggggg",
"image": {
"id": "built_in_image_1",
"name": "vemlp-cn-beijing.cr.volces.com/preset-images/code-sandbox:server-20250609",
"type": "IMAGE_TYPE_BUILT_IN",
"create_time": "2025-09-12T06:24:36.918629Z",
"update_time": "2025-09-12T06:24:36.918629Z"
},
"resource_limits": {
"cpu": 3,
"memory": 4,
"storage": 3
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"create_time": "2025-09-29T08:00:39.454426Z",
"update_time": "2025-09-29T08:00:39.454426Z"
},
"state": "STATE_READY",
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"updator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"total_instance_count": 1,
"create_time": "2025-10-13T03:12:17.034703Z",
"update_time": "2025-10-13T03:12:22.399791Z",
"auto_delete_at": "2025-10-14T03:12:22.399679Z",
"running_instance_count": 1
},
{
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "0cdf436b-9665-4321-801c-da848c4bc325",
"name": "122",
"description": "23",
"snapshot": {
"workspace_id": "01993ca4-edfa-7382-8161-43a4919681ab",
"id": "3a843cf4-ffbc-4003-945c-53a425d5c974",
"name": "234",
"image": {
"id": "built_in_image_1",
"name": "vemlp-cn-beijing.cr.volces.com/preset-images/code-sandbox:server-20250609",
"type": "IMAGE_TYPE_BUILT_IN",
"create_time": "2025-09-12T06:24:36.918629Z",
"update_time": "2025-09-12T06:24:36.918629Z"
},
"resource_limits": {
"cpu": 2,
"memory": 1,
"storage": 3
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"create_time": "2025-09-29T07:29:14.494602Z",
"update_time": "2025-09-29T07:29:14.494602Z"
},
"state": "STATE_READY",
"environment": {
"fadsa": "12"
},
"creator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"updator": "f97e5bc3-fbc4-4b9a-8d4b-7207bd4e3e1e",
"total_instance_count": 1,
"create_time": "2025-10-09T02:45:55.334259Z",
"update_time": "2025-10-10T03:25:41.089025Z",
"auto_delete_at": "2047-12-11T02:28:19.023860Z"
}
],
"total_size": 6
}