Updated on 2025-11-12 GMT+08:00

Running a YAML Pipeline

Function

This API is used to run a YAML pipeline.

Calling Method

For details, see Calling APIs.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Definition:

Tenant ID.

Constraints:

N/A

Value range:

The value contains 32 characters.

Default value:

N/A

pipeline_id

Yes

String

Definition:

Pipeline ID. Obtain the ID by calling the API for querying pipelines. pipelines.pipelineId indicates the pipeline ID.

Constraints:

N/A

Value range:

The value consists of 32 characters, including only digits and letters.

Default value:

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

sources

No

Array of sources objects

Definition:

Code repository details.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

description

No

String

Definition:

Running description.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

variables

No

Array of variables objects

Definition:

Parameter list.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

choose_jobs

No

Array of strings

Definition:

Selected tasks to run.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

choose_stages

No

Array of strings

Definition:

Selected stages to run.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 3 sources

Parameter

Mandatory

Type

Description

type

No

String

Definition:

Code source type.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

params

No

params object

Definition:

Parameter details.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 4 params

Parameter

Mandatory

Type

Description

git_url

No

String

Definition:

Code repository address.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

git_type

No

String

Definition:

Code repository type.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

ssh_git_url

No

String

Definition:

SSH address of the code repository.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

web_url

No

String

Definition:

Redirection URL.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

repo_name

No

String

Definition:

Code repository name.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

codehub_id

No

String

Definition:

Code repository ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

default_branch

No

String

Definition:

Default branch.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

alias

No

String

Definition:

Code repository alias.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

endpoint_id

No

String

Definition:

Endpoint ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

build_params

No

build_params object

Definition:

Trigger parameter details.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

change_request_ids

No

String

Definition:

Request ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 5 build_params

Parameter

Mandatory

Type

Description

build_type

No

String

Definition:

Build type.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

action

No

String

Definition:

Task name.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

commit_id

No

String

Definition:

Commit ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

event_type

No

String

Definition:

Trigger method.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

merge_id

No

String

Definition:

Merge ID of an MR.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

source_branch

No

String

Definition:

Source branch.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

message

No

String

Definition:

Trigger information.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

tag

No

String

Definition:

Trigger tag.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

target_branch

No

String

Definition:

Target branch.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

codehub_id

No

String

Definition:

Code repository ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 6 variables

Parameter

Mandatory

Type

Description

name

No

String

Definition:

Parameter name.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

value

No

String

Definition:

Parameter value.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

pipeline_run_id

String

Definition:

Pipeline run ID.

Value range:

The value consists of 32 characters, including only digits and letters.

Example Requests

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
}

Example Responses

Status code: 200

OK

{
  "pipeline_run_id" : "aeb40413c5444bdcbbf7a060873af7a7"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.