Rolling Back the Pipeline Execution
Function
This API is used to roll back the pipeline execution.
Calling Method
For details, see Calling APIs.
URI
POST /v5/{project_id}/api/pipelines/{pipeline_id}/pipeline-runs/{pipelineRunId}/rollback-run
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Parameter description: CodeArts project ID. Constraints: N/A. Value Range: The value contains 32 characters. Default value: N/A. |
pipeline_id |
Yes |
String |
Parameter description: Pipeline ID. Constraints: N/A. Value Range: The value contains 32 characters. Default value: N/A. |
pipelineRunId |
Yes |
String |
Pipeline run ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sources |
Yes |
Array of sources objects |
Pipeline source. |
description |
No |
String |
Running description. |
variables |
No |
Array of variables objects |
Running parameters. |
choose_jobs |
Yes |
Array of strings |
Selected running jobs. |
choose_stages |
Yes |
Array of strings |
Selected running stages. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Pipeline source type. |
params |
Yes |
params object |
Pipeline parameters. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
git_type |
Yes |
String |
Git repository type. |
codehub_id |
Yes |
String |
Repo repository ID. |
default_branch |
Yes |
String |
Default branch. |
git_url |
Yes |
String |
URL for downloading a Git repository. |
alias |
No |
String |
Repository alias. |
endpoint_id |
No |
String |
Endpoint ID. |
build_params |
Yes |
build_params object |
Build parameter. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
build_type |
Yes |
String |
Build type. |
event_type |
Yes |
String |
Event type. |
target_branch |
Yes |
String |
Target branch. |
tag |
No |
String |
Tag name. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
Parameter name. |
sequence |
No |
Integer |
Parameter No. |
type |
No |
String |
Parameter type. |
value |
No |
String |
Parameter value. |
is_secret |
No |
Boolean |
Whether the parameter is private or not. |
description |
No |
String |
Description. |
is_runtime |
No |
Boolean |
Whether the parameter can be set during runtime. |
limits |
No |
Array of strings |
Parameter limitations. |
is_reset |
No |
Boolean |
Reset or not. |
latest_value |
No |
String |
Value of the latest run. |
required |
No |
Boolean |
Required or not. |
variableGroupName |
No |
String |
Parameter group name. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
pipeline_run_id |
String |
Parameter description: Pipeline run ID. Value range: 32 characters, including only digits and letters. |
Example Requests
POST https://(endpoint)/v5/db8d07265e24426598b3eb03a7818972/api/pipelines/d7013d2402ff4cc88489ee5af324e049/pipeline-runs/6d65dd0bc411451b8fb70e8535eda3d8/rollback-run
{
"sources" : [ {
"type" : "code",
"params" : {
"git_type" : "codehub",
"codehub_id" : "123456",
"default_branch" : "master",
"git_url" : "https://0001.git",
"alias" : "",
"endpoint_id" : "",
"build_params" : {
"build_type" : "branch",
"event_type" : "Manual",
"target_branch" : "master",
"tag" : null
}
}
} ],
"description" : "",
"variables" : [ {
"name" : "1",
"sequence" : 1,
"type" : "string",
"value" : "1",
"is_secret" : false,
"description" : "",
"is_runtime" : false,
"limits" : [ ],
"is_reset" : false,
"latest_value" : "",
"required" : true,
"variableGroupName" : null
}, {
"name" : "2",
"sequence" : 2,
"type" : "string",
"value" : "2",
"is_secret" : false,
"description" : "",
"is_runtime" : false,
"limits" : [ ],
"is_reset" : false,
"latest_value" : "",
"required" : true,
"variableGroupName" : null
} ],
"choose_jobs" : [ "Task_1" ],
"choose_stages" : [ "state_4" ]
}
Example Responses
Status code: 200
Response body.
{
"pipeline_run_id" : "d5e642b122fd453dbaff21d90dee5ac1"
}
Status Codes
Status Code |
Description |
---|---|
200 |
Response body. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot