手动触发一次

更新时间:
复制 MD 格式

手动触发一次 Deployment 运行。

路径参数

参数

类型

说明

id

string

Deployment ID(dep_ 前缀)

请求头

头部

必选

说明

Authorization

Bearer <PAT>

Content-Type

application/json

请求体

无需请求体。可发送空 JSON {} 或省略。

示例请求

curl -X POST "https://api.qoder.com.cn/api/v1/cloud/deployments/dep_019ec55a2b687b3f94eee77dd77e4b2a/run" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json"

示例响应

HTTP 200 OK

返回 Deployment Run 对象。

{
  "agent": {
    "id": "agent_019ebb21ef8e7df6a559052c94875160",
    "type": "agent",
    "version": 1
  },
  "cas_run_extras": {
    "attempt": 1,
    "started_at": "2026-06-14T08:58:17.165588936Z",
    "turn_id": "turn_019ec55a68b87a9dafad75c1554d1102"
  },
  "created_at": "2026-06-14T08:58:17.133340942Z",
  "deployment_id": "dep_019ec55a2b687b3f94eee77dd77e4b2a",
  "error": null,
  "id": "drun_019ec55a68af73028afa5b87931cb2f3",
  "session_id": "sess_019ec55a68b37e1e8d660691af161ab4",
  "status": "running",
  "trigger_context": {
    "type": "manual"
  },
  "triggered_at": "2026-06-14T08:58:17.133340942Z",
  "type": "deployment_run"
}

响应字段(Deployment Run)

字段

类型

说明

id

string

Run 唯一标识(drun_ 前缀)

type

string

固定值 "deployment_run"

deployment_id

string

所属 Deployment ID

agent

object

Agent 引用:{id, type, version}

status

string

运行状态:pendingrunningcompletedfailedskipped

error

object 或 null

失败时的错误详情({message, type}),成功时为 null

trigger_context

object

触发来源:{"type": "manual"}{"type": "schedule"}{"type": "retry"}

session_id

string

关联的 Session ID(session 创建后出现)

completed_at

string

完成时间(ISO 8601,终态时出现)

duration_ms

integer

运行时长(毫秒,completed 时出现)

cas_run_extras

object

CAS 特有元数据:attemptturn_idstarted_at

triggered_at

string

触发时间(ISO 8601)

created_at

string

记录创建时间(ISO 8601)

错误码

HTTP

type

触发条件

401

authentication_error

PAT 无效或过期

404

not_found_error

Deployment 不存在

409

conflict_error

Deployment 已归档或不在 active 状态

完整错误信封说明详见错误参考