更新时间:2025-09-25 GMT+08:00
分享

运行yaml流水线

功能介绍

运行yaml流水线

调用方法

请参见如何调用API

URI

POST /v6/{domain_id}/api/pac/pipelines/{pipeline_id}/run

表1 路径参数

参数

是否必选

参数类型

描述

domain_id

String

租户id

pipeline_id

String

流水线id

表2 Query参数

参数

是否必选

参数类型

描述

project_id

String

项目id

请求参数

表3 请求Body参数

参数

是否必选

参数类型

描述

sources

Array of sources objects

代码仓详情列表

description

String

运行描述

variables

Array of variables objects

参数列表

choose_jobs

Array of strings

运行选中任务列表

choose_stages

Array of strings

运行选中阶段列表

表4 sources

参数

是否必选

参数类型

描述

type

String

代码源类型

params

params object

参数详情

表5 params

参数

是否必选

参数类型

描述

git_url

String

代码仓地址

git_type

String

代码仓类型

ssh_git_url

String

代码仓ssh地址

web_url

String

网页跳转链接

repo_name

String

代码仓名称

codehub_id

String

代码仓id

default_branch

String

默认分支

alias

String

代码仓别名

endpoint_id

String

拓展点id

build_params

build_params object

触发参数详情

change_request_ids

String

请求id

表6 build_params

参数

是否必选

参数类型

描述

build_type

String

构建类型

action

String

任务名

commit_id

String

提交id

event_type

String

触发方式

merge_id

String

MR触发的merge_id

source_branch

String

源分支

message

String

触发信息

tag

String

触发标签

target_branch

String

目标分支

codehub_id

String

代码仓id

表7 variables

参数

是否必选

参数类型

描述

name

String

参数名

value

String

参数值

响应参数

状态码:200

表8 响应Body参数

参数

参数类型

描述

pipeline_run_id

String

参数解释

流水线运行实例ID。

取值范围

32位字符,仅由数字和字母组成。

请求示例

POST https://{endpoint}/v6/377c73ff41d54a5fb117b88ec0a60a33/api/pac/pipelines/{pipeline_id}/run

{
  "sources" : [ {
    "type" : "code",
    "params" : {
      "git_type" : "codehub",
      "codehub_id" : "2111836036",
      "default_branch" : "master",
      "git_url" : "https://example.com/5c8305fa19154cabbb7f022a710f0ace/javaweb0127.git",
      "alias" : "",
      "endpoint_id" : "",
      "build_params" : {
        "build_type" : "branch",
        "event_type" : "Manual",
        "target_branch" : "master",
        "tag" : null
      }
    }
  } ],
  "description" : "",
  "variables" : [ ],
  "choose_jobs" : null,
  "choose_stages" : null
}

响应示例

状态码:200

OK

{
  "pipeline_run_id" : "aeb40413c5444bdcbbf7a060873af7a7"
}

状态码

状态码

描述

200

OK

错误码

请参见错误码

相关文档