注册自定义Runner

HTTP200表示记录及所有权创建完成;phase=pending不表示Edge已连上。取得connect_cmd后在目标主机执行,命令含凭据,不保存到共享日志。相同请求标识的有界重放不等于名称更新。

POST https://api.moi.matrixorigin.cn/v5/agent-runners/custom

调用前准备

BASE_URL 使用产品 API 前缀 https://api.moi.matrixorigin.cn/v5;专有部署填写对应的产品 API 地址。

准备身份和标识。

请求

curl --request POST \
  "$BASE_URL/agent-runners/custom" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "X-Request-ID: $REQUEST_ID" \
  --header "Content-Type: application/json" \
  --data @- <<JSON
{"name": "示例Runner"}
JSON

参数

位置

类型

必填

说明

X-Workspace-ID

请求头

string

是

同环境目标工作区;路径中没有工作区段。

name

请求体

string

是

非空Runner名称;同一工作区内名称不能重复。

X-Request-ID

请求头

string

条件

用于同一注册操作的请求关联/重放;来源经正式边界确认,改变注册任务时使用新值。

成功响应

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": "runner-example",
    "workspace_id": "workspace-example",
    "user_id": "user-example",
    "name": "示例Runner",
    "runner_type": "custom",
    "edge_agent_id": "runner-runner-example",
    "phase": "pending",
    "token_expires_at": "2026-12-12T01:00:00Z",
    "created_at": "2026-11-12T01:00:00Z",
    "updated_at": "2026-11-12T01:00:00Z",
    "connect_cmd": "astra-edge --edge-id runner-runner-example --server-url wss://edge.example.invalid --token example-edge-token --reconnect true"
  }
}

字段

类型

说明

code

string

成功为OK。

msg

string

响应信息,成功为OK。

data

object

返回对象与省略条件。

错误响应

错误与恢复边界区分Runner、Edge续期及计算观测;不共用同一数值错误表。

最后更新于