手动触发一次 Deployment 运行。
无需请求体。可发送空 JSON
HTTP 200 OK
返回 Deployment Run 对象。
完整错误信封说明详见错误参考。
POST /api/v1/cloud/deployments/{id}/run
手动触发一次 Deployment 运行。Deployment 必须处于 active 状态(非暂停或已归档)。如果 CAS 无法为本次运行创建 Session,返回的 Deployment Run 会包含 session_id: null 和 error 对象。
路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | Deployment ID(dep_ 前缀) |
请求头
| 头部 | 必选 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <PAT> |
Content-Type | 是 | application/json |
请求体
无需请求体。可发送空 JSON {} 或省略。
示例请求
示例响应
HTTP 200 OK
返回 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 | 运行状态:pending、running、completed、failed、skipped |
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 特有元数据:attempt、turn_id、started_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 状态 |