CreatePipeline

Updated at:

Creates a pipeline. This API supports creating 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 HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The organization ID. This string can be obtained from the Yunxiao URL, such as https://devops.aliyun.com/organization/[OrganizationId].

5ebbc0228123212b59xxxxx

Request parameters

Parameter

Type

Required

Description

Example

name

string

Yes

The name of the pipeline.

Sample pipeline

content

string

Yes

The YAML description of the pipeline. For more information about how to write the YAML file, see References at https://help.aliyun.com/document_detail/2249317.html.

sources: # Configure pipeline source nodes in sources my_repo: # The unique identifier of the pipeline source type: codeup # The type of the pipeline source name: Code source name # The display name of the code source endpoint: # The URL of the code source branch: master # The default branch of the code source triggerEvents: push # The event listened to by the code source certificate: # The authentication information in certificate type: serviceConnection # The authentication type is service connection serviceConnection: # The ID of the service connection stages: # Configure pipeline stages in stages build_stage: # The identifier of the pipeline stage name: Build stage # The display name of the pipeline stage jobs: # Configure pipeline jobs in jobs build_job: # The identifier of the pipeline job name: Build job # The display name of the pipeline job runsOn: public/cn-beijing # The cluster environment where the pipeline job runs steps: # Configure pipeline steps in steps build_step: # The identifier of the pipeline step step: JavaBuild # The step to execute name: Java build # The display name of the pipeline execution step with: # The parameters of the step run: | mvn -B clean package -Dmaven.test.skip=true -Dautoconfig.skip upload_step: step: ArtifactUpload name: Artifact upload with: uploadType: flowPublic artifact: default filePath: - target/ - deploy.sh deploy_stage: name: Deploy stage jobs: deploy_job: name: Host group deployment job component: VMDeploy # The component to execute with: # The parameters of the execution component 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

Response elements

Element

Type

Description

Example

object

Schema of Response

success

boolean

Indicates whether the API call is successful. Valid values: true (successful) and false (failed).

true

errorCode

string

The error code.

""

errorMessage

string

The error message.

""

pipelinId

integer

The ID of the pipeline.

11XXX

requestId

string

The request ID. Each request has a unique ID to facilitate troubleshooting.

ASSDS-ASSASX-XSAXSA-XSAXSAXS

Examples

Success response

JSON format

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

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.