UpdatePipeline - Update a pipeline
Updates a specified pipeline.
|
Applicable editions |
Central edition, Region edition |
Endpoint and authorization information
-
Obtain an endpoint: Replace {domain} in the API request syntax.
-
Obtain the organizationId: Required only for the Central edition. Go to the Basic Information page in the Organization Management console to obtain the organization ID.
|
Product |
Resource |
Required permission |
|
Pipeline |
Pipeline |
Read and write |
Request syntax
Central edition
PUT https://{domain}/oapi/v1/flow/organizations/{organizationId}/pipelines/{pipelineId}
Region edition
PUT https://{domain}/oapi/v1/flow/pipelines/{pipelineId}
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
Personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Position |
Required |
Description |
Example |
|
organizationId |
string |
path |
|
The organization ID. |
5ebbc0228123212b59xxxxx |
|
pipelineId |
string |
path |
Yes |
The pipeline ID. |
123 |
| - |
object |
body |
No |
||
|
content |
string |
body |
Yes |
The YAML description of the pipeline. For more information, see the YAML pipeline documentation. |
stages: |
|
name |
string |
body |
Yes |
The pipeline name. Maximum length: 60 characters. |
Test Pipeline |
Request examples
Central edition
curl -X 'PUT' \
'https://{domain}/oapi/v1/flow/organizations/5ebbc0228123212b59xxxxx/pipelines/123' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"content": "stages:
command_stage:
name: "Execute Command"
jobs:
command_job:
name: "Execute Command"
runsOn:
group: public/cn-beijing
container: build-steps-public-registry.cn-beijing.cr.aliyuncs.com/build-steps/alinux3:latest
steps:
command_step:
name: "Execute Command"
step: "Command"
with:
run: "echo hello world"",
"name": "Test Pipeline"
}'
Region edition
curl -X 'PUT' \
'https://{domain}/oapi/v1/flow/pipelines/123' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"content": "stages:
command_stage:
name: "Execute Command"
jobs:
command_job:
name: "Execute Command"
runsOn:
group: public/cn-beijing
container: build-steps-public-registry.cn-beijing.cr.aliyuncs.com/build-steps/alinux3:latest
steps:
command_step:
name: "Execute Command"
step: "Command"
with:
run: "echo hello world"",
"name": "Test Pipeline"
}'
Response parameters
|
Parameter |
Type |
Description |
Example |
|
- |
boolean |
Whether the request was successful. |
true |
Response example
true
Error codes
For API error codes, see the Error Code Center.