查看可用 Worker 镜像¶
列出创建或更新计算实例时可选择的 Worker 镜像。
GET https://api.moi.matrixorigin.cn/v5/compute-resources/worker-images
调用前准备¶
准备有目标工作区访问权限的个人访问令牌和目标工作区 ID。
请求参数¶
curl "https://api.moi.matrixorigin.cn/v5/compute-resources/worker-images?worker_type=python-worker" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
字段 |
类型 |
必填 |
说明 |
|---|---|---|---|
|
string |
否 |
按 Worker 类型筛选。 |
|
string |
否 |
按镜像键筛选。 |
成功响应¶
{
"code": "OK",
"msg": "OK",
"data": [
{
"id": "python-worker:v1",
"worker_type": "python-worker",
"image_key": "python-worker",
"type": "python-worker",
"platform": "linux/amd64",
"is_default": true,
"status": "active"
}
]
}
字段 |
类型 |
说明 |
|---|---|---|
|
string |
成功时为 |
|
string |
成功时为 |
|
array of object |
可用镜像数组。 |
下面表格展开响应示例中 data 数组的每一项;每一行是该数组项的一个字段。
字段 |
类型 |
说明 |
|---|---|---|
|
string |
镜像 ID,创建或更新时作为 |
|
string |
创建或更新时作为 |
|
string |
镜像的规范键;与 |
|
string |
镜像键;与 |
|
string |
镜像标签。 |
|
string |
镜像仓库。 |
|
string |
创建或更新时作为 |
|
string |
镜像说明;有值时返回。 |
|
boolean |
是否为该 Worker 类型的默认镜像。 |
|
string |
镜像当前状态。 |
|
string |
注册时间;有值时返回。 |
|
string |
最后更新时间;有值时返回。 |
错误响应¶
{
"code": "LIST_IMAGES_FAILED",
"msg": "服务端错误",
"data": null
}
字段 |
类型 |
说明 |
|---|---|---|
|
string |
错误代码。 |
|
string |
错误说明。 |
|
null |
错误时为空。 |
后续操作¶
将 id、worker_type 和 platform 组合到 worker_images,再创建计算实例。
最后更新于