获取流水线状态 - ShowPipelineStatus
功能介绍
获取流水线状态,阶段及任务信息
调用方法
请参见如何调用API。
URI
GET /v3/pipelines/{pipeline_id}/status
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
pipeline_id | 是 | String | 要获取状态的流水线ID |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
build_id | 否 | String | 要获取状态的执行ID |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
pipeline_id | String | 流水线ID |
pipeline_name | String | 流水线名称 |
executor | String | 执行人 |
build_id | String | 流水线执行ID |
start_time | String | 开始执行时间 |
end_time | String | 结束执行时间 |
parameters | Array of PipelineParameter objects | 流水线参数 |
states | Array of PipelineStateStatus objects | 流水线执行情况 |
elapsed_time | String | 执行耗时 |
status | String | 流水线运行状态。取值及含义:waiting:等待;running:执行中;verifying:待审核;suspending:挂起;completed:完成。 |
outcome | String | 流水线执行结果。取值及含义:success:成功;error:失败;aborted:终止 |
detail_url | String | 流水线详情页地址 |
参数 | 参数类型 | 描述 |
|---|---|---|
id | String | 阶段或任务标识 |
name | String | 阶段或任务名称 |
type | String | 类别(阶段/任务) |
start_time | String | 执行开始时间 |
end_time | String | 执行结束时间 |
elapsed_time | String | 运行耗时 |
status | String | 参数解释: 阶段执行状态。 约束限制: 不涉及。 取值范围:
默认取值: 不涉及。 |
outcome | String | 运行结果。取值及含义:success:成功;error:失败;aborted:终止 |
error_code | String | 错误码 |
error_msg | String | 错误信息 |
children | Array of PipelineStateStatus objects | 子任务运行信息(对任务来说是空的) |
detail_url | String | 任务运行记录跳转链接 |
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_msg | String | 参数解释: 错误信息。 取值范围: 不涉及。 |
error_code | String | 参数解释: 错误码。 取值范围: 不涉及。 |
请求示例
GET https://{endpoint}/v3/pipelines/8025ba36a87a4dd5af496708c2961817/status?build_id=2 响应示例
状态码:200
OK
{
"executor" : null,
"status" : null,
"outcome" : null,
"pipeline_id" : "75c562a081574ff28224fb2c123a0643",
"pipeline_name" : "pipeline-1185523_Cx2Ur",
"build_id" : null,
"start_time" : "2022-04-01 19:44:16",
"end_time" : null,
"elapsed_time" : null,
"detail_url" : "https://example.com",
"parameters" : [ {
"name" : "seviceName",
"value" : "pipeline-23"
}, {
"name" : "codeBranch",
"value" : "master"
} ],
"states" : [ {
"id" : "state_4",
"name" : "构建",
"type" : "stage",
"status" : null,
"outcome" : null,
"children" : [ {
"id" : "Task_1",
"name" : "人工审核",
"type" : "task",
"status" : null,
"outcome" : null,
"start_time" : null,
"end_time\"" : null,
"elapsed_time" : null,
"error_code" : null,
"error_msg" : null,
"detail_url" : null
} ],
"start_time" : null,
"end_time" : null,
"elapsed_time" : null
} ]
} 状态码
状态码 | 描述 |
|---|---|
200 | OK |
400 | Bad request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
错误码
请参见错误码。

