UpdatePipeline

Updated at:

This operation updates only YAML-based pipelines.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /organization/{organizationId}/pipelines/update HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The unique identifier of the organization. You can get this ID from the URL in Alibaba Cloud DevOps, for example, https://devops.aliyun.com/organization/{organizationId}.

5ebbc0228123212b59xxxxx

Request parameters

Parameter

Type

Required

Description

Example

name

string

Yes

The name of the pipeline.

示例流水线

content

string

Yes

The definition of the pipeline in YAML format. For more information about how to write the YAML content, see https://help.aliyun.com/document_detail/2249317.html.

sources: # sources 配置流水线源节点 my_repo: # 流水线源唯一标识 id type: codeup # 流水线源类型 name: 代码源名称 # 代码源的展示名称 endpoint: # 代码源的 url branch: master # 代码源的默认分支 triggerEvents: push # 代码源监听事件 certificate: # certificate 认证信息 type: serviceConnection # 认证类型为服务连接 serviceConnection: # 服务连接 id stages: # stages 配置流水线阶段 build_stage: # 流水线阶段标识 id name: 构建阶段 # 流水线阶段的展示名称 jobs: # jobs 配置流水线任务 build_job: # 流水线任务标识 id name: 构建任务 # 流水线任务的展示名称 runsOn: public/cn-beijing # 流水线任务运行的集群环境 steps: # steps 配置流水线步骤 build_step: # 流水线步骤标识 id step: JavaBuild # 选择执行步骤 name: java构建 # 流水线执行步骤的展示名称 with: # 步骤的参数 run: | mvn -B clean package -Dmaven.test.skip=true -Dautoconfig.skip upload_step: step: ArtifactUpload name: 构建物上传 with: uploadType: flowPublic artifact: default filePath: - target/ - deploy.sh deploy_stage: name: 部署阶段 jobs: deploy_job: name: 主机组部署任务 component: VMDeploy # 选择执行组件 with: # 执行组件的参数 artifact: $[stages.build_stage.build_job.upload_step.artifacts.default] machineGroup: artifactDownloadPath: /home/admin/app/package.tgz executeUser: root run: | mkdir -p /home/admin/application/ tar zxvf /home/admin/app/package.tgz -C /home/admin/application/ sh /home/admin/application/deploy.sh restart

pipelineId

string

Yes

The ID of the pipeline. You can get this ID from the pipeline URL, for example, https://flow.aliyun.com/pipelines/{pipelineId}/current.

111xxx

Response elements

Element

Type

Description

Example

object

The response body.

success

boolean

Indicates whether the request was successful. true indicates success, while false indicates failure.

true

errorCode

string

The error code returned if the request fails.

""

errorMessage

string

The error message returned if the request fails.

""

requestId

string

The request ID. This ID is unique to each request and can be used for troubleshooting.

ASSDS-ASSASX-XSAXSA-XSAXSAXS

Examples

Success response

JSON format

{
  "success": true,
  "errorCode": "\"\"",
  "errorMessage": "\"\"",
  "requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParam.ParamNotPresent The parameter is invalid. The parameter is invalid.
400 InvalidUser.NotFound The user that is invoking the API service is not a registered user. The user that is invoking the API service is not a registered user.
403 Forbidden.AccessDenied The user is not authorized to perform the operation. The user is not authorized to perform the operation.
403 Forbidden.UserNotAdminOrOwner The current user is not an admin or owner in the organization and is not authorized to perform the operation.
403 Forbidden.UserNotInCurrentOrganization The user is not in the organization and is not authorized to perform the operation.
404 InvalidOrganization.NotFound The organization is not found. The organization is not found. Please check the organization ID.
404 InvalidPipeline.NotFound The pipeline is not found. The pipeline does not exist.
404 InvalidPipelineRun.NotFound The pipeline execution instance is not found. The pipeline execution instance is not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.