查询可用 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",
      "tag": "",
      "repository": "",
      "description": "",
      "registered_at": "2026-10-14T00:00:00Z",
      "updated_at": "2026-10-14T00:00:00Z"
    }
  ]
}

字段

类型

说明

code

string

成功代码。

msg

string

响应信息。

data

object(对象数组)

本次操作返回的数据。

data[].id

string

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

data[].worker_type

string

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

data[].image_key

string

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

data[].type

string

镜像键。与 image_key 对应。

data[].tag

string

镜像标签。

data[].repository

string

镜像仓库。

data[].platform

string

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

data[].description

string

镜像说明。

data[].is_default

boolean

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

data[].status

string

镜像当前状态。取值为 active、inactive

data[].registered_at

string

注册时间。采用 RFC 3339 格式。

data[].updated_at

string

最后更新时间。采用 RFC 3339 格式。

错误响应

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

字段

类型

说明

code

string

错误代码。

msg

string

错误说明。

data

null

错误时为空。

常见 HTTP 错误

HTTP 状态码

错误代码

常见原因

建议操作

400

INVALID_PARAMS

请求字段、工作区或操作前置条件无效。

修正参数后再提交。

401

Unauthorized

认证凭据缺失或无效。

检查凭据类型、有效期及认证头。

500

LIST_IMAGES_FAILED

内部处理失败;写操作可能已有部分效果。

保留请求和追踪信息,先核对当前结果。

最后更新于