POST /v1/deployments/{id}/run
手动触发一次 Deployment 运行。Deployment 必须处于 active 状态(非暂停或已归档)。如果并发运行数已达上限,运行将以 skipped 状态记录。
路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
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 状态 |
相关
获取 Deployment Run
查看单次运行的状态与 Session ID。
列出 Deployment Run
查看该 Deployment 的运行历史。
列出所有 Run
跨 Deployment 查询所有运行记录。
获取 Deployment
查看 Deployment 配置与下次调度时间。