Introduction

Continous Delivery Tekton Pipelines leverages the open source Tekton Pipelines project to provide continous integration and continous delivery capabilities within kubernetes cluster.

Tekton Pipelines is an open source project that you can use to configure and run Continuous Integration and Continuous Delivery pipelines within a Kubernetes cluster. Tekton pipelines are defined in yaml files, which are typically stored in a Git repository (repo).

For more information about our continuous delivery tekton pipeline, see Working with Tekton pipelines.

Installing the Node SDK

npm install <TODO>/tekton-pipeline

View on GitHub

Installing the Java SDK

Maven

<dependency>
  <groupId>com.ibm.todo.tekton_pipeline</groupId>
  <artifactId>java-sdk</artifactId>
  <version>6.1.0</version>
</dependency>

Gradle

compile 'com.ibm.todo.tekton_pipeline:java-sdk:6.1.0'

View on GitHub

Installing the Python SDK

pip install --upgrade "tekton-pipeline"

View on GitHub

Installing the Go SDK

Go modules (recommended): Add the following import in your code, and then run go build or go mod tidy

import (
	"github.ibm.com/org-ids/tekton-pipeline-go-sdk"
)

Go get

go get -u github.ibm.com/org-ids/tekton-pipeline-go-sdk

View on GitHub

Endpoint URL

The continuous delivery tekton pipeline API uses the reginal endpoints. When you call the API, add the path for each method to form the complete API endpoint for your requests.

  • Dallas: https://api.us-south.devops.cloud.ibm.com/v2
  • Washington DC: https://api.us-east.devops.cloud.ibm.com/v2
  • London: https://api.eu-gb.devops.cloud.ibm.com/v2
  • Frankfurt: https://api.eu-de.devops.cloud.ibm.com/v2
  • Sydney: https://api.au-syd.devops.cloud.ibm.com/v2
  • Tokyo: https://api.jp-tok.devops.cloud.ibm.com/v2
  • Osaka: https://api.jp-osa.devops.cloud.ibm.com/v2
  • Toronto: https://api.ca-tor.devops.cloud.ibm.com/v2
  • São Paulo: https://api.br-sao.devops.cloud.ibm.com/v2

Authentication

Authentication to the Tekton Pipeline V2 API is enforced by using an IBM Cloud Identity and Access Management (IAM) access token. The token is used to determine the actions that a user has access to when they use the API.

To obtain an access token you use an API key. To obtain your API key, access the IBM Cloud API keys page and create your API key. You can use this key to generate your IAM access (bearer) token. Your authorization header will look something like this: Bearer poJraWQiOiIyMDIxMTAzMDE1MTQiLCJhbGciiuJSUzI1NiJ9.eyJpYW1fdWQiOiJJQk1pZC0xMTAwMDBCS1VWIiwiaWQiOiJJQk1pZC0xMTAwMDBCS1VWIiwicmVhbG1pZCI6IklCTWlkIiwianRpIjoiMjgzMDE3MWItYmY1MC00ZGEyLWE4MjAtMjFmNGVjYWQ0NDE0IiwiaWRlbnRkj

To generate an IAM access token, use the Create an IAM access token for a user or service ID using an API key method. For example:

   curl -X POST 'https://iam.cloud.ibm.com/identity/token' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=MY_APIKEY'

After your service has been provisioned, use one of the following requests to interface with the service:

`curl -L --request GET 'https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/{pipeline_id}'
--header 'Authorization: Bearer '

To retrieve your access token:

curl -X POST   "https://iam.test.cloud.ibm.com/identity/token"   --header 'Content-Type:application/x-www-form-urlencoded'   --header 'Accept:application/json'   --data-urlencode 'grant_type=urn:ibm:params:oauth:grant-type:apikey'   --data-urlencode 'apikey=<API_KEY>'

Replace <API_KEY> with your IAM API key.

Setting client options through external configuration

Example environment variables, where <API_KEY> is your IAM API key

export TEKTON_PIPELINE_URL=https://api.us-south.devops.cloud.ibm.com
export TEKTON_PIPELINE_AUTHTYPE=iam
export TEKTON_PIPELINE_APIKEY=<API_KEY>

Example of constructing the service client

import {
    "github.com/IBM/platform-services-go-sdk/globalsearchv2"
}
...
serviceClientOptions := &globalsearchv2.GlobalSearchV2Options{}
serviceClient, err := globalsearchv2.NewGlobalSearchV2UsingExternalConfig(serviceClientOptions)

Setting client options through external configuration

Example environment variables, where <API_KEY> is your IAM API key

export TEKTON_PIPELINE_URL=https://api.us-south.devops.cloud.ibm.com
export TEKTON_PIPELINE_AUTHTYPE=iam
export TEKTON_PIPELINE_APIKEY=<API_KEY>

Example of constructing the service client

import com.ibm.cloud.platform_services.global_search.v2.GlobalSearch;
...
GlobalSearch serviceClient = GlobalSearch.newInstance();

Setting client options through external configuration

Example environment variables, where <API_KEY> is your IAM API key

export TEKTON_PIPELINE_URL=https://api.us-south.devops.cloud.ibm.com
export TEKTON_PIPELINE_AUTHTYPE=iam
export TEKTON_PIPELINE_APIKEY=<API_KEY>

Example of constructing the service client

const GlobalSearchV2 = require('ibm-platform-services/global-search/v2');
...
const serviceClient = GlobalSearchV2.newInstance({});

Setting client options through external configuration

Example environment variables, where <API_KEY> is your IAM API key

export TEKTON_PIPELINE_URL=https://api.us-south.devops.cloud.ibm.com
export TEKTON_PIPELINE_AUTHTYPE=iam
export TEKTON_PIPELINE_APIKEY=<API_KEY>

Example of constructing the service client

from ibm_platform_services import GlobalSearchV2
...
service_client = GlobalSearchV2.new_instance()

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response indicates success. A 400 type response indicates a failure, and a 500 type response indicates an internal system error.

HTTP Error Code Description Recovery
200 Success The request was successful.
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request.
401 Unauthorized You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.
404 Not Found The requested resource could not be found or The supplied authentication is not authorized to access '{namespace}'.
408 Request Timeout The connection to the server timed out. Wait a few minutes, then try again.
409 Conflict The entity is already in the requested state.
500 Internal Server Error offering_name is currently unavailable. Your request could not be processed. Wait a few minutes and try again.

ErrorResponse

Name Type Description
code Integer HTTP error code.
error String Human-readable error string, like 'Invalid image file'.

When the Node SDK receives an error response from the Visual Recognition service, it creates an Error object with information describing the error that occurred. This error object is passed as the first parameter to the callback function for the method. The contents of the error object are as shown in the following table:

Errors

Error Field Description
code The HTTP status code returned
message A message describing the error

The Java SDK generates an exception for any unsuccessful method invocation. All methods that accept an argument can also throw an IllegalArgumentException.

Exception Description
IllegalArgumentException An invalid argument was passed to the method.

When the Java SDK receives an error response from the Visual Recognition service, it generates an exception from the com.ibm.watson.developer_cloud.service.exception package. All service exceptions contain the following fields:

Field Description
statusCode The HTTP status code returned
message A message describing the error

The Python SDK generates an exception for any unsuccessful method invocation. When the Python SDK receives an error response from the Visual Recognition service, it generates a WatsonApiException containing the following fields:

Field Description
code The HTTP status code returned
message A message describing the error
info A dictionary of additional information about the error
visualRecognition.method(params,
    function(err, response) {
        // The error will be the first argument of the callback
        if (err.code == 404) {
            // Handle Not Found (404) error
        } else if (err.code == 413) {
            // Handle Request Too Large (413) error
        } else {
            console.log('Unexpected error: ', err.code);
            console.log('error:', err);
        }
    });

Example error handling

try {
    // Invoke a Visual Recognition method
} catch (NotFoundException e) {
    // Handle Not Found (404) exception
} catch (RequestTooLargeException e) {
    // Handle Request Too Large (413) exception
} catch (ServiceResponseException e) {
    // Base class for all exceptions caused by error responses from the service
    System.out.println("Service returned status code " + e.getStatusCode() + ": " + e.getMessage());
}

Example error handling

from watson_developer_cloud import WatsonApiException
try:
    # Invoke a Visual Recognition method
except WatsonApiException as ex:
    print "Method failed with status code " + str(ex.code) + ": " + ex.message

Glossary

Methods

Create tekton pipeline

This request creates a tekton pipeline for a tekton pipeline toolchain integration, user has to use the toolchain endpoint to create the tekton pipeline toolchain integration first and then use the generated UUID to create the tekton pipeline with or without a specified worker

POST /tekton_pipelines

Request

Request body used to create pipeline for a pipeline toolchain integration. To get the worker ID user must call toolchain endpoint

Examples:
pipeline
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "id": "94619026-912b-4d92-8f51-6c74f0692d90", "worker": { "id": "public" } }'   "{base_url}/tekton_pipelines"
  • workerWithIDModel := &cdtektonpipelinev2.WorkerWithID{
      ID: core.StringPtr("public"),
    }
    
    createTektonPipelineOptions := cdTektonPipelineService.NewCreateTektonPipelineOptions()
    createTektonPipelineOptions.SetID("94619026-912b-4d92-8f51-6c74f0692d90")
    createTektonPipelineOptions.SetWorker(workerWithIDModel)
    
    tektonPipeline, response, err := cdTektonPipelineService.CreateTektonPipeline(createTektonPipelineOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(tektonPipeline, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // WorkerWithId
    const workerWithIdModel = {
      id: 'public',
    };
    
    const params = {
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
      worker: workerWithIdModel,
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.createTektonPipeline(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • WorkerWithId workerWithIdModel = new WorkerWithId.Builder()
      .id("public")
      .build();
    CreateTektonPipelineOptions createTektonPipelineOptions = new CreateTektonPipelineOptions.Builder()
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .worker(workerWithIdModel)
      .build();
    
    Response<TektonPipeline> response = cdTektonPipelineService.createTektonPipeline(createTektonPipelineOptions).execute();
    TektonPipeline tektonPipeline = response.getResult();
    
    System.out.println(tektonPipeline);
  • worker_with_id_model = {
      'id': 'public',
    }
    
    tekton_pipeline = cd_tekton_pipeline_service.create_tekton_pipeline(
      id='94619026-912b-4d92-8f51-6c74f0692d90',
      worker=worker_with_id_model
    ).get_result()
    
    print(json.dumps(tekton_pipeline, indent=2))

Response

Tekton pipeline object

Status Code

  • Tekton pipeline data.

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ci-pipeline",
      "html_url": "https://dev.console.test.cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90?env_id=ibm:ys1:us-south",
      "resource_group_id": "19c29990ffe42ce260f5a5cb64f54169",
      "status": "configured",
      "created": "2020-01-28T14:45:44.828Z",
      "updated_at": "2021-11-18T01:16:00.724Z",
      "toolchain": {
        "id": "bf5fa00f-ddef-4298-b87b-aa8b6da0e1a6",
        "crn": "crn:v1:staging:public:toolchain:us-south:a/0ba224679d6c697f9baee5e14ade83ac:bf5fa00f-ddef-4298-b87b-aa8b6da0e1a6::"
      },
      "properties": [],
      "pipeline_definition": {},
      "triggers": [],
      "worker": {
        "name": "IBM Managed workers (Tekton Pipelines v0.16.3) in DALLAS (Stage 1)",
        "type": "public",
        "id": "public"
      },
      "id": "94619026-912b-4d92-8f51-6c74f0692d90",
      "enabled": true,
      "definitions": []
    }

Get tekton pipeline data

This request retrieves whole tekton pipeline data

GET /tekton_pipelines/{id}

Request

Path Parameters

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{id}"
  • getTektonPipelineOptions := cdTektonPipelineService.NewGetTektonPipelineOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    
    tektonPipeline, response, err := cdTektonPipelineService.GetTektonPipeline(getTektonPipelineOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(tektonPipeline, "", "  ")
    fmt.Println(string(b))
  • const params = {
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.getTektonPipeline(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • GetTektonPipelineOptions getTektonPipelineOptions = new GetTektonPipelineOptions.Builder()
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .build();
    
    Response<TektonPipeline> response = cdTektonPipelineService.getTektonPipeline(getTektonPipelineOptions).execute();
    TektonPipeline tektonPipeline = response.getResult();
    
    System.out.println(tektonPipeline);
  • tekton_pipeline = cd_tekton_pipeline_service.get_tekton_pipeline(
      id='94619026-912b-4d92-8f51-6c74f0692d90'
    ).get_result()
    
    print(json.dumps(tekton_pipeline, indent=2))

Response

Tekton pipeline object

Status Code

  • Tekton pipeline data.

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ci-pipeline",
      "html_url": "https://dev.console.test.cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90?env_id=ibm:ys1:us-south",
      "resource_group_id": "19c29990ffe42ce260f5a5cb64f54169",
      "status": "configured",
      "created": "2020-01-28T14:45:44.828Z",
      "updated_at": "2021-11-18T01:16:00.724Z",
      "toolchain": {
        "id": "bf5fa00f-ddef-4298-b87b-aa8b6da0e1a6",
        "crn": "crn:v1:staging:public:toolchain:us-south:a/0ba224679d6c697f9baee5e14ade83ac:bf5fa00f-ddef-4298-b87b-aa8b6da0e1a6::"
      },
      "properties": [
        {
          "name": "pipeline-debug",
          "value": "1",
          "type": "TEXT"
        }
      ],
      "pipeline_definition": {
        "status": "updated",
        "id": "62138dbe-fa0a-4762-84db-2df6170a5b73"
      },
      "triggers": [
        {
          "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57",
          "disabled": false,
          "name": "manual-trigger",
          "type": "manual",
          "event_listener": "manual-listener"
        }
      ],
      "worker": {
        "name": "IBM Managed workers (Tekton Pipelines v0.16.3) in DALLAS (Stage 1)",
        "type": "public",
        "id": "public"
      },
      "build_number": 1,
      "id": "94619026-912b-4d92-8f51-6c74f0692d90",
      "enabled": true,
      "definitions": [
        {
          "scm_source": {
            "path": ".tekton",
            "url": "https://github.com/IBM/tekton-tutorial.git",
            "branch": "master"
          },
          "id": "22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f",
          "service_instance_id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6"
        }
      ]
    }

Update tekton pipeline data

This request updates tekton pipeline data, but you can only change worker ID in this endpoint. Use other endpoints such as /definitions, /triggers, and /properties for detailed updated

PATCH /tekton_pipelines/{id}

Request

Path Parameters

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Request body used to change worker for this pipeline. To get the worker ID user must call toolchain endpoint

Examples:
pipeline
  • curl -X PATCH --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "worker": { "id": "public" } }'   "{base_url}/tekton_pipelines/{id}"
  • workerWithIDModel := &cdtektonpipelinev2.WorkerWithID{
      ID: core.StringPtr("public"),
    }
    
    updateTektonPipelineOptions := cdTektonPipelineService.NewUpdateTektonPipelineOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    updateTektonPipelineOptions.SetWorker(workerWithIDModel)
    
    tektonPipeline, response, err := cdTektonPipelineService.UpdateTektonPipeline(updateTektonPipelineOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(tektonPipeline, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // WorkerWithId
    const workerWithIdModel = {
      id: 'public',
    };
    
    const params = {
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
      worker: workerWithIdModel,
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.updateTektonPipeline(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • WorkerWithId workerWithIdModel = new WorkerWithId.Builder()
      .id("public")
      .build();
    UpdateTektonPipelineOptions updateTektonPipelineOptions = new UpdateTektonPipelineOptions.Builder()
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .worker(workerWithIdModel)
      .build();
    
    Response<TektonPipeline> response = cdTektonPipelineService.updateTektonPipeline(updateTektonPipelineOptions).execute();
    TektonPipeline tektonPipeline = response.getResult();
    
    System.out.println(tektonPipeline);
  • worker_with_id_model = {
      'id': 'public',
    }
    
    tekton_pipeline = cd_tekton_pipeline_service.update_tekton_pipeline(
      id='94619026-912b-4d92-8f51-6c74f0692d90',
      worker=worker_with_id_model
    ).get_result()
    
    print(json.dumps(tekton_pipeline, indent=2))

Response

Tekton pipeline object

Status Code

  • Tekton pipeline data.

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ci-pipeline",
      "html_url": "https://dev.console.test.cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90?env_id=ibm:ys1:us-south",
      "resource_group_id": "19c29990ffe42ce260f5a5cb64f54169",
      "status": "configured",
      "created": "2020-01-28T14:45:44.828Z",
      "updated_at": "2021-11-18T01:16:00.724Z",
      "toolchain": {
        "id": "bf5fa00f-ddef-4298-b87b-aa8b6da0e1a6",
        "crn": "crn:v1:staging:public:toolchain:us-south:a/0ba224679d6c697f9baee5e14ade83ac:bf5fa00f-ddef-4298-b87b-aa8b6da0e1a6::"
      },
      "properties": [
        {
          "name": "pipeline-debug",
          "value": "1",
          "type": "TEXT"
        }
      ],
      "pipeline_definition": {
        "status": "updated",
        "id": "62138dbe-fa0a-4762-84db-2df6170a5b73"
      },
      "triggers": [
        {
          "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57",
          "disabled": false,
          "name": "manual-trigger",
          "type": "manual",
          "event_listener": "manual-listener"
        }
      ],
      "worker": {
        "name": "IBM Managed workers (Tekton Pipelines v0.16.3) in DALLAS (Stage 1)",
        "type": "public",
        "id": "public"
      },
      "build_number": 1,
      "id": "94619026-912b-4d92-8f51-6c74f0692d90",
      "enabled": true,
      "definitions": [
        {
          "scm_source": {
            "path": ".tekton",
            "url": "https://github.com/IBM/tekton-tutorial.git",
            "branch": "master"
          },
          "id": "22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f",
          "service_instance_id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6"
        }
      ]
    }

Delete tekton pipeline instance

This request deletes tekton pipeline instance that associated with the pipeline toolchain integration

DELETE /tekton_pipelines/{id}

Request

Path Parameters

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   "{base_url}/tekton_pipelines/{id}"
  • deleteTektonPipelineOptions := cdTektonPipelineService.NewDeleteTektonPipelineOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    
    response, err := cdTektonPipelineService.DeleteTektonPipeline(deleteTektonPipelineOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteTektonPipeline(): %d\n", response.StatusCode)
    }
  • const params = {
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
    };
    
    try {
      await cdTektonPipelineService.deleteTektonPipeline(params);
    } catch (err) {
      console.warn(err);
    }
  • DeleteTektonPipelineOptions deleteTektonPipelineOptions = new DeleteTektonPipelineOptions.Builder()
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .build();
    
    Response<Void> response = cdTektonPipelineService.deleteTektonPipeline(deleteTektonPipelineOptions).execute();
  • response = cd_tekton_pipeline_service.delete_tekton_pipeline(
      id='94619026-912b-4d92-8f51-6c74f0692d90'
    )

Response

Status Code

  • Tekton pipeline instance deleted

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

No Sample Response

This method does not specify any sample responses.

List pipeline run records

This request list pipeline run records, which has data of that run, such as status, user_info, trigger and other information. Default limit is 50

GET /tekton_pipelines/{pipeline_id}/pipeline_runs

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Query Parameters

  • The number of pipeline runs to return, sorted by creation time, most recent first

    Possible values: 1 ≤ value ≤ 100

    Default: 50

  • Skip the specified number of pipeline runs

    Default: 0

  • Filters the collection to resources with the specified status

    Allowable values: [pending,waiting,queued,running,cancelled,cancelling,failed,error,succeeded]

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: succeeded

  • Filters the collection to resources with the specified trigger name

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: manual-trigger

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs?status=succeeded&trigger.name=manual-trigger"
  • listTektonPipelineRunsOptions := cdTektonPipelineService.NewListTektonPipelineRunsOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    listTektonPipelineRunsOptions.SetStatus("succeeded")
    listTektonPipelineRunsOptions.SetTriggerName("manual-trigger")
    
    pipelineRuns, response, err := cdTektonPipelineService.ListTektonPipelineRuns(listTektonPipelineRunsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(pipelineRuns, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      status: 'succeeded',
      triggerName: 'manual-trigger',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.listTektonPipelineRuns(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • ListTektonPipelineRunsOptions listTektonPipelineRunsOptions = new ListTektonPipelineRunsOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .status("succeeded")
      .triggerName("manual-trigger")
      .build();
    
    Response<PipelineRuns> response = cdTektonPipelineService.listTektonPipelineRuns(listTektonPipelineRunsOptions).execute();
    PipelineRuns pipelineRuns = response.getResult();
    
    System.out.println(pipelineRuns);
  • pipeline_runs = cd_tekton_pipeline_service.list_tekton_pipeline_runs(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      status='succeeded',
      trigger_name='manual-trigger'
    ).get_result()
    
    print(json.dumps(pipeline_runs, indent=2))

Response

Tekton pipeline runs object

Status Code

  • List of pipeline runs

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "pipeline_runs": [
        {
          "id": "1681024e-4dfe-40dd-922b-b55719120078",
          "worker": {
            "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f",
            "agent": "a2fd3205-0d94-47e1-a867-444a6185db51"
          },
          "user_info": {
            "iam_id": "IBMid-310001SNXX",
            "sub": "firstname@domain.com"
          },
          "status": "succeeded",
          "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90",
          "event_params_blob": "{\"message\":\"hello world\",\"flag\":\"no-go\",\"properties\":[{\"name\":\"pipeline-debug\",\"value\":\"from-API\",\"type\":\"TEXT\"},{\"name\":\"pipeline-debug-2\",\"value\":\"from-api-2\",\"type\":\"TEXT\"}]}",
          "definition_id": "ee41a181-afed-4308-bf2a-84d6c677a005",
          "listener_name": "manual-listener",
          "created": "2021-11-23T21:28:03.824Z",
          "build_number": 1387,
          "trigger": {
            "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57",
            "name": "manual-trigger",
            "type": "manual",
            "event_listener": "manual-listener",
            "disabled": false,
            "properties": [
              {
                "name": "new",
                "value": "123",
                "type": "TEXT"
              }
            ]
          },
          "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/1681024e-4dfe-40dd-922b-b55719120078",
          "html_url": "https://cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90/runs/1681024e-4dfe-40dd-922b-b55719120078?env_id=ibm:ys1:us-south"
        }
      ],
      "offset": 0,
      "limit": 1,
      "first": {
        "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs?limit=1"
      },
      "next": {
        "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs?limit=1&offset=1"
      }
    }

Start a trigger to create a pipelineRun

This request executes a trigger to create a pipelineRun

POST /tekton_pipelines/{pipeline_id}/pipeline_runs

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Request body used to start a tekton pipeline run

Examples:
trigger_name_only
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "trigger_name": "Generic Webhook Trigger - 0", "trigger_properties": { "pipeline-debug": "false" }, "secure_trigger_properties": { "secure-property-key": "secure value" }, "trigger_header": { "source": "api" }, "trigger_body": { "message": "hello world", "enable": "true", "detail": { "name": "example" } } }'   "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs"
  • createTektonPipelineRunOptions := cdTektonPipelineService.NewCreateTektonPipelineRunOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    createTektonPipelineRunOptions.SetTriggerName("Generic Webhook Trigger - 0")
    
    pipelineRun, response, err := cdTektonPipelineService.CreateTektonPipelineRun(createTektonPipelineRunOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(pipelineRun, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerName: 'Generic Webhook Trigger - 0',
      triggerProperties: { 'pipeline-debug': 'false' },
      secureTriggerProperties: { 'secure-property-key': 'secure value' },
      triggerHeader: { source: 'api' },
      triggerBody: { message: 'hello world', enable: 'true', detail: { name: 'example' } },
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.createTektonPipelineRun(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • CreateTektonPipelineRunOptions createTektonPipelineRunOptions = new CreateTektonPipelineRunOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerName("Generic Webhook Trigger - 0")
      .build();
    
    Response<PipelineRun> response = cdTektonPipelineService.createTektonPipelineRun(createTektonPipelineRunOptions).execute();
    PipelineRun pipelineRun = response.getResult();
    
    System.out.println(pipelineRun);
  • pipeline_run = cd_tekton_pipeline_service.create_tekton_pipeline_run(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_name='Generic Webhook Trigger - 0',
      trigger_properties={'pipeline-debug':'false'},
      secure_trigger_properties={'secure-property-key':'secure value'},
      trigger_header={'source':'api'},
      trigger_body={'message':'hello world','enable':'true','detail':{'name':'example'}}
    ).get_result()
    
    print(json.dumps(pipeline_run, indent=2))

Response

Single tekton pipeline run object

Status Code

  • pipeline run result and its status

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90",
      "status": "pending",
      "properties": [
        {
          "name": "pipeline-debug",
          "value": "from-API",
          "type": "TEXT"
        }
      ],
      "listener_name": "manual-listener",
      "trigger": {
        "name": "manual-trigger",
        "event_listener": "manual-listener",
        "type": "manual",
        "id": "1bb892a1-2e04-4768-a369-b1159eace147",
        "disabled": false,
        "worker": {
          "name": "IBM Managed workers (Tekton Pipelines v0.16.3) in DALLAS (Stage 1)",
          "type": "public",
          "id": "public"
        }
      },
      "type": "pipeline_run",
      "created": "2022-02-03T20:49:02.124Z",
      "updated_at": "2022-02-03T20:49:02.124Z",
      "id": "c4d6e785-f890-4ee4-92dd-f690f95b41a2",
      "html_url": "https://cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90/runs/c4d6e785-f890-4ee4-92dd-f690f95b41a2?env_id=ibm:ys1:us-south",
      "worker": {
        "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f",
        "name": "public"
      },
      "event_params_blob": "{\"message\":\"hello world\",\"flag\":\"no-go\",\"properties\":[{\"name\":\"pipeline-debug\",\"value\":\"from-API\",\"type\":\"TEXT\"},{\"name\":\"pipeline-debug-2\",\"value\":\"from-api-2\",\"type\":\"TEXT\"}]}",
      "event_header_params_blob": "{\"x-forwarded-proto\":\"https\",\"user_iam_id\":\"IBMid-310001SNXX\",\"user_sub\":\"firstname@domain.com\",\"transaction-id\":\"3d20c668-856c-405b-93ee-157adb755111\",\"location\":\"my-post-man\",\"source\":\"post-man\",\"accept\":\"application/json\",\"x-request-id\":\"ba62177b-8e82-488f-9f41-68c43d7d1e21\",\"x-b3-traceid\":\"bd038d74d0ae28549e8915627ed817db\",\"x-b3-spanid\":\"e760ea7d4a6676d8\",\"x-b3-parentspanid\":\"9e8915627ed817db\",\"x-b3-sampled\":\"0\"}",
      "definition_id": "ee41a181-afed-4308-bf2a-84d6c677a005"
    }

Get a pipeline run record

This request retrieves detail of requested pipeline run, to get Kubernetes Resources List of this pipeline run use endpoint /tekton_pipelines/{pipeline_id}/tekton_pipelinerun_resource_list/{id}

GET /tekton_pipelines/{pipeline_id}/pipeline_runs/{id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Query Parameters

  • Defines if response includes definition metadata

    Allowable values: [definitions]

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: definitions

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs/{id}?includes=definitions"
  • getTektonPipelineRunOptions := cdTektonPipelineService.NewGetTektonPipelineRunOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    getTektonPipelineRunOptions.SetIncludes("definitions")
    
    pipelineRun, response, err := cdTektonPipelineService.GetTektonPipelineRun(getTektonPipelineRunOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(pipelineRun, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
      includes: 'definitions',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.getTektonPipelineRun(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • GetTektonPipelineRunOptions getTektonPipelineRunOptions = new GetTektonPipelineRunOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .includes("definitions")
      .build();
    
    Response<PipelineRun> response = cdTektonPipelineService.getTektonPipelineRun(getTektonPipelineRunOptions).execute();
    PipelineRun pipelineRun = response.getResult();
    
    System.out.println(pipelineRun);
  • pipeline_run = cd_tekton_pipeline_service.get_tekton_pipeline_run(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      id='94619026-912b-4d92-8f51-6c74f0692d90',
      includes='definitions'
    ).get_result()
    
    print(json.dumps(pipeline_run, indent=2))

Response

Single tekton pipeline run object

Status Code

  • Pipeline run detail

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "id": "1681024e-4dfe-40dd-922b-b55719120078",
      "worker": {
        "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f",
        "agent": "a2fd3205-0d94-47e1-a867-444a6185db51",
        "service_id": "ServiceId-43c88414-f9f7-44da-95b5-91bf55722025",
        "name": "public"
      },
      "user_info": {
        "iam_id": "IBMid-310001SNXX",
        "sub": "firstname@domain.com"
      },
      "status": "succeeded",
      "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90",
      "event_params_blob": "{\"message\":\"hello world\",\"flag\":\"no-go\",\"properties\":[{\"name\":\"pipeline-debug\",\"value\":\"from-API\",\"type\":\"TEXT\"},{\"name\":\"pipeline-debug-2\",\"value\":\"from-api-2\",\"type\":\"TEXT\"}]}",
      "event_header_params_blob": "{\"x-forwarded-proto\":\"https\",\"user_iam_id\":\"IBMid-310001SNXX\",\"user_sub\":\"firstname@domain.com\",\"transaction-id\":\"95fd8923-fd75-4792-bfdd-07fd55d64fdc\",\"location\":\"my-post-man\",\"source\":\"post-man\",\"accept\":\"application/json\",\"x-request-id\":\"9292303b-92cd-48b2-9d80-e89cd0a19b3c\",\"x-b3-traceid\":\"8d423b020f5a9d30f2b505f644d9c1d5\",\"x-b3-spanid\":\"ee3d59e5925ce12f\",\"x-b3-parentspanid\":\"f2b505f644d9c1d5\",\"x-b3-sampled\":\"0\"}",
      "definition_id": "ee41a181-afed-4308-bf2a-84d6c677a005",
      "listener_name": "manual-listener",
      "created": "2021-11-23T21:28:03.824Z",
      "updated_at": "2022-01-28T19:05:45.764Z",
      "build_number": 1387,
      "trigger": {
        "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57",
        "name": "manual-trigger",
        "disabled": false,
        "type": "manual",
        "event_listener": "manual-listener",
        "properties": [
          {
            "name": "new",
            "value": "123",
            "type": "TEXT"
          }
        ]
      },
      "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/1681024e-4dfe-40dd-922b-b55719120078",
      "html_url": "https://cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90/runs/1681024e-4dfe-40dd-922b-b55719120078?env_id=ibm:ys1:us-south",
      "definitions": [
        {
          "sha": "4162b1ebfd45538b5e258baf8cd51f3425149d03",
          "repo_url": "https://github.com/IBM/tekton-tutorial.git",
          "definition_id": "e92705ed-e0a0-4f3a-94ed-830df2c4f7fd",
          "path": ".tekton",
          "commit_url": "https://github.com/IBM/tekton-tutorial/commit/4162b1ebfd45538b5e258baf8cd51f3425149d03"
        }
      ]
    }

Delete a pipeline run record

This request deletes the requested pipeline run record

DELETE /tekton_pipelines/{pipeline_id}/pipeline_runs/{id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs/{id}"
  • deleteTektonPipelineRunOptions := cdTektonPipelineService.NewDeleteTektonPipelineRunOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    
    response, err := cdTektonPipelineService.DeleteTektonPipelineRun(deleteTektonPipelineRunOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteTektonPipelineRun(): %d\n", response.StatusCode)
    }
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
    };
    
    try {
      await cdTektonPipelineService.deleteTektonPipelineRun(params);
    } catch (err) {
      console.warn(err);
    }
  • DeleteTektonPipelineRunOptions deleteTektonPipelineRunOptions = new DeleteTektonPipelineRunOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .build();
    
    Response<Void> response = cdTektonPipelineService.deleteTektonPipelineRun(deleteTektonPipelineRunOptions).execute();
  • response = cd_tekton_pipeline_service.delete_tekton_pipeline_run(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      id='94619026-912b-4d92-8f51-6c74f0692d90'
    )

Response

Status Code

  • Pipeline run deleted

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

No Sample Response

This method does not specify any sample responses.

Cancel a pipeline run

This request cancels a running pipeline run, use 'force' payload in case you can't cancel a pipeline run normally

POST /tekton_pipelines/{pipeline_id}/pipeline_runs/{id}/cancel

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Force the pipeline run status to be 'cancelled' in case you can't cancel a pipeline run normally

Examples:
force_cancel
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "force": true }'   "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs/{id}/cancel"
  • cancelTektonPipelineRunOptions := cdTektonPipelineService.NewCancelTektonPipelineRunOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    cancelTektonPipelineRunOptions.SetForce(true)
    
    pipelineRun, response, err := cdTektonPipelineService.CancelTektonPipelineRun(cancelTektonPipelineRunOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(pipelineRun, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
      force: true,
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.cancelTektonPipelineRun(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • CancelTektonPipelineRunOptions cancelTektonPipelineRunOptions = new CancelTektonPipelineRunOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .force(true)
      .build();
    
    Response<PipelineRun> response = cdTektonPipelineService.cancelTektonPipelineRun(cancelTektonPipelineRunOptions).execute();
    PipelineRun pipelineRun = response.getResult();
    
    System.out.println(pipelineRun);
  • pipeline_run = cd_tekton_pipeline_service.cancel_tekton_pipeline_run(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      id='94619026-912b-4d92-8f51-6c74f0692d90',
      force=True
    ).get_result()
    
    print(json.dumps(pipeline_run, indent=2))

Response

Single tekton pipeline run object

Status Code

  • Pipeline run detail

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "id": "1681024e-4dfe-40dd-922b-b55719120078",
      "worker": {
        "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f",
        "agent": "a2fd3205-0d94-47e1-a867-444a6185db51",
        "service_id": "ServiceId-43c88414-f9f7-44da-95b5-91bf55722025",
        "name": "public"
      },
      "user_info": {
        "iam_id": "IBMid-310001SNXX",
        "sub": "firstname@domain.com"
      },
      "status": "cancelling",
      "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90",
      "event_params_blob": "{\"message\":\"hello world\",\"flag\":\"no-go\",\"properties\":[{\"name\":\"pipeline-debug\",\"value\":\"from-API\",\"type\":\"TEXT\"},{\"name\":\"pipeline-debug-2\",\"value\":\"from-api-2\",\"type\":\"TEXT\"}]}",
      "event_header_params_blob": "{\"x-forwarded-proto\":\"https\",\"user_iam_id\":\"IBMid-310001SNXX\",\"user_sub\":\"firstname@domain.com\",\"transaction-id\":\"95fd8923-fd75-4792-bfdd-07fd55d64fdc\",\"location\":\"my-post-man\",\"source\":\"post-man\",\"accept\":\"application/json\",\"x-request-id\":\"9292303b-92cd-48b2-9d80-e89cd0a19b3c\",\"x-b3-traceid\":\"8d423b020f5a9d30f2b505f644d9c1d5\",\"x-b3-spanid\":\"ee3d59e5925ce12f\",\"x-b3-parentspanid\":\"f2b505f644d9c1d5\",\"x-b3-sampled\":\"0\"}",
      "definition_id": "ee41a181-afed-4308-bf2a-84d6c677a005",
      "listener_name": "manual-listener",
      "created": "2021-11-23T21:28:03.824Z",
      "updated_at": "2022-01-28T19:05:45.764Z",
      "build_number": 1387,
      "trigger": {
        "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57",
        "name": "manual-trigger",
        "type": "manual",
        "disabled": false,
        "event_listener": "manual-listener",
        "properties": [
          {
            "name": "new",
            "value": "123",
            "type": "TEXT"
          }
        ]
      },
      "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/1681024e-4dfe-40dd-922b-b55719120078",
      "html_url": "https://cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90/runs/1681024e-4dfe-40dd-922b-b55719120078?env_id=ibm:ys1:us-south",
      "definitions": [
        {
          "sha": "4162b1ebfd45538b5e258baf8cd51f3425149d03",
          "repo_url": "https://github.com/IBM/tekton-tutorial.git",
          "definition_id": "e92705ed-e0a0-4f3a-94ed-830df2c4f7fd",
          "path": ".tekton",
          "commit_url": "https://github.com/IBM/tekton-tutorial/commit/4162b1ebfd45538b5e258baf8cd51f3425149d03"
        }
      ]
    }

Rerun a pipeline run

This request reruns a past pipeline run with same data. Request body isn't allowed.

POST /tekton_pipelines/{pipeline_id}/pipeline_runs/{id}/rerun

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs/{id}/rerun"
  • rerunTektonPipelineRunOptions := cdTektonPipelineService.NewRerunTektonPipelineRunOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    
    pipelineRun, response, err := cdTektonPipelineService.RerunTektonPipelineRun(rerunTektonPipelineRunOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(pipelineRun, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.rerunTektonPipelineRun(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • RerunTektonPipelineRunOptions rerunTektonPipelineRunOptions = new RerunTektonPipelineRunOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .build();
    
    Response<PipelineRun> response = cdTektonPipelineService.rerunTektonPipelineRun(rerunTektonPipelineRunOptions).execute();
    PipelineRun pipelineRun = response.getResult();
    
    System.out.println(pipelineRun);
  • pipeline_run = cd_tekton_pipeline_service.rerun_tekton_pipeline_run(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      id='94619026-912b-4d92-8f51-6c74f0692d90'
    ).get_result()
    
    print(json.dumps(pipeline_run, indent=2))

Response

Single tekton pipeline run object

Status Code

  • Pipeline run detail

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "id": "1681024e-4dfe-40dd-922b-b55719120078",
      "worker": {
        "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f",
        "agent": "a2fd3205-0d94-47e1-a867-444a6185db51",
        "service_id": "ServiceId-43c88414-f9f7-44da-95b5-91bf55722025",
        "name": "public"
      },
      "user_info": {
        "iam_id": "IBMid-310001SNXX",
        "sub": "firstname@domain.com"
      },
      "status": "waiting",
      "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90",
      "event_params_blob": "{\"message\":\"hello world\",\"flag\":\"no-go\",\"properties\":[{\"name\":\"pipeline-debug\",\"value\":\"from-API\",\"type\":\"TEXT\"},{\"name\":\"pipeline-debug-2\",\"value\":\"from-api-2\",\"type\":\"TEXT\"}]}",
      "event_header_params_blob": "{\"x-forwarded-proto\":\"https\",\"user_iam_id\":\"IBMid-310001SNXX\",\"user_sub\":\"firstname@domain.com\",\"transaction-id\":\"95fd8923-fd75-4792-bfdd-07fd55d64fdc\",\"location\":\"my-post-man\",\"source\":\"post-man\",\"accept\":\"application/json\",\"x-request-id\":\"9292303b-92cd-48b2-9d80-e89cd0a19b3c\",\"x-b3-traceid\":\"8d423b020f5a9d30f2b505f644d9c1d5\",\"x-b3-spanid\":\"ee3d59e5925ce12f\",\"x-b3-parentspanid\":\"f2b505f644d9c1d5\",\"x-b3-sampled\":\"0\"}",
      "definition_id": "ee41a181-afed-4308-bf2a-84d6c677a005",
      "listener_name": "manual-listener",
      "created": "2021-11-23T21:28:03.824Z",
      "updated_at": "2022-01-28T19:05:45.764Z",
      "build_number": 1387,
      "trigger": {
        "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57",
        "name": "manual-trigger",
        "type": "manual",
        "disabled": false,
        "event_listener": "manual-listener",
        "properties": [
          {
            "name": "new",
            "value": "123",
            "type": "TEXT"
          }
        ]
      },
      "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/1681024e-4dfe-40dd-922b-b55719120078",
      "html_url": "https://cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90/runs/1681024e-4dfe-40dd-922b-b55719120078?env_id=ibm:ys1:us-south",
      "definitions": [
        {
          "sha": "4162b1ebfd45538b5e258baf8cd51f3425149d03",
          "repo_url": "https://github.com/IBM/tekton-tutorial.git",
          "definition_id": "e92705ed-e0a0-4f3a-94ed-830df2c4f7fd",
          "path": ".tekton",
          "commit_url": "https://github.com/IBM/tekton-tutorial/commit/4162b1ebfd45538b5e258baf8cd51f3425149d03"
        }
      ]
    }

Get a list of pipeline run log IDs

This request fetches list of log IDs of a pipeline run

GET /tekton_pipelines/{pipeline_id}/pipeline_runs/{id}/logs

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs/{id}/logs"
  • getTektonPipelineRunLogsOptions := cdTektonPipelineService.NewGetTektonPipelineRunLogsOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    
    pipelineRunLogs, response, err := cdTektonPipelineService.GetTektonPipelineRunLogs(getTektonPipelineRunLogsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(pipelineRunLogs, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.getTektonPipelineRunLogs(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • GetTektonPipelineRunLogsOptions getTektonPipelineRunLogsOptions = new GetTektonPipelineRunLogsOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .build();
    
    Response<PipelineRunLogs> response = cdTektonPipelineService.getTektonPipelineRunLogs(getTektonPipelineRunLogsOptions).execute();
    PipelineRunLogs pipelineRunLogs = response.getResult();
    
    System.out.println(pipelineRunLogs);
  • pipeline_run_logs = cd_tekton_pipeline_service.get_tekton_pipeline_run_logs(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      id='94619026-912b-4d92-8f51-6c74f0692d90'
    ).get_result()
    
    print(json.dumps(pipeline_run_logs, indent=2))

Response

List of pipeline run log ID object

Status Code

  • Pipeline run log IDs list

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "logs": [
        {
          "name": "pipelinerun-e1e46c2d-d260-48b6-85a8-884e596b904e-console--92ll6/echo-text-step-0",
          "id": "031903d9-0893-4681-b3a3-b736ed03f0fd",
          "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/e1e46c2d-d260-48b6-85a8-884e596b904e/logs/031903d9-0893-4681-b3a3-b736ed03f0fd"
        },
        {
          "name": "pipelinerun-e1e46c2d-d260-48b6-85a8-884e596b904e-console--92ll6/echo-text-step-1",
          "id": "0b5f5501-cc97-442c-9786-e70d3d12319a",
          "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/e1e46c2d-d260-48b6-85a8-884e596b904e/logs/0b5f5501-cc97-442c-9786-e70d3d12319a"
        }
      ]
    }

Get the log content of a pipeline run step by using the step log ID

This request retrieves log content of a pipeline run step, to get the log ID use endpoint /tekton_pipelines/{pipeline_id}/pipeline_runs/{id}/logs

GET /tekton_pipelines/{pipeline_id}/pipeline_runs/{pipeline_run_id}/logs/{id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The tekton pipeline run ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: bf4b3abd-0c93-416b-911e-9cf42f1a1085

  • ID of current instance

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs/{pipeline_run_id}/logs/{id}"
  • getTektonPipelineRunLogContentOptions := cdTektonPipelineService.NewGetTektonPipelineRunLogContentOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "bf4b3abd-0c93-416b-911e-9cf42f1a1085",
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    
    stepLog, response, err := cdTektonPipelineService.GetTektonPipelineRunLogContent(getTektonPipelineRunLogContentOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(stepLog, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      pipelineRunId: 'bf4b3abd-0c93-416b-911e-9cf42f1a1085',
      id: '94619026-912b-4d92-8f51-6c74f0692d90',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.getTektonPipelineRunLogContent(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • GetTektonPipelineRunLogContentOptions getTektonPipelineRunLogContentOptions = new GetTektonPipelineRunLogContentOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .pipelineRunId("bf4b3abd-0c93-416b-911e-9cf42f1a1085")
      .id("94619026-912b-4d92-8f51-6c74f0692d90")
      .build();
    
    Response<StepLog> response = cdTektonPipelineService.getTektonPipelineRunLogContent(getTektonPipelineRunLogContentOptions).execute();
    StepLog stepLog = response.getResult();
    
    System.out.println(stepLog);
  • step_log = cd_tekton_pipeline_service.get_tekton_pipeline_run_log_content(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      pipeline_run_id='bf4b3abd-0c93-416b-911e-9cf42f1a1085',
      id='94619026-912b-4d92-8f51-6c74f0692d90'
    ).get_result()
    
    print(json.dumps(step_log, indent=2))

Response

Log object for tekton pipeline run step

Status Code

  • Log content of a step

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "data": "log content",
      "id": "e92705ed-e0a0-4f3a-94ed-830df2c4f7fd"
    }

List pipeline definitions

This request fetches pipeline definitions, which is the a collection of individual definition entries, each entry is a composition of a repo url, a repo branch and a repo path.

GET /tekton_pipelines/{pipeline_id}/definitions

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/definitions"
  • listTektonPipelineDefinitionsOptions := cdTektonPipelineService.NewListTektonPipelineDefinitionsOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    
    definitions, response, err := cdTektonPipelineService.ListTektonPipelineDefinitions(listTektonPipelineDefinitionsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(definitions, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.listTektonPipelineDefinitions(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • ListTektonPipelineDefinitionsOptions listTektonPipelineDefinitionsOptions = new ListTektonPipelineDefinitionsOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .build();
    
    Response<Definitions> response = cdTektonPipelineService.listTektonPipelineDefinitions(listTektonPipelineDefinitionsOptions).execute();
    Definitions definitions = response.getResult();
    
    System.out.println(definitions);
  • definitions = cd_tekton_pipeline_service.list_tekton_pipeline_definitions(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90'
    ).get_result()
    
    print(json.dumps(definitions, indent=2))

Response

Pipeline definitions is a collection of individual definition entries, each entry is a composition of a repo url, repo branch/tag and a certain directory path.

Status Code

  • List of pipeline definitions

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "definitions": [
        {
          "scm_source": {
            "path": ".tekton",
            "url": "https://github.com/IBM/tekton-tutorial.git",
            "branch": "master"
          },
          "service_instance_id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6",
          "id": "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada",
          "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/definitions/94299034-d45f-4e9a-8ed5-6bd5c7bb7ada"
        }
      ]
    }

Create a single definition

This request adds a single definition

POST /tekton_pipelines/{pipeline_id}/definitions

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Request body used to create a single definition entry

Examples:
definition
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "scm_source": { "path": ".tekton", "url": "https://github.com/IBM/tekton-tutorial.git", "branch": "master" } }'   "{base_url}/tekton_pipelines/{pipeline_id}/definitions"
  • definitionScmSourceModel := &cdtektonpipelinev2.DefinitionScmSource{
      URL: core.StringPtr("https://github.com/IBM/tekton-tutorial.git"),
      Branch: core.StringPtr("master"),
      Path: core.StringPtr(".tekton"),
    }
    
    createTektonPipelineDefinitionOptions := cdTektonPipelineService.NewCreateTektonPipelineDefinitionOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    createTektonPipelineDefinitionOptions.SetScmSource(definitionScmSourceModel)
    
    definition, response, err := cdTektonPipelineService.CreateTektonPipelineDefinition(createTektonPipelineDefinitionOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(definition, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // DefinitionScmSource
    const definitionScmSourceModel = {
      url: 'https://github.com/IBM/tekton-tutorial.git',
      branch: 'master',
      path: '.tekton',
    };
    
    const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      scmSource: definitionScmSourceModel,
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.createTektonPipelineDefinition(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • DefinitionScmSource definitionScmSourceModel = new DefinitionScmSource.Builder()
      .url("https://github.com/IBM/tekton-tutorial.git")
      .branch("master")
      .path(".tekton")
      .build();
    CreateTektonPipelineDefinitionOptions createTektonPipelineDefinitionOptions = new CreateTektonPipelineDefinitionOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .scmSource(definitionScmSourceModel)
      .build();
    
    Response<Definition> response = cdTektonPipelineService.createTektonPipelineDefinition(createTektonPipelineDefinitionOptions).execute();
    Definition definition = response.getResult();
    
    System.out.println(definition);
  • definition_scm_source_model = {
      'url': 'https://github.com/IBM/tekton-tutorial.git',
      'branch': 'master',
      'path': '.tekton',
    }
    
    definition = cd_tekton_pipeline_service.create_tekton_pipeline_definition(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      scm_source=definition_scm_source_model
    ).get_result()
    
    print(json.dumps(definition, indent=2))

Response

Tekton pipeline definition entry object

Status Code

  • the definition added

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "scm_source": {
        "path": ".tekton",
        "url": "https://github.com/IBM/tekton-tutorial.git",
        "branch": "master"
      },
      "service_instance_id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6",
      "id": "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada"
    }

Retrieve a single definition entry

This request fetches a single definition entry, which is a composition of the definition repo's url, branch and directory path

GET /tekton_pipelines/{pipeline_id}/definitions/{definition_id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The definition ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94299034-d45f-4e9a-8ed5-6bd5c7bb7ada

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/definitions/{definition_id}"
  • getTektonPipelineDefinitionOptions := cdTektonPipelineService.NewGetTektonPipelineDefinitionOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada",
    )
    
    definition, response, err := cdTektonPipelineService.GetTektonPipelineDefinition(getTektonPipelineDefinitionOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(definition, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      definitionId: '94299034-d45f-4e9a-8ed5-6bd5c7bb7ada',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.getTektonPipelineDefinition(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • GetTektonPipelineDefinitionOptions getTektonPipelineDefinitionOptions = new GetTektonPipelineDefinitionOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .definitionId("94299034-d45f-4e9a-8ed5-6bd5c7bb7ada")
      .build();
    
    Response<Definition> response = cdTektonPipelineService.getTektonPipelineDefinition(getTektonPipelineDefinitionOptions).execute();
    Definition definition = response.getResult();
    
    System.out.println(definition);
  • definition = cd_tekton_pipeline_service.get_tekton_pipeline_definition(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      definition_id='94299034-d45f-4e9a-8ed5-6bd5c7bb7ada'
    ).get_result()
    
    print(json.dumps(definition, indent=2))

Response

Tekton pipeline definition entry object

Status Code

  • the requested definition entry

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "scm_source": {
        "path": ".tekton",
        "url": "https://github.com/IBM/tekton-tutorial.git",
        "branch": "master"
      },
      "service_instance_id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6",
      "id": "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada"
    }

Edit a single definition entry

This request replaces a single definition's repo directory path or repo branch. Its scm_source.url and service_instance_id are immutable.

PUT /tekton_pipelines/{pipeline_id}/definitions/{definition_id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The definition ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94299034-d45f-4e9a-8ed5-6bd5c7bb7ada

Tekton pipeline definition entry object

Examples:
definition
  • curl -X PUT --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "scm_source": { "path": ".tekton", "url": "https://github.com/IBM/tekton-tutorial.git", "branch": "master" }, "id": "22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f", "service_instance_id": "071d8049-d984-4feb-a2ed-2a1e938918ba" }'   "{base_url}/tekton_pipelines/{pipeline_id}/definitions/{definition_id}"
  • definitionScmSourceModel := &cdtektonpipelinev2.DefinitionScmSource{
      URL: core.StringPtr("https://github.com/IBM/tekton-tutorial.git"),
      Branch: core.StringPtr("master"),
      Path: core.StringPtr(".tekton"),
    }
    
    replaceTektonPipelineDefinitionOptions := cdTektonPipelineService.NewReplaceTektonPipelineDefinitionOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada",
    )
    replaceTektonPipelineDefinitionOptions.SetScmSource(definitionScmSourceModel)
    replaceTektonPipelineDefinitionOptions.SetServiceInstanceID("071d8049-d984-4feb-a2ed-2a1e938918ba")
    replaceTektonPipelineDefinitionOptions.SetID("22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f")
    
    definition, response, err := cdTektonPipelineService.ReplaceTektonPipelineDefinition(replaceTektonPipelineDefinitionOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(definition, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // DefinitionScmSource
    const definitionScmSourceModel = {
      url: 'https://github.com/IBM/tekton-tutorial.git',
      branch: 'master',
      path: '.tekton',
    };
    
    const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      definitionId: '94299034-d45f-4e9a-8ed5-6bd5c7bb7ada',
      scmSource: definitionScmSourceModel,
      serviceInstanceId: '071d8049-d984-4feb-a2ed-2a1e938918ba',
      id: '22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.replaceTektonPipelineDefinition(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • DefinitionScmSource definitionScmSourceModel = new DefinitionScmSource.Builder()
      .url("https://github.com/IBM/tekton-tutorial.git")
      .branch("master")
      .path(".tekton")
      .build();
    ReplaceTektonPipelineDefinitionOptions replaceTektonPipelineDefinitionOptions = new ReplaceTektonPipelineDefinitionOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .definitionId("94299034-d45f-4e9a-8ed5-6bd5c7bb7ada")
      .scmSource(definitionScmSourceModel)
      .serviceInstanceId("071d8049-d984-4feb-a2ed-2a1e938918ba")
      .id("22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f")
      .build();
    
    Response<Definition> response = cdTektonPipelineService.replaceTektonPipelineDefinition(replaceTektonPipelineDefinitionOptions).execute();
    Definition definition = response.getResult();
    
    System.out.println(definition);
  • definition_scm_source_model = {
      'url': 'https://github.com/IBM/tekton-tutorial.git',
      'branch': 'master',
      'path': '.tekton',
    }
    
    definition = cd_tekton_pipeline_service.replace_tekton_pipeline_definition(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      definition_id='94299034-d45f-4e9a-8ed5-6bd5c7bb7ada',
      scm_source=definition_scm_source_model,
      service_instance_id='071d8049-d984-4feb-a2ed-2a1e938918ba',
      id='22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f'
    ).get_result()
    
    print(json.dumps(definition, indent=2))

Response

Tekton pipeline definition entry object

Status Code

  • Updated definition metadata

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "scm_source": {
        "path": ".tekton",
        "url": "https://github.com/IBM/tekton-tutorial.git",
        "branch": "master"
      },
      "service_instance_id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6",
      "id": "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada"
    }

Delete a single definition entry

This request deletes a single definition from definition list

DELETE /tekton_pipelines/{pipeline_id}/definitions/{definition_id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The definition ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94299034-d45f-4e9a-8ed5-6bd5c7bb7ada

  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   "{base_url}/tekton_pipelines/{pipeline_id}/definitions/{definition_id}"
  • deleteTektonPipelineDefinitionOptions := cdTektonPipelineService.NewDeleteTektonPipelineDefinitionOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada",
    )
    
    response, err := cdTektonPipelineService.DeleteTektonPipelineDefinition(deleteTektonPipelineDefinitionOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteTektonPipelineDefinition(): %d\n", response.StatusCode)
    }
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      definitionId: '94299034-d45f-4e9a-8ed5-6bd5c7bb7ada',
    };
    
    try {
      await cdTektonPipelineService.deleteTektonPipelineDefinition(params);
    } catch (err) {
      console.warn(err);
    }
  • DeleteTektonPipelineDefinitionOptions deleteTektonPipelineDefinitionOptions = new DeleteTektonPipelineDefinitionOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .definitionId("94299034-d45f-4e9a-8ed5-6bd5c7bb7ada")
      .build();
    
    Response<Void> response = cdTektonPipelineService.deleteTektonPipelineDefinition(deleteTektonPipelineDefinitionOptions).execute();
  • response = cd_tekton_pipeline_service.delete_tekton_pipeline_definition(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      definition_id='94299034-d45f-4e9a-8ed5-6bd5c7bb7ada'
    )

Response

Status Code

  • definition deleted

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

No Sample Response

This method does not specify any sample responses.

List pipeline environment properties

This request lists the pipeline environment properties which every pipelineRun execution has access to

GET /tekton_pipelines/{pipeline_id}/properties

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Query Parameters

  • Filters the collection to resources with the specified property name

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: prod

  • Filters the collection to resources with the specified property type

    Allowable values: [SECURE,TEXT,INTEGRATION,SINGLE_SELECT,APPCONFIG]

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Examples:
    View
  • Sorts the returned properties by a property field, for properties you can sort them alphabetically by "name" in ascending order or with "-name" in descending order

    Allowable values: [name,-name]

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: name

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/properties?name=prod&type=[ "SECURE", "TEXT" ]&sort=name"
  • listTektonPipelinePropertiesOptions := cdTektonPipelineService.NewListTektonPipelinePropertiesOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    listTektonPipelinePropertiesOptions.SetName("prod")
    listTektonPipelinePropertiesOptions.SetType([]string{"SECURE", "TEXT"})
    listTektonPipelinePropertiesOptions.SetSort("name")
    
    envProperties, response, err := cdTektonPipelineService.ListTektonPipelineProperties(listTektonPipelinePropertiesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(envProperties, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      name: 'prod',
      type: ['SECURE', 'TEXT'],
      sort: 'name',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.listTektonPipelineProperties(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • ListTektonPipelinePropertiesOptions listTektonPipelinePropertiesOptions = new ListTektonPipelinePropertiesOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .name("prod")
      .type(new java.util.ArrayList<String>(java.util.Arrays.asList("SECURE", "TEXT")))
      .sort("name")
      .build();
    
    Response<EnvProperties> response = cdTektonPipelineService.listTektonPipelineProperties(listTektonPipelinePropertiesOptions).execute();
    EnvProperties envProperties = response.getResult();
    
    System.out.println(envProperties);
  • env_properties = cd_tekton_pipeline_service.list_tekton_pipeline_properties(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      name='prod',
      type=['SECURE', 'TEXT'],
      sort='name'
    ).get_result()
    
    print(json.dumps(env_properties, indent=2))

Response

Pipeline properties object

Status Code

  • List of pipeline's environment properties

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "properties": [
        {
          "name": "ad123",
          "value": "ad123-value",
          "type": "TEXT",
          "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123"
        }
      ]
    }

Create pipeline environment property

This request creates a single pipeline environment property

POST /tekton_pipelines/{pipeline_id}/properties

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Property object

Examples:
text_env_property
secure_env_property
single_select_env_properties
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "name": "key1", "value": "https://github.com/IBM/tekton-tutorial.git", "type": "TEXT" }'   "{base_url}/tekton_pipelines/{pipeline_id}/properties"
  • createTektonPipelinePropertiesOptions := cdTektonPipelineService.NewCreateTektonPipelinePropertiesOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    createTektonPipelinePropertiesOptions.SetName("key1")
    createTektonPipelinePropertiesOptions.SetValue("https://github.com/IBM/tekton-tutorial.git")
    createTektonPipelinePropertiesOptions.SetType("TEXT")
    
    property, response, err := cdTektonPipelineService.CreateTektonPipelineProperties(createTektonPipelinePropertiesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(property, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      name: 'key1',
      type: 'TEXT',
      value: 'https://github.com/IBM/tekton-tutorial.git',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.createTektonPipelineProperties(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • CreateTektonPipelinePropertiesOptions createTektonPipelinePropertiesOptions = new CreateTektonPipelinePropertiesOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .name("key1")
      .value("https://github.com/IBM/tekton-tutorial.git")
      .type("TEXT")
      .build();
    
    Response<Property> response = cdTektonPipelineService.createTektonPipelineProperties(createTektonPipelinePropertiesOptions).execute();
    Property property = response.getResult();
    
    System.out.println(property);
  • property = cd_tekton_pipeline_service.create_tekton_pipeline_properties(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      name='key1',
      type='TEXT',
      value='https://github.com/IBM/tekton-tutorial.git'
    ).get_result()
    
    print(json.dumps(property, indent=2))

Response

Property object

Status Code

  • env_property added

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ad123",
      "value": "ad123-value",
      "type": "TEXT"
    }

Get a single pipeline environment property

This request gets a single pipeline environment property data

GET /tekton_pipelines/{pipeline_id}/properties/{property_name}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The property's name

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_.]{1,234}$

    Example: debug-pipeline

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/properties/{property_name}"
  • getTektonPipelinePropertyOptions := cdTektonPipelineService.NewGetTektonPipelinePropertyOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "debug-pipeline",
    )
    
    property, response, err := cdTektonPipelineService.GetTektonPipelineProperty(getTektonPipelinePropertyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(property, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      propertyName: 'debug-pipeline',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.getTektonPipelineProperty(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • GetTektonPipelinePropertyOptions getTektonPipelinePropertyOptions = new GetTektonPipelinePropertyOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .propertyName("debug-pipeline")
      .build();
    
    Response<Property> response = cdTektonPipelineService.getTektonPipelineProperty(getTektonPipelinePropertyOptions).execute();
    Property property = response.getResult();
    
    System.out.println(property);
  • property = cd_tekton_pipeline_service.get_tekton_pipeline_property(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      property_name='debug-pipeline'
    ).get_result()
    
    print(json.dumps(property, indent=2))

Response

Property object

Status Code

  • Single property

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ad123",
      "value": "ad123-value",
      "type": "TEXT"
    }

Replace a single pipeline environment property value

This request updates a single pipeline environment property value, its type or name are immutable. For any property type, the entered value replaces the existing value

PUT /tekton_pipelines/{pipeline_id}/properties/{property_name}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The property's name

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_.]{1,234}$

    Example: debug-pipeline

Property object

Examples:
single_env_property
  • curl -X PUT --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "name": "key1", "value": "https://github.com/IBM/tekton-tutorial.git", "type": "TEXT" }'   "{base_url}/tekton_pipelines/{pipeline_id}/properties/{property_name}"
  • replaceTektonPipelinePropertyOptions := cdTektonPipelineService.NewReplaceTektonPipelinePropertyOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "debug-pipeline",
    )
    replaceTektonPipelinePropertyOptions.SetName("key1")
    replaceTektonPipelinePropertyOptions.SetValue("https://github.com/IBM/tekton-tutorial.git")
    replaceTektonPipelinePropertyOptions.SetType("TEXT")
    
    property, response, err := cdTektonPipelineService.ReplaceTektonPipelineProperty(replaceTektonPipelinePropertyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(property, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      propertyName: 'debug-pipeline',
      name: 'key1',
      type: 'TEXT',
      value: 'https://github.com/IBM/tekton-tutorial.git',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.replaceTektonPipelineProperty(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • ReplaceTektonPipelinePropertyOptions replaceTektonPipelinePropertyOptions = new ReplaceTektonPipelinePropertyOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .propertyName("debug-pipeline")
      .name("key1")
      .value("https://github.com/IBM/tekton-tutorial.git")
      .type("TEXT")
      .build();
    
    Response<Property> response = cdTektonPipelineService.replaceTektonPipelineProperty(replaceTektonPipelinePropertyOptions).execute();
    Property property = response.getResult();
    
    System.out.println(property);
  • property = cd_tekton_pipeline_service.replace_tekton_pipeline_property(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      property_name='debug-pipeline',
      name='key1',
      type='TEXT',
      value='https://github.com/IBM/tekton-tutorial.git'
    ).get_result()
    
    print(json.dumps(property, indent=2))

Response

Property object

Status Code

  • Replaced pipeline property

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ad123",
      "value": "ad123-value",
      "type": "TEXT"
    }

Delete a single pipeline environment property

This request deletes a single pipeline environment property

DELETE /tekton_pipelines/{pipeline_id}/properties/{property_name}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The property's name

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_.]{1,234}$

    Example: debug-pipeline

  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   "{base_url}/tekton_pipelines/{pipeline_id}/properties/{property_name}"
  • deleteTektonPipelinePropertyOptions := cdTektonPipelineService.NewDeleteTektonPipelinePropertyOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "debug-pipeline",
    )
    
    response, err := cdTektonPipelineService.DeleteTektonPipelineProperty(deleteTektonPipelinePropertyOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteTektonPipelineProperty(): %d\n", response.StatusCode)
    }
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      propertyName: 'debug-pipeline',
    };
    
    try {
      await cdTektonPipelineService.deleteTektonPipelineProperty(params);
    } catch (err) {
      console.warn(err);
    }
  • DeleteTektonPipelinePropertyOptions deleteTektonPipelinePropertyOptions = new DeleteTektonPipelinePropertyOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .propertyName("debug-pipeline")
      .build();
    
    Response<Void> response = cdTektonPipelineService.deleteTektonPipelineProperty(deleteTektonPipelinePropertyOptions).execute();
  • response = cd_tekton_pipeline_service.delete_tekton_pipeline_property(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      property_name='debug-pipeline'
    )

Response

Status Code

  • Property deleted

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

No Sample Response

This method does not specify any sample responses.

List pipeline triggers

This request lists pipeline triggers

GET /tekton_pipelines/{pipeline_id}/triggers

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

Query Parameters

  • filter the triggers by trigger "type", possible values are "manual", "scm", "generic", "timer"

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: manual,scm

  • filter the triggers by trigger "name", accept single string value

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

  • filter the triggers by trigger "event_listener", accept single string value

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

  • filter the triggers by trigger "worker.id", accept single string value

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

  • filter the triggers by trigger "worker.name", accept single string value

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

  • filter the triggers by trigger "disabled" flag, possbile state are "true" and "false"

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: true

  • filter the triggers by trigger "tags", the response lists triggers if it has one matching tag

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: tag1,tag2

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/triggers?type=manual,scm&disabled=true&tags=tag1,tag2"
  • listTektonPipelineTriggersOptions := cdTektonPipelineService.NewListTektonPipelineTriggersOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    listTektonPipelineTriggersOptions.SetType("manual,scm")
    listTektonPipelineTriggersOptions.SetDisabled("true")
    listTektonPipelineTriggersOptions.SetTags("tag1,tag2")
    
    triggers, response, err := cdTektonPipelineService.ListTektonPipelineTriggers(listTektonPipelineTriggersOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(triggers, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      type: 'manual,scm',
      disabled: 'true',
      tags: 'tag1,tag2',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.listTektonPipelineTriggers(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • ListTektonPipelineTriggersOptions listTektonPipelineTriggersOptions = new ListTektonPipelineTriggersOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .type("manual,scm")
      .disabled("true")
      .tags("tag1,tag2")
      .build();
    
    Response<Triggers> response = cdTektonPipelineService.listTektonPipelineTriggers(listTektonPipelineTriggersOptions).execute();
    Triggers triggers = response.getResult();
    
    System.out.println(triggers);
  • triggers = cd_tekton_pipeline_service.list_tekton_pipeline_triggers(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      type='manual,scm',
      disabled='true',
      tags='tag1,tag2'
    ).get_result()
    
    print(json.dumps(triggers, indent=2))

Response

Tekton pipeline triggers object.

Status Code

  • List of pipeline triggers

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "triggers": [
        {
          "type": "scm",
          "name": "git-trigger",
          "event_listener": "pr-listener",
          "id": "50283ad5-90f3-48f1-9a59-47e8abf0062b",
          "disabled": false,
          "tags": [
            "tag1",
            "tag2"
          ],
          "properties": [
            {
              "name": "asd",
              "value": "asd",
              "type": "TEXT",
              "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/50283ad5-90f3-48f1-9a59-47e8abf0062b/properties/asd"
            }
          ],
          "scm_source": {
            "url": "https://github.com/IBM/tekton-tutorial.git",
            "blind_connection": false,
            "branch": "master",
            "hook_id": "330377364"
          },
          "service_instance_id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6",
          "events": {
            "push": true,
            "pull_request_closed": true,
            "pull_request": true
          },
          "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/50283ad5-90f3-48f1-9a59-47e8abf0062b"
        }
      ]
    }

Create a trigger or duplicate a trigger

This request creates a trigger or duplicate a trigger from an existing trigger

POST /tekton_pipelines/{pipeline_id}/triggers

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

request body to duplicate trigger

Example:
duplicate_trigger
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "name": "Generic Trigger- duplicated", "source_trigger_id": "b3a8228f-1c82-409b-b249-7639166a0300" }'   "{base_url}/tekton_pipelines/{pipeline_id}/triggers"
  • triggerModel := &cdtektonpipelinev2.TriggerDuplicateTrigger{
      SourceTriggerID: core.StringPtr("b3a8228f-1c82-409b-b249-7639166a0300"),
      Name: core.StringPtr("Generic Trigger- duplicated"),
    }
    
    createTektonPipelineTriggerOptions := cdTektonPipelineService.NewCreateTektonPipelineTriggerOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
    )
    createTektonPipelineTriggerOptions.SetTrigger(triggerModel)
    
    trigger, response, err := cdTektonPipelineService.CreateTektonPipelineTrigger(createTektonPipelineTriggerOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(trigger, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // TriggerDuplicateTrigger
    const triggerModel = {
      source_trigger_id: 'b3a8228f-1c82-409b-b249-7639166a0300',
      name: 'Generic Trigger- duplicated',
    };
    
    const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      trigger: triggerModel,
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.createTektonPipelineTrigger(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • TriggerDuplicateTrigger triggerModel = new TriggerDuplicateTrigger.Builder()
      .sourceTriggerId("b3a8228f-1c82-409b-b249-7639166a0300")
      .name("Generic Trigger- duplicated")
      .build();
    CreateTektonPipelineTriggerOptions createTektonPipelineTriggerOptions = new CreateTektonPipelineTriggerOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .trigger(triggerModel)
      .build();
    
    Response<Trigger> response = cdTektonPipelineService.createTektonPipelineTrigger(createTektonPipelineTriggerOptions).execute();
    Trigger trigger = response.getResult();
    
    System.out.println(trigger);
  • trigger_model = {
      'source_trigger_id': 'b3a8228f-1c82-409b-b249-7639166a0300',
      'name': 'Generic Trigger- duplicated',
    }
    
    trigger = cd_tekton_pipeline_service.create_tekton_pipeline_trigger(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger=trigger_model
    ).get_result()
    
    print(json.dumps(trigger, indent=2))

Response

Tekton pipeline trigger object

Status Code

  • the trigger created

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "type": "scm",
      "name": "git-trigger",
      "event_listener": "pr-listener",
      "disabled": false,
      "id": "50283ad5-90f3-48f1-9a59-47e8abf0062b",
      "tags": [
        "tag1",
        "tag2"
      ],
      "properties": [
        {
          "name": "asd",
          "value": "asd",
          "type": "TEXT",
          "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/50283ad5-90f3-48f1-9a59-47e8abf0062b/properties/asd"
        }
      ],
      "scm_source": {
        "url": "https://github.com/IBM/tekton-tutorial.git",
        "type": "GitHub",
        "blind_connection": false,
        "branch": "master",
        "hook_id": "330377364"
      },
      "service_instance_id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6",
      "events": {
        "push": true,
        "pull_request_closed": true,
        "pull_request": true
      }
    }

Get a single trigger

This request retrieves a single trigger detail

GET /tekton_pipelines/{pipeline_id}/triggers/{trigger_id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The trigger ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 1bb892a1-2e04-4768-a369-b1159eace147

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}"
  • getTektonPipelineTriggerOptions := cdTektonPipelineService.NewGetTektonPipelineTriggerOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "1bb892a1-2e04-4768-a369-b1159eace147",
    )
    
    trigger, response, err := cdTektonPipelineService.GetTektonPipelineTrigger(getTektonPipelineTriggerOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(trigger, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerId: '1bb892a1-2e04-4768-a369-b1159eace147',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.getTektonPipelineTrigger(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • GetTektonPipelineTriggerOptions getTektonPipelineTriggerOptions = new GetTektonPipelineTriggerOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerId("1bb892a1-2e04-4768-a369-b1159eace147")
      .build();
    
    Response<Trigger> response = cdTektonPipelineService.getTektonPipelineTrigger(getTektonPipelineTriggerOptions).execute();
    Trigger trigger = response.getResult();
    
    System.out.println(trigger);
  • trigger = cd_tekton_pipeline_service.get_tekton_pipeline_trigger(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_id='1bb892a1-2e04-4768-a369-b1159eace147'
    ).get_result()
    
    print(json.dumps(trigger, indent=2))

Response

Tekton pipeline trigger object

Status Code

  • the trigger requested

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "type": "generic",
      "name": "generic trigger",
      "event_listener": "pr-listener",
      "id": "62ec6bf4-8cb5-4713-b73a-7baaa9fa876e",
      "tags": [
        "tag2"
      ],
      "disabled": false,
      "secret": {
        "type": "digestMatches",
        "value": "hash:SHA3-512:4ce44af678a8acf09c99c2fb6b3b2b9f4e1d9fe016c268388f824cebed34f75c24f8177da5ea9d614fd2cd68ac35ad4da09d8f10f7f0216029f0639785552755",
        "source": "query",
        "key_name": "asd123",
        "algorithm": "md4"
      }
    }

Edit a single trigger entry

This request changes a single field or many fields of a trigger, note that some fields are immutable, and use /properties to update trigger properties

PATCH /tekton_pipelines/{pipeline_id}/triggers/{trigger_id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The trigger ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 1bb892a1-2e04-4768-a369-b1159eace147

Tekton pipeline trigger object used for updating

Examples:
change-trigger-name-state
change-git-trigger-branch
change-timer-trigger-cron
change-generic-trigger-secret
  • curl -X PATCH --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "name": "start-deploy", "disabled": true }'   "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}"
  • updateTektonPipelineTriggerOptions := cdTektonPipelineService.NewUpdateTektonPipelineTriggerOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "1bb892a1-2e04-4768-a369-b1159eace147",
    )
    updateTektonPipelineTriggerOptions.SetName("start-deploy")
    updateTektonPipelineTriggerOptions.SetDisabled(true)
    
    trigger, response, err := cdTektonPipelineService.UpdateTektonPipelineTrigger(updateTektonPipelineTriggerOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(trigger, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerId: '1bb892a1-2e04-4768-a369-b1159eace147',
      name: 'start-deploy',
      disabled: true,
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.updateTektonPipelineTrigger(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • UpdateTektonPipelineTriggerOptions updateTektonPipelineTriggerOptions = new UpdateTektonPipelineTriggerOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerId("1bb892a1-2e04-4768-a369-b1159eace147")
      .name("start-deploy")
      .disabled(true)
      .build();
    
    Response<Trigger> response = cdTektonPipelineService.updateTektonPipelineTrigger(updateTektonPipelineTriggerOptions).execute();
    Trigger trigger = response.getResult();
    
    System.out.println(trigger);
  • trigger = cd_tekton_pipeline_service.update_tekton_pipeline_trigger(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_id='1bb892a1-2e04-4768-a369-b1159eace147',
      name='start-deploy',
      disabled=True
    ).get_result()
    
    print(json.dumps(trigger, indent=2))

Response

Tekton pipeline trigger object

Status Code

  • updated trigger

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "timer_id": "958d621e-d067-410f-a842-bf1c51a43db4",
      "disabled": false,
      "name": "time trigger",
      "event_listener": "pr-listener",
      "cron": "*/5 * * * *",
      "concurrency": {
        "max_concurrent_runs": 2,
        "limited": true
      },
      "tags": [
        "tag2",
        "tag3"
      ],
      "timezone": "America/Toronto",
      "type": "timer",
      "id": "e3676049-e9f6-4f6a-b8eb-ac58e00c53f7"
    }

Delete a single trigger

This request deletes a single trigger

DELETE /tekton_pipelines/{pipeline_id}/triggers/{trigger_id}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The trigger ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 1bb892a1-2e04-4768-a369-b1159eace147

  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}"
  • deleteTektonPipelineTriggerOptions := cdTektonPipelineService.NewDeleteTektonPipelineTriggerOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "1bb892a1-2e04-4768-a369-b1159eace147",
    )
    
    response, err := cdTektonPipelineService.DeleteTektonPipelineTrigger(deleteTektonPipelineTriggerOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteTektonPipelineTrigger(): %d\n", response.StatusCode)
    }
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerId: '1bb892a1-2e04-4768-a369-b1159eace147',
    };
    
    try {
      await cdTektonPipelineService.deleteTektonPipelineTrigger(params);
    } catch (err) {
      console.warn(err);
    }
  • DeleteTektonPipelineTriggerOptions deleteTektonPipelineTriggerOptions = new DeleteTektonPipelineTriggerOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerId("1bb892a1-2e04-4768-a369-b1159eace147")
      .build();
    
    Response<Void> response = cdTektonPipelineService.deleteTektonPipelineTrigger(deleteTektonPipelineTriggerOptions).execute();
  • response = cd_tekton_pipeline_service.delete_tekton_pipeline_trigger(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_id='1bb892a1-2e04-4768-a369-b1159eace147'
    )

Response

Status Code

  • trigger deleted

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

No Sample Response

This method does not specify any sample responses.

List trigger environment properties

This request lists trigger environment properties

GET /tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The trigger ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 1bb892a1-2e04-4768-a369-b1159eace147

Query Parameters

  • filter properties by the name of property

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: prod

  • filter properties by the type of property, avaialble types are "SECURE","TEXT","INTEGRATION","SINGLE_SELECT","APPCONFIG"

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: SECURE,TEXT

  • sort properties by the a property field, for properties you can only sort them by "name" or "-name"

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_,]+$

    Example: name

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties?name=prod&type=SECURE,TEXT&sort=name"
  • listTektonPipelineTriggerPropertiesOptions := cdTektonPipelineService.NewListTektonPipelineTriggerPropertiesOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "1bb892a1-2e04-4768-a369-b1159eace147",
      "prod",
      "SECURE,TEXT",
      "name",
    )
    
    triggerProperties, response, err := cdTektonPipelineService.ListTektonPipelineTriggerProperties(listTektonPipelineTriggerPropertiesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(triggerProperties, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerId: '1bb892a1-2e04-4768-a369-b1159eace147',
      name: 'prod',
      type: 'SECURE,TEXT',
      sort: 'name',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.listTektonPipelineTriggerProperties(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • ListTektonPipelineTriggerPropertiesOptions listTektonPipelineTriggerPropertiesOptions = new ListTektonPipelineTriggerPropertiesOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerId("1bb892a1-2e04-4768-a369-b1159eace147")
      .name("prod")
      .type("SECURE,TEXT")
      .sort("name")
      .build();
    
    Response<TriggerProperties> response = cdTektonPipelineService.listTektonPipelineTriggerProperties(listTektonPipelineTriggerPropertiesOptions).execute();
    TriggerProperties triggerProperties = response.getResult();
    
    System.out.println(triggerProperties);
  • trigger_properties = cd_tekton_pipeline_service.list_tekton_pipeline_trigger_properties(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_id='1bb892a1-2e04-4768-a369-b1159eace147',
      name='prod',
      type='SECURE,TEXT',
      sort='name'
    ).get_result()
    
    print(json.dumps(trigger_properties, indent=2))

Response

Trigger properties object

Status Code

  • List of trigger properties

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "properties": [
        {
          "name": "ad123",
          "value": "ad123-value",
          "type": "TEXT",
          "href": "https://api.us-south.devops.cloud.ibm.com/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123"
        }
      ]
    }

Create trigger's environment property

This request creates a trigger's property

POST /tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The trigger ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 1bb892a1-2e04-4768-a369-b1159eace147

Trigger Property object

Examples:
text_env_property
secure_env_property
single_select_env_properties
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "name": "key1", "value": "https://github.com/IBM/tekton-tutorial.git", "type": "TEXT" }'   "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties"
  • createTektonPipelineTriggerPropertiesOptions := cdTektonPipelineService.NewCreateTektonPipelineTriggerPropertiesOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "1bb892a1-2e04-4768-a369-b1159eace147",
    )
    createTektonPipelineTriggerPropertiesOptions.SetName("key1")
    createTektonPipelineTriggerPropertiesOptions.SetValue("https://github.com/IBM/tekton-tutorial.git")
    createTektonPipelineTriggerPropertiesOptions.SetType("TEXT")
    
    triggerProperty, response, err := cdTektonPipelineService.CreateTektonPipelineTriggerProperties(createTektonPipelineTriggerPropertiesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(triggerProperty, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerId: '1bb892a1-2e04-4768-a369-b1159eace147',
      name: 'key1',
      type: 'TEXT',
      value: 'https://github.com/IBM/tekton-tutorial.git',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.createTektonPipelineTriggerProperties(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • CreateTektonPipelineTriggerPropertiesOptions createTektonPipelineTriggerPropertiesOptions = new CreateTektonPipelineTriggerPropertiesOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerId("1bb892a1-2e04-4768-a369-b1159eace147")
      .name("key1")
      .value("https://github.com/IBM/tekton-tutorial.git")
      .type("TEXT")
      .build();
    
    Response<TriggerProperty> response = cdTektonPipelineService.createTektonPipelineTriggerProperties(createTektonPipelineTriggerPropertiesOptions).execute();
    TriggerProperty triggerProperty = response.getResult();
    
    System.out.println(triggerProperty);
  • trigger_property = cd_tekton_pipeline_service.create_tekton_pipeline_trigger_properties(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_id='1bb892a1-2e04-4768-a369-b1159eace147',
      name='key1',
      type='TEXT',
      value='https://github.com/IBM/tekton-tutorial.git'
    ).get_result()
    
    print(json.dumps(trigger_property, indent=2))

Response

Trigger Property object

Status Code

  • Trigger property added

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ad123",
      "value": "ad123-value",
      "type": "TEXT"
    }

Get a trigger's environment property

This request retrieves a trigger's environment property

GET /tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties/{property_name}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The trigger ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 1bb892a1-2e04-4768-a369-b1159eace147

  • The property's name

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_.]{1,234}$

    Example: debug-pipeline

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties/{property_name}"
  • getTektonPipelineTriggerPropertyOptions := cdTektonPipelineService.NewGetTektonPipelineTriggerPropertyOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "1bb892a1-2e04-4768-a369-b1159eace147",
      "debug-pipeline",
    )
    
    triggerProperty, response, err := cdTektonPipelineService.GetTektonPipelineTriggerProperty(getTektonPipelineTriggerPropertyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(triggerProperty, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerId: '1bb892a1-2e04-4768-a369-b1159eace147',
      propertyName: 'debug-pipeline',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.getTektonPipelineTriggerProperty(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • GetTektonPipelineTriggerPropertyOptions getTektonPipelineTriggerPropertyOptions = new GetTektonPipelineTriggerPropertyOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerId("1bb892a1-2e04-4768-a369-b1159eace147")
      .propertyName("debug-pipeline")
      .build();
    
    Response<TriggerProperty> response = cdTektonPipelineService.getTektonPipelineTriggerProperty(getTektonPipelineTriggerPropertyOptions).execute();
    TriggerProperty triggerProperty = response.getResult();
    
    System.out.println(triggerProperty);
  • trigger_property = cd_tekton_pipeline_service.get_tekton_pipeline_trigger_property(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_id='1bb892a1-2e04-4768-a369-b1159eace147',
      property_name='debug-pipeline'
    ).get_result()
    
    print(json.dumps(trigger_property, indent=2))

Response

Trigger Property object

Status Code

  • Trigger's property

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ad123",
      "value": "ad123-value",
      "type": "TEXT"
    }

Replace a trigger's environment property value

This request updates a trigger's environment property value, its type or name are immutable. For any property type, the entered value replaces the existing value

PUT /tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties/{property_name}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The trigger ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 1bb892a1-2e04-4768-a369-b1159eace147

  • The property's name

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_.]{1,234}$

    Example: debug-pipeline

Trigger Property object

Examples:
single_env_property
  • curl -X PUT --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "name": "key1", "value": "https://github.com/IBM/tekton-tutorial.git", "type": "TEXT" }'   "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties/{property_name}"
  • replaceTektonPipelineTriggerPropertyOptions := cdTektonPipelineService.NewReplaceTektonPipelineTriggerPropertyOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "1bb892a1-2e04-4768-a369-b1159eace147",
      "debug-pipeline",
    )
    replaceTektonPipelineTriggerPropertyOptions.SetName("key1")
    replaceTektonPipelineTriggerPropertyOptions.SetValue("https://github.com/IBM/tekton-tutorial.git")
    replaceTektonPipelineTriggerPropertyOptions.SetType("TEXT")
    
    triggerProperty, response, err := cdTektonPipelineService.ReplaceTektonPipelineTriggerProperty(replaceTektonPipelineTriggerPropertyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(triggerProperty, "", "  ")
    fmt.Println(string(b))
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerId: '1bb892a1-2e04-4768-a369-b1159eace147',
      propertyName: 'debug-pipeline',
      name: 'key1',
      type: 'TEXT',
      value: 'https://github.com/IBM/tekton-tutorial.git',
    };
    
    let res;
    try {
      res = await cdTektonPipelineService.replaceTektonPipelineTriggerProperty(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • ReplaceTektonPipelineTriggerPropertyOptions replaceTektonPipelineTriggerPropertyOptions = new ReplaceTektonPipelineTriggerPropertyOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerId("1bb892a1-2e04-4768-a369-b1159eace147")
      .propertyName("debug-pipeline")
      .name("key1")
      .value("https://github.com/IBM/tekton-tutorial.git")
      .type("TEXT")
      .build();
    
    Response<TriggerProperty> response = cdTektonPipelineService.replaceTektonPipelineTriggerProperty(replaceTektonPipelineTriggerPropertyOptions).execute();
    TriggerProperty triggerProperty = response.getResult();
    
    System.out.println(triggerProperty);
  • trigger_property = cd_tekton_pipeline_service.replace_tekton_pipeline_trigger_property(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_id='1bb892a1-2e04-4768-a369-b1159eace147',
      property_name='debug-pipeline',
      name='key1',
      type='TEXT',
      value='https://github.com/IBM/tekton-tutorial.git'
    ).get_result()
    
    print(json.dumps(trigger_property, indent=2))

Response

Trigger Property object

Status Code

  • Edited trigger property

  • Malformed request syntax or invalid request body

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

Example responses
  • {
      "name": "ad123",
      "value": "ad123-value",
      "type": "TEXT"
    }

Delete a trigger's property

this request deletes a trigger's property

DELETE /tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties/{property_name}

Request

Path Parameters

  • The tekton pipeline ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 94619026-912b-4d92-8f51-6c74f0692d90

  • The trigger ID

    Possible values: length = 36, Value must match regular expression ^[-0-9a-z]+$

    Example: 1bb892a1-2e04-4768-a369-b1159eace147

  • The property's name

    Possible values: 1 ≤ length ≤ 253, Value must match regular expression ^[-0-9a-zA-Z_.]{1,234}$

    Example: debug-pipeline

  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}/properties/{property_name}"
  • deleteTektonPipelineTriggerPropertyOptions := cdTektonPipelineService.NewDeleteTektonPipelineTriggerPropertyOptions(
      "94619026-912b-4d92-8f51-6c74f0692d90",
      "1bb892a1-2e04-4768-a369-b1159eace147",
      "debug-pipeline",
    )
    
    response, err := cdTektonPipelineService.DeleteTektonPipelineTriggerProperty(deleteTektonPipelineTriggerPropertyOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteTektonPipelineTriggerProperty(): %d\n", response.StatusCode)
    }
  • const params = {
      pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90',
      triggerId: '1bb892a1-2e04-4768-a369-b1159eace147',
      propertyName: 'debug-pipeline',
    };
    
    try {
      await cdTektonPipelineService.deleteTektonPipelineTriggerProperty(params);
    } catch (err) {
      console.warn(err);
    }
  • DeleteTektonPipelineTriggerPropertyOptions deleteTektonPipelineTriggerPropertyOptions = new DeleteTektonPipelineTriggerPropertyOptions.Builder()
      .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90")
      .triggerId("1bb892a1-2e04-4768-a369-b1159eace147")
      .propertyName("debug-pipeline")
      .build();
    
    Response<Void> response = cdTektonPipelineService.deleteTektonPipelineTriggerProperty(deleteTektonPipelineTriggerPropertyOptions).execute();
  • response = cd_tekton_pipeline_service.delete_tekton_pipeline_trigger_property(
      pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90',
      trigger_id='1bb892a1-2e04-4768-a369-b1159eace147',
      property_name='debug-pipeline'
    )

Response

Status Code

  • Property deleted

  • Iam bearer token is missing or authentication error

  • Pipeline not found or authorization failed

No Sample Response

This method does not specify any sample responses.