更新时间:2024-06-20 GMT+08:00
分享

批量获取流水线状态

功能介绍

批量获取流水线状态,仅返回有执行记录的流水线数据

调用方法

请参见如何调用API

URI

POST /v5/{project_id}/api/pipelines/status

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。

通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

表3 请求Body参数

参数

是否必选

参数类型

描述

[数组元素]

Array of strings

流水线ID列表

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

[数组元素]

Array of PipelineLatestRun objects

OK

表5 PipelineLatestRun

参数

参数类型

描述

pipeline_id

String

流水线ID

pipeline_run_id

String

流水线运行实例ID

executor_id

String

执行人ID

executor_name

String

执行人名称

stage_status_list

Array of stage_status_list objects

阶段状态信息

status

String

流水线状态

run_number

Integer

运行序号

trigger_type

String

触发类型

build_params

build_params object

运行构建参数

artifact_params

artifact_params object

运行制品源参数

start_time

Long

开始时间

end_time

Long

结束时间

modify_url

String

修改页地址

detail_url

String

详情页地址

表6 stage_status_list

参数

参数类型

描述

name

String

阶段名

sequence

Integer

阶段序列号

status

String

阶段状态

start_time

String

阶段开始时间

end_time

String

阶段结束时间

表7 build_params

参数

参数类型

描述

action

String

合并请求的事件类型

build_type

String

基于分支还是tag触发

commit_id

String

代码库提交ID

event_type

String

触发的事件类型

merge_id

String

合并请求的ID

message

String

代码库提交信息

source_branch

String

合并请求的源分支

tag

String

标签

target_branch

String

目标分支

codehub_id

String

Repo代码仓ID

git_url

String

代码仓https地址

source_codehub_id

String

源Repo代码仓ID

source_codehub_url

String

源Repo代码仓地址

source_codehub_http_url

String

源Repo代码仓http地址

表8 artifact_params

参数

参数类型

描述

version

String

包版本

branch_filter

String

过滤分支

package_name

String

包名称

organization

String

docker组织信息

请求示例

批量获取流水线状态。 指定查询的流水线ID为”d19799d619424b2bb2625ec2d93ea087”。

POST https://{endpoint}/v5/54f90b75fc1447b1b65e8d3a9f77923d/api/pipelines/status

[ "d19799d619424b2bb2625ec2d93ea087" ]

响应示例

状态码: 200

OK

[ {
  "pipeline_id" : "d19799d619424b2bb2625ec2d93ea087",
  "pipeline_run_id" : "ad6b7f66283a45be9c1f82b06c831e59",
  "executor_id" : "847a5317086c41798469d0868535943a",
  "executor_name" : "beta环境账号",
  "stage_status_list" : [ {
    "name" : "阶段_1",
    "sequence" : 0,
    "status" : "FAILED",
    "start_time" : "2023-03-04 16:48:09",
    "end_time" : "2023-03-04 16:50:11"
  } ],
  "status" : "FAILED",
  "run_number" : 2,
  "trigger_type" : "Manual",
  "build_params" : {
    "action" : null,
    "build_type" : "branch",
    "commit_id" : "fc93c34f906aeb1cc031e3f6f8b2baeac078ae4b",
    "event_type" : "Manual",
    "merge_id" : null,
    "message" : "init",
    "source_branch" : null,
    "tag" : null,
    "target_branch" : "test-lbdsb11",
    "codehub_id" : "2111699716",
    "git_url" : "https://example.com/clsyz00001/111.git"
  },
  "artifact_params" : null,
  "start_time" : 1677919688000,
  "end_time" : 1677919811000
} ]

状态码

状态码

描述

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

错误码

请参见错误码

分享:

    相关文档

    相关产品