Updated on 2024-01-16 GMT+08:00

Example 2: Stopping a Pipeline

Scenario

This section shows how to stop a pipeline task by pipeline ID by using APIs.

For details about how to call APIs, see Calling APIs.

Constraints

A pipeline exists and is being executed.

Involved APIs

Use the user token and pipeline ID to stop a pipeline.

Procedure

  1. Query the build tasks in a specified project.

    • API information

      URI: POST /v3/pipelines/stop

      For details about this API, visit Stopping a Pipeline.

    • Example request
      https://cloudpipeline-ext.ap-southeast-3.myhuaweicloud.com/v3/pipelines/stop?pipeline_id=824e784b3f43492e99152a.....
    • Example request body
      {}
    • Example response
      {
          "result": {
              "name": "pipeline-test",
              "pipelineId": "e9bdc806955e48368e3ecbcdf2...."
          },
          "error": null,
          "status": "success"
      }