查看 Worker 运行状态

查询计算实例按 Worker 类型划分的运行时副本状态。

GET https://moi.matrixorigin.cn/newmoi/compute-resources/{resource_id}/runtime

调用前准备

查询计算实例详情,确认要查询的实例。准备有目标工作区访问权限的个人访问令牌、目标工作区 ID 和计算实例 ID。

请求参数

curl "https://moi.matrixorigin.cn/newmoi/compute-resources/$RESOURCE_ID/runtime" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

字段

类型

必填

说明

resource_id

string

计算实例 ID。

成功响应

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "runtimes": [
      {
        "compute_resource_id": "cr-001",
        "worker_type": "python-worker",
        "status": "ACTIVE",
        "desired_replicas": 1,
        "current_replicas": 1
      }
    ]
  }
}

字段

类型

说明

code

string

成功时为 OK

msg

string

成功时为 OK

data

object

Worker 运行时对象。

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

字段

类型

说明

runtimes

array of object

每种 Worker 的运行时记录。

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

字段

类型

说明

compute_resource_id

string

计算实例 ID。

worker_type

string

Worker 类型。

status

string

此 Worker 的运行状态。

desired_replicas

integer

目标副本数。

current_replicas

integer

当前副本数。

last_activation_at

string

最近一次激活时间;有值时返回。

last_active_at

string

最近一次活跃时间;有值时返回。

created_at

string

运行时记录创建时间。

updated_at

string

运行时记录最后更新时间。

错误响应

{
  "code": "NOT_FOUND",
  "msg": "计算资源不存在",
  "data": null
}

字段

类型

说明

code

string

错误代码。

msg

string

错误说明。

data

null

错误时为空。

后续操作

返回查询计算实例详情查看整体状态,或更新计算实例调整配置。

最后更新于