查看可用 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"

字段

类型

必填

说明

worker_type

string

按 Worker 类型筛选。

type

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"
    }
  ]
}

字段

类型

说明

code

string

成功时为 OK

msg

string

成功时为 OK

data

array of object

可用镜像数组。

下面表格展开响应示例中 data 数组的每一项;每一行是该数组项的一个字段。

字段

类型

说明

id

string

镜像 ID,创建或更新时作为 image_id 传入。

worker_type

string

创建或更新时作为 worker_type 传入。

image_key

string

镜像的规范键;与 type 对应。

type

string

镜像键;与 image_key 对应。

tag

string

镜像标签。

repository

string

镜像仓库。

platform

string

创建或更新时作为 platform 传入。

description

string

镜像说明;有值时返回。

is_default

boolean

是否为该 Worker 类型的默认镜像。

status

string

镜像当前状态。

registered_at

string

注册时间;有值时返回。

updated_at

string

最后更新时间;有值时返回。

错误响应

{
  "code": "LIST_IMAGES_FAILED",
  "msg": "服务端错误",
  "data": null
}

字段

类型

说明

code

string

错误代码。

msg

string

错误说明。

data

null

错误时为空。

后续操作

idworker_typeplatform 组合到 worker_images,再创建计算实例

最后更新于