Introduction
IBM Cloud® Continuous Delivery Tekton pipelines leverage the open source Tekton Pipelines project to provide continuous integration and continuous deployment capabilities within Kubernetes clusters.
Tekton Pipelines is an open source project that you can use to configure and run continuous integration and continuous deployment 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 @ibm-cloud/continuous-delivery
For more information, view the project on GitHub: https://github.com/IBM/continuous-delivery-node-sdk
Installing the Python SDK.
pip install "ibm-continuous-delivery"
For more information, view the project on GitHub: https://github.com/IBM/continuous-delivery-python-sdk
Installing the Go SDK.
Go modules (recommended): Add the following import in your code and then run go mod tidy
.
import (
"github.com/IBM/continuous-delivery-go-sdk/cdtektonpipelinev2"
)
Using Go get:
go get -u github.com/IBM/continuous-delivery-go-sdk/cdtektonpipelinev2
For more information, view the project on GitHub: https://github.com/IBM/continuous-delivery-go-sdk
Installing the Java SDK.
Maven example:
<dependency>
<groupId>com.ibm.cloud</groupId>
<artifactId>cd-tekton-pileline</artifactId>
<version>0.1.3</version>
</dependency>
Gradle example:
compile 'com.ibm.cloud:cd-tekton-pileline:0.1.3'
For more information, view the project on GitHub: https://github.com/IBM/continuous-delivery-java-sdk. See also Using the SDK.
Endpoint URL
The Continuous Delivery Tekton pipeline API uses the regional 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/pipeline/v2
- Washington DC:
https://api.us-east.devops.cloud.ibm.com/pipeline/v2
- London:
https://api.eu-gb.devops.cloud.ibm.com/pipeline/v2
- Frankfurt:
https://api.eu-de.devops.cloud.ibm.com/pipeline/v2
- Sydney:
https://api.au-syd.devops.cloud.ibm.com/pipeline/v2
- Tokyo:
https://api.jp-tok.devops.cloud.ibm.com/pipeline/v2
- Osaka:
https://api.jp-osa.devops.cloud.ibm.com/pipeline/v2
- Toronto:
https://api.ca-tor.devops.cloud.ibm.com/pipeline/v2
- SĂŁo Paulo:
https://api.br-sao.devops.cloud.ibm.com/pipeline/v2
- Madrid:
https://api.eu-es.devops.cloud.ibm.com/pipeline/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 determines the actions that a user has access to when they use the API.
To get an access token, use an API key. To get 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. To use the Tekton API, add your valid IAM token to the HTTP Authorization request header, for example, -H "Authorization: Bearer <IAM_TOKEN_VALUE>"
.
Example request to generate an access token, where <API_KEY>
is your IBM Cloud API Key.:
curl -X POST 'https://iam.cloud.ibm.com/identity/token' -H 'Content-Type:application/x-www-form-urlencoded' -H 'Accept:application/json' -d 'grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=<API_KEY>'
From the result of this curl command, take the access_token
value and use it in place of <IAM_TOKEN_VALUE>
in the curl command below to authenticate into the Tekton API:
curl -L --request GET 'https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/<PIPELINE_ID>' --header 'Authorization: Bearer <IAM_TOKEN_VALUE>'
Or export the returned access_token
value as an environment variable and use that variable in the curl command:
export IAMTOKEN="<access_token_value>"
curl -L --request GET 'https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/<PIPELINE_ID>' --header 'Authorization: Bearer ${IAMTOKEN}'
Setting client options through environment variables
Example environment variables, where <API_KEY>
is an IAM API key.
export CD_TEKTON_PIPELINE_URL=https://api.us-south.devops.cloud.ibm.com/pipeline/v2
export CD_TEKTON_PIPELINE_AUTHTYPE=iam
export CD_TEKTON_PIPELINE_APIKEY=<API_KEY>
Example of constructing the service client
import {
"github.com/IBM/continuous-delivery-go-sdk/cdtektonpipelinev2"
}
...
cdTektonPipelineServiceOptions := &cdtektonpipelinev2.CdTektonPipelineV2Options{}
cdTektonPipelineService, err = cdtektonpipelinev2.NewCdTektonPipelineV2UsingExternalConfig(cdTektonPipelineServiceOptions)
Setting client options programmatically
Construct the service client programmatically, where <API_KEY>
is your hardcoded IAM API key.
const CdTektonPipelineV2 = require('@ibm-cloud/continuous-delivery/cd-tekton-pipeline/v2');
const { IamAuthenticator } = require('@ibm-cloud/continuous-delivery/auth');
// Create an IAM authenticator.
const authenticator = new IamAuthenticator({
apikey: '<API_KEY>'
});
// Construct the service client.
const tektonService = new CdTektonPipelineV2({
authenticator, // required
serviceUrl: 'https://api.us-south.devops.cloud.ibm.com/pipeline/v2' // optional
});
Setting client options through external configuration
Example environment variables, where <API_KEY>
is an IAM API key.
export CD_TEKTON_PIPELINE_URL=https://api.us-south.devops.cloud.ibm.com/pipeline/v2
export CD_TEKTON_PIPELINE_AUTHTYPE=iam
export CD_TEKTON_PIPELINE_APIKEY=<API_KEY>
Construct the service client using external configuration. CdTektonPipelineV2.newInstance()
initializes the client with the environment variables, using them for subsequent authentication.
const CdTektonPipelineV2 = require('@ibm-cloud/continuous-delivery/cd-tekton-pipeline/v2');
const tektonService = CdTektonPipelineV2.newInstance();
Setting client options through external configuration
Example environment variables, where <API_KEY>
is an IAM API key.
export CD_TEKTON_PIPELINE_URL=https://api.us-south.devops.cloud.ibm.com/pipeline/v2
export CD_TEKTON_PIPELINE_AUTHTYPE=iam
export CD_TEKTON_PIPELINE_APIKEY=<API_KEY>
Example of constructing the service client
from ibm_continuous_delivery.cd_tekton_pipeline_v2 import CdTektonPipelineV2
service = CdTektonPipelineV2.new_instance()
Setting client options programmatically
Construct the service client programmatically, where <API_KEY>
is your hardcoded IAM API key.
import com.ibm.cloud.continuous_delivery.cd_tekton_pipeline.v2.CdTektonPipeline;
import com.ibm.cloud.sdk.core.security.Authenticator;
import com.ibm.cloud.sdk.core.security.IamAuthenticator;
...
Authenticator authenticator = new IamAuthenticator.Builder()
.apikey("<API_KEY>")
.build();
CdTektonPipeline pipelineSvc = new CdTektonPipeline(CdTektonPipeline.DEFAULT_SERVICE_NAME, authenticator);
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'. |
Pagination
Some API requests may return multiple results. To avoid performance problems, these results are returned one page at a time, with a limited number of results in each page. GET
requests for the /tekton_pipelines/{pipeline_id}/pipeline_runs
resource use pagination.
The fields first
, previous
, next
, and last
are included in the collection response as needed, depending on the number of the results. The href
property for these fields contains a URL reference to the appropriate page of results from the collection resource. Pagination is token based, where the response will return results from the beginning of the collection and will provide the appropriate next
link, which contains a start
token, to traverse through the rest of the collection.
The default page size is 50 items, and the maximum size is 100 items. To control the page size, use the limit
query parameter.
Rate limiting
Rate limits for API requests are enforced on this service. If the number of requests reaches the request limit within the specified time window, no further requests are accepted until after the time window. Clients that are blocked by rate limited should wait and try the request again later.
An HTTP status code of 429 indicates that the rate limit has been exceeded.
Glossary
- Tekton Pipeline: Continuous Delivery Tekton pipeline
- Pipeline run: Continuous Delivery Tekton pipeline run
- PipelineRun: Pure Tekton pipeline PipelineRuns
Methods
Create Tekton pipeline
This request creates a Tekton pipeline. Requires a pipeline tool already created in the toolchain using the toolchain API https://cloud.ibm.com/apidocs/toolchain#create-tool, and use the tool ID to create the Tekton pipeline
POST /tekton_pipelines
Request
Request body used to create a pipeline. Requires a pipeline tool already created in the toolchain using the toolchain API https://cloud.ibm.com/apidocs/toolchain#create-tool
{
"id": "94619026-912b-4d92-8f51-6c74f0692d90",
"worker": {
"id": "public"
}
}
The ID for the associated pipeline tool, which was already created in the target toolchain. To get the pipeline ID call the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools and find the pipeline tool
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Specify the build number that will be used for the next pipeline run. Build numbers can be any positive whole number between 0 and 100000000000000.
Possible values: 1 ≤ value ≤ 99999999999999
Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain.
Default:
false
Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work
Default:
false
Specify the worker that is to be used to run the trigger, indicated by a worker object with only the worker ID. If not specified or set as
worker: { id: 'public' }
, the IBM Managed shared workers are used.
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"
workerIdentityModel := &cdtektonpipelinev2.WorkerIdentity{ ID: core.StringPtr("public"), } createTektonPipelineOptions := cdTektonPipelineService.NewCreateTektonPipelineOptions( "94619026-912b-4d92-8f51-6c74f0692d90", ) createTektonPipelineOptions.SetWorker(workerIdentityModel) 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. // WorkerIdentity const workerIdentityModel = { id: 'public', }; const params = { id: '94619026-912b-4d92-8f51-6c74f0692d90', worker: workerIdentityModel, }; let res; try { res = await cdTektonPipelineService.createTektonPipeline(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
worker_identity_model = { 'id': 'public', } response = cd_tekton_pipeline_service.create_tekton_pipeline( id='94619026-912b-4d92-8f51-6c74f0692d90', worker=worker_identity_model, ) tekton_pipeline = response.get_result() print(json.dumps(tekton_pipeline, indent=2))
WorkerIdentity workerIdentityModel = new WorkerIdentity.Builder() .id("public") .build(); CreateTektonPipelineOptions createTektonPipelineOptions = new CreateTektonPipelineOptions.Builder() .id("94619026-912b-4d92-8f51-6c74f0692d90") .worker(workerIdentityModel) .build(); Response<TektonPipeline> response = cdTektonPipelineService.createTektonPipeline(createTektonPipelineOptions).execute(); TektonPipeline tektonPipeline = response.getResult(); System.out.println(tektonPipeline);
Response
Tekton pipeline object
String
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-zA-Z0-9][-0-9a-zA-Z_. ]{1,251}[a-zA-Z0-9]$
Pipeline status
Possible values: [
configured
,configuring
]The resource group in which the pipeline was created
Toolchain object containing references to the parent toolchain
UUID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Definition list
Possible values: 0 ≤ number of items ≤ 128
Tekton pipeline's environment properties
Possible values: 0 ≤ number of items ≤ 1024
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
Tekton pipeline triggers list
Possible values: 0 ≤ number of items ≤ 1024
- triggers
Details of the worker used to run the pipeline
URL for this pipeline showing the list of pipeline runs
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs
Possible values: value ≥ 1
The build number that will be used for the next pipeline run
Possible values: 1 ≤ value ≤ 99999999999999
Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain. If omitted, this feature is disabled by default
Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default
Flag to check if the trigger is enabled
API URL for interacting with the pipeline
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Status Code
Tekton pipeline data
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "ci-pipeline", "runs_url": "https://cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90?env_id=ibm:ys1:us-south", "resource_group": { "id": "19c29990ffe42ce260f5a5cb64f54169" }, "status": "configured", "created_at": "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": [], "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": [], "build_number": 10, "next_build_number": 11, "enable_notifications": false, "enable_partial_cloning": false, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90" }
Get Tekton pipeline data
This request retrieves the Tekton pipeline data for the pipeline identified by {id}
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); }
response = cd_tekton_pipeline_service.get_tekton_pipeline( id='94619026-912b-4d92-8f51-6c74f0692d90', ) tekton_pipeline = response.get_result() print(json.dumps(tekton_pipeline, indent=2))
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);
Response
Tekton pipeline object
String
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-zA-Z0-9][-0-9a-zA-Z_. ]{1,251}[a-zA-Z0-9]$
Pipeline status
Possible values: [
configured
,configuring
]The resource group in which the pipeline was created
Toolchain object containing references to the parent toolchain
UUID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Definition list
Possible values: 0 ≤ number of items ≤ 128
Tekton pipeline's environment properties
Possible values: 0 ≤ number of items ≤ 1024
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
Tekton pipeline triggers list
Possible values: 0 ≤ number of items ≤ 1024
- triggers
Details of the worker used to run the pipeline
URL for this pipeline showing the list of pipeline runs
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs
Possible values: value ≥ 1
The build number that will be used for the next pipeline run
Possible values: 1 ≤ value ≤ 99999999999999
Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain. If omitted, this feature is disabled by default
Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default
Flag to check if the trigger is enabled
API URL for interacting with the pipeline
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Status Code
Tekton pipeline data
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "ci-pipeline", "runs_url": "https://cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90?env_id=ibm:ys1:us-south", "resource_group": { "id": "19c29990ffe42ce260f5a5cb64f54169" }, "status": "configured", "created_at": "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", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/pipeline-debug" } ], "triggers": [ { "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57", "enabled": true, "name": "manual-trigger", "type": "manual", "event_listener": "manual-listener", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57" } ], "worker": { "name": "IBM Managed workers (Tekton Pipelines v0.16.3) in DALLAS (Stage 1)", "type": "public", "id": "public" }, "build_number": 1, "next_build_number": 2, "id": "94619026-912b-4d92-8f51-6c74f0692d90", "enabled": true, "enable_notifications": false, "enable_partial_cloning": false, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90", "definitions": [ { "source": { "type": "git", "properties": { "path": ".tekton", "url": "https://github.com/open-toolchain/hello-tekton.git", "branch": "master", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "id": "22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/definitions/22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f" } ] }
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 other configuration updates
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 update this pipeline
{
"worker": {
"id": "public"
}
}
Specify the build number that will be used for the next pipeline run. Build numbers can be any positive whole number between 0 and 100000000000000.
Possible values: 1 ≤ value ≤ 99999999999999
Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain.
Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work
Specify the worker that is to be used to run the trigger, indicated by a worker object with only the worker ID. If not specified or set as
worker: { id: 'public' }
, the IBM Managed shared workers are used.
curl -X PATCH --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/merge-patch+json" --data '{"worker":{"id":"public"}}' "{base_url}/tekton_pipelines/{id}"
workerIdentityModel := &cdtektonpipelinev2.WorkerIdentity{ ID: core.StringPtr("public"), } tektonPipelinePatchModel := &cdtektonpipelinev2.TektonPipelinePatch{ Worker: workerIdentityModel, } tektonPipelinePatchModelAsPatch, asPatchErr := tektonPipelinePatchModel.AsPatch() Expect(asPatchErr).To(BeNil()) updateTektonPipelineOptions := cdTektonPipelineService.NewUpdateTektonPipelineOptions( "94619026-912b-4d92-8f51-6c74f0692d90", ) updateTektonPipelineOptions.SetTektonPipelinePatch(tektonPipelinePatchModelAsPatch) 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. // WorkerIdentity const workerIdentityModel = { id: 'public', }; const params = { id: '94619026-912b-4d92-8f51-6c74f0692d90', worker: workerIdentityModel, }; let res; try { res = await cdTektonPipelineService.updateTektonPipeline(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
worker_identity_model = { 'id': 'public', } tekton_pipeline_patch_model = { 'worker': worker_identity_model, } response = cd_tekton_pipeline_service.update_tekton_pipeline( id='94619026-912b-4d92-8f51-6c74f0692d90', tekton_pipeline_patch=tekton_pipeline_patch_model, ) tekton_pipeline = response.get_result() print(json.dumps(tekton_pipeline, indent=2))
WorkerIdentity workerIdentityModel = new WorkerIdentity.Builder() .id("public") .build(); TektonPipelinePatch tektonPipelinePatchModel = new TektonPipelinePatch.Builder() .worker(workerIdentityModel) .build(); Map<String, Object> tektonPipelinePatchModelAsPatch = tektonPipelinePatchModel.asPatch(); UpdateTektonPipelineOptions updateTektonPipelineOptions = new UpdateTektonPipelineOptions.Builder() .id("94619026-912b-4d92-8f51-6c74f0692d90") .tektonPipelinePatch(tektonPipelinePatchModelAsPatch) .build(); Response<TektonPipeline> response = cdTektonPipelineService.updateTektonPipeline(updateTektonPipelineOptions).execute(); TektonPipeline tektonPipeline = response.getResult(); System.out.println(tektonPipeline);
Response
Tekton pipeline object
String
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[a-zA-Z0-9][-0-9a-zA-Z_. ]{1,251}[a-zA-Z0-9]$
Pipeline status
Possible values: [
configured
,configuring
]The resource group in which the pipeline was created
Toolchain object containing references to the parent toolchain
UUID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Definition list
Possible values: 0 ≤ number of items ≤ 128
Tekton pipeline's environment properties
Possible values: 0 ≤ number of items ≤ 1024
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
Tekton pipeline triggers list
Possible values: 0 ≤ number of items ≤ 1024
- triggers
Details of the worker used to run the pipeline
URL for this pipeline showing the list of pipeline runs
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs
Possible values: value ≥ 1
The build number that will be used for the next pipeline run
Possible values: 1 ≤ value ≤ 99999999999999
Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain. If omitted, this feature is disabled by default
Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default
Flag to check if the trigger is enabled
API URL for interacting with the pipeline
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Status Code
Tekton pipeline data
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "ci-pipeline", "runs_url": "https://cloud.ibm.com/devops/pipelines/tekton/94619026-912b-4d92-8f51-6c74f0692d90?env_id=ibm:ys1:us-south", "resource_group": { "id": "19c29990ffe42ce260f5a5cb64f54169" }, "status": "configured", "created_at": "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", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/pipeline-debug" } ], "triggers": [ { "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57", "enabled": true, "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, "next_build_number": 2, "id": "94619026-912b-4d92-8f51-6c74f0692d90", "enabled": true, "enable_notifications": false, "enable_partial_cloning": false, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90", "definitions": [ { "source": { "type": "git", "properties": { "path": ".tekton", "url": "https://github.com/open-toolchain/hello-tekton.git", "branch": "master", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "id": "22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/definitions/22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f" } ] }
Delete Tekton pipeline instance
This request deletes Tekton pipeline instance that is 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); }
response = cd_tekton_pipeline_service.delete_tekton_pipeline( id='94619026-912b-4d92-8f51-6c74f0692d90', )
DeleteTektonPipelineOptions deleteTektonPipelineOptions = new DeleteTektonPipelineOptions.Builder() .id("94619026-912b-4d92-8f51-6c74f0692d90") .build(); Response<Void> response = cdTektonPipelineService.deleteTektonPipeline(deleteTektonPipelineOptions).execute();
List pipeline run records
This request lists pipeline run records, which has data about the runs, 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
A page token that identifies the start point of the list of pipeline runs. This value is included in the response body of each request to fetch pipeline runs
Possible values: 0 ≤ length ≤ 253, Value must match regular expression
^[0-9a-zA-Z_.+-\/=]*$
The number of pipeline runs to return, sorted by creation time, most recent first
Possible values: 1 ≤ value ≤ 100
Default:
50
Filters the collection to resources with the specified status
Allowable values: [
pending
,waiting
,queued
,running
,cancelled
,failed
,error
,succeeded
]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 := &cdtektonpipelinev2.ListTektonPipelineRunsOptions{ PipelineID: core.StringPtr("94619026-912b-4d92-8f51-6c74f0692d90"), Limit: core.Int64Ptr(int64(10)), Status: core.StringPtr("succeeded"), TriggerName: core.StringPtr("manual-trigger"), } pager, err := cdTektonPipelineService.NewTektonPipelineRunsPager(listTektonPipelineRunsOptions) if err != nil { panic(err) } var allResults []cdtektonpipelinev2.PipelineRun for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
const params = { pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90', limit: 10, status: 'succeeded', triggerName: 'manual-trigger', }; const allResults = []; try { const pager = new CdTektonPipelineV2.TektonPipelineRunsPager(cdTektonPipelineService, params); while (pager.hasNext()) { const nextPage = await pager.getNext(); expect(nextPage).not.toBeNull(); allResults.push(...nextPage); } console.log(JSON.stringify(allResults, null, 2)); } catch (err) { console.warn(err); }
all_results = [] pager = TektonPipelineRunsPager( client=cd_tekton_pipeline_service, pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', limit=10, status='succeeded', trigger_name='manual-trigger', ) while pager.has_next(): next_page = pager.get_next() assert next_page is not None all_results.extend(next_page) print(json.dumps(all_results, indent=2))
ListTektonPipelineRunsOptions listTektonPipelineRunsOptions = new ListTektonPipelineRunsOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .limit(Long.valueOf("10")) .status("succeeded") .triggerName("manual-trigger") .build(); TektonPipelineRunsPager pager = new TektonPipelineRunsPager(cdTektonPipelineService, listTektonPipelineRunsOptions); List<PipelineRun> allResults = new ArrayList<>(); while (pager.hasNext()) { List<PipelineRun> nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults));
Response
Tekton pipeline runs object
Tekton pipeline runs list
Possible values: 0 ≤ number of items ≤ 1024
The number of pipeline runs to return, sorted by creation time, most recent first
Possible values: 1 ≤ value ≤ 100
Example:
20
First page of pipeline runs
Next page of pipeline runs relative to the
start
andlimit
params. Only included when there are more pages availableLast page of pipeline runs relative to the
start
andlimit
params. Only included when the last page has been reached
Status Code
List of pipeline runs
Authentication error or the IAM bearer token is missing
Pipeline run not found or authorization failed
Too many requests have been made within a given time window.
{ "pipeline_runs": [ { "id": "1681024e-4dfe-40dd-922b-b55719120078", "worker": { "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f", "agent_id": "a2fd3205-0d94-47e1-a867-444a6185db51" }, "user_info": { "iam_id": "IBMid-310001SNXX", "sub": "firstname@domain.com" }, "status": "succeeded", "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90", "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", "definition": { "id": "ee41a181-afed-4308-bf2a-84d6c677a005" }, "listener_name": "manual-listener", "created_at": "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", "enabled": true, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57", "properties": [ { "name": "new", "value": "123", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57/properties/new" } ] }, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/1681024e-4dfe-40dd-922b-b55719120078", "run_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" } ], "limit": 10, "first": { "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs?limit=10" }, "next": { "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs?limit=10&start=MTY2MTkzNTY4MDMyMA==" } }
Trigger a pipeline run
Trigger a new pipeline run using either the manual or the timed trigger, specifying the additional properties or overriding existing ones as needed
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 trigger a Tekton pipeline run
{
"trigger": {
"name": "Manual Trigger 1",
"description": "My custom manual PipelineRun",
"properties": {
"pipeline-debug": "false"
},
"secure_properties": {
"secure-property-key": "secure value"
},
"headers": {
"source": "api"
},
"body": {
"message": "hello world",
"enable": "true",
"detail": {
"name": "example"
}
}
}
}
Optional description for the created PipelineRun
Possible values: 1 ≤ length ≤ 300, Value must match regular expression
^.*$
Trigger name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\(\)\[\]]{1,251}[a-zA-Z0-9])$
Example:
start-deploy
An object containing string values only. It provides additional 'text' properties or overrides existing pipeline/trigger properties that can be used in the created run
- trigger_properties
An object containing string values only. It provides additional
secure
properties or overrides existingsecure
pipeline/trigger properties that can be used in the created run- secure_trigger_properties
An object containing string values only that provides the request headers. Use
$(header.header_key_name)
to access it in a TriggerBinding. Most commonly used as part of a Generic Webhook to provide a verification token or signature in the request headers- trigger_headers
An object that provides the request body. Use
$(body.body_key_name)
to access it in a TriggerBinding. Most commonly used to pass in additional properties or override properties for the pipeline run that is created- trigger_body
Trigger details passed when triggering a Tekton pipeline run
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "trigger": { "name": "Manual Trigger 1", "description": "My custom manual PipelineRun", "properties": { "pipeline-debug": "false" }, "secure_properties": { "secure-property-key": "secure value" }, "headers": { "source": "api" }, "body": { "message": "hello world", "enable": "true", "detail": { "name": "example" } } } }' "{base_url}/tekton_pipelines/{pipeline_id}/pipeline_runs"
pipelineRunTriggerModel := &cdtektonpipelinev2.PipelineRunTrigger{ Name: core.StringPtr("Manual Trigger 1"), } createTektonPipelineRunOptions := cdTektonPipelineService.NewCreateTektonPipelineRunOptions( "94619026-912b-4d92-8f51-6c74f0692d90", ) createTektonPipelineRunOptions.SetTrigger(pipelineRunTriggerModel) pipelineRun, response, err := cdTektonPipelineService.CreateTektonPipelineRun(createTektonPipelineRunOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(pipelineRun, "", " ") fmt.Println(string(b))
// Request models needed by this operation. // PipelineRunTrigger const pipelineRunTriggerModel = { name: 'Manual Trigger 1', properties: { 'pipeline-debug': 'false' }, secure_properties: { 'secure-property-key': 'secure value' }, headers: { source: 'api' }, body: { message: 'hello world', enable: 'true', detail: { name: 'example' } }, }; const params = { pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90', trigger: pipelineRunTriggerModel, }; let res; try { res = await cdTektonPipelineService.createTektonPipelineRun(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
pipeline_run_trigger_model = { 'name': 'Manual Trigger 1', 'properties': {'pipeline-debug':'false'}, 'secure_properties': {'secure-property-key':'secure value'}, 'headers': {'source':'api'}, 'body': {'message':'hello world','enable':'true','detail':{'name':'example'}}, } response = cd_tekton_pipeline_service.create_tekton_pipeline_run( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', trigger=pipeline_run_trigger_model, ) pipeline_run = response.get_result() print(json.dumps(pipeline_run, indent=2))
PipelineRunTrigger pipelineRunTriggerModel = new PipelineRunTrigger.Builder() .name("Manual Trigger 1") .build(); CreateTektonPipelineRunOptions createTektonPipelineRunOptions = new CreateTektonPipelineRunOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .trigger(pipelineRunTriggerModel) .build(); Response<PipelineRun> response = cdTektonPipelineService.createTektonPipelineRun(createTektonPipelineRunOptions).execute(); PipelineRun pipelineRun = response.getResult(); System.out.println(pipelineRun);
Response
Single Tekton pipeline run object
UUID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Status of the pipeline run
Possible values: [
pending
,waiting
,queued
,running
,cancelled
,failed
,error
,succeeded
]The aggregated definition ID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Worker details used in this pipeline run
The ID of the pipeline to which this pipeline run belongs
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Listener name used to start the run
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Tekton pipeline trigger
Event parameters object in String format that was passed in upon creation of this pipeline run, the contents depends on the type of trigger. For example, the Git event payload is included for Git triggers, or in the case of a manual trigger the override and added properties are included
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
URL for the details page of this pipeline run
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
General href URL
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Information about the user that triggered a pipeline run. Only included for pipeline runs that were manually triggered
Reference to the pipeline definition of a pipeline run
A description of the PipelineRun
Reference to the pipeline to which a pipeline run belongs
Trigger headers object in String format that was passed in upon creation of this pipeline run. Omitted if no trigger_headers object was provided when creating the pipeline run
Properties used in this Tekton pipeline run. Not included when fetching the list of pipeline runs
Possible values: 0 ≤ number of items ≤ 1024
Standard RFC 3339 Date Time String. Only included if the run has been updated since it was created
Possible values: 20 ≤ length ≤ 24
Error message that provides details when a pipeline run encounters an error
Status Code
Pipeline run result and its status
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Pipeline run not found or authorization failed
Too many requests have been made within a given time window.
{ "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90", "pipeline": { "id": "94619026-912b-4d92-8f51-6c74f0692d90" }, "status": "pending", "properties": [ { "name": "pipeline-debug", "value": "from-API", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/pipeline-debug" } ], "listener_name": "manual-listener", "trigger": { "name": "manual-trigger", "event_listener": "manual-listener", "type": "manual", "id": "1bb892a1-2e04-4768-a369-b1159eace147", "enabled": true }, "type": "pipeline_run", "description": "My custom manual PipelineRun", "created_at": "2022-02-03T20:49:02.124Z", "updated_at": "2022-02-03T20:49:02.124Z", "id": "c4d6e785-f890-4ee4-92dd-f690f95b41a2", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/c4d6e785-f890-4ee4-92dd-f690f95b41a2", "run_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\"}]}", "trigger_headers": "{\"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", "definition": { "id": "ee41a181-afed-4308-bf2a-84d6c677a005" } }
Get a pipeline run record
This request retrieves details of the pipeline run identified by {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
]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); }
response = cd_tekton_pipeline_service.get_tekton_pipeline_run( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', id='94619026-912b-4d92-8f51-6c74f0692d90', includes='definitions', ) pipeline_run = response.get_result() print(json.dumps(pipeline_run, indent=2))
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);
Response
Single Tekton pipeline run object
UUID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Status of the pipeline run
Possible values: [
pending
,waiting
,queued
,running
,cancelled
,failed
,error
,succeeded
]The aggregated definition ID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Worker details used in this pipeline run
The ID of the pipeline to which this pipeline run belongs
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Listener name used to start the run
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Tekton pipeline trigger
Event parameters object in String format that was passed in upon creation of this pipeline run, the contents depends on the type of trigger. For example, the Git event payload is included for Git triggers, or in the case of a manual trigger the override and added properties are included
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
URL for the details page of this pipeline run
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
General href URL
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Information about the user that triggered a pipeline run. Only included for pipeline runs that were manually triggered
Reference to the pipeline definition of a pipeline run
A description of the PipelineRun
Reference to the pipeline to which a pipeline run belongs
Trigger headers object in String format that was passed in upon creation of this pipeline run. Omitted if no trigger_headers object was provided when creating the pipeline run
Properties used in this Tekton pipeline run. Not included when fetching the list of pipeline runs
Possible values: 0 ≤ number of items ≤ 1024
Standard RFC 3339 Date Time String. Only included if the run has been updated since it was created
Possible values: 20 ≤ length ≤ 24
Error message that provides details when a pipeline run encounters an error
Status Code
Pipeline run detail
Authentication error or the IAM bearer token is missing
Pipeline run not found or authorization failed
Too many requests have been made within a given time window.
{ "id": "1681024e-4dfe-40dd-922b-b55719120078", "worker": { "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f", "agent_id": "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", "description": "My custom manual PipelineRun", "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90", "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\"}]}", "trigger_headers": "{\"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", "definition": { "id": "ee41a181-afed-4308-bf2a-84d6c677a005" }, "listener_name": "manual-listener", "created_at": "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", "enabled": true, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57", "type": "manual", "event_listener": "manual-listener", "properties": [ { "name": "new", "value": "123", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57/properties/new" } ] }, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/1681024e-4dfe-40dd-922b-b55719120078", "run_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/open-toolchain/hello-tekton.git", "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 pipeline run record identified by {id}
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); }
response = cd_tekton_pipeline_service.delete_tekton_pipeline_run( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', id='94619026-912b-4d92-8f51-6c74f0692d90', )
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();
Cancel a pipeline run
This request cancels a running pipeline run identified by {id}
. Use force: true
in the body if the pipeline run can't be cancelled 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
Cancel a pipeline run. Include force option to force the pipeline run status to be 'cancelled' in case you can't cancel a pipeline run normally
{
"force": true
}
Flag indicating whether the pipeline cancellation action is forced or not
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); }
response = cd_tekton_pipeline_service.cancel_tekton_pipeline_run( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', id='94619026-912b-4d92-8f51-6c74f0692d90', force=True, ) pipeline_run = response.get_result() print(json.dumps(pipeline_run, indent=2))
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);
Response
Single Tekton pipeline run object
UUID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Status of the pipeline run
Possible values: [
pending
,waiting
,queued
,running
,cancelled
,failed
,error
,succeeded
]The aggregated definition ID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Worker details used in this pipeline run
The ID of the pipeline to which this pipeline run belongs
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Listener name used to start the run
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Tekton pipeline trigger
Event parameters object in String format that was passed in upon creation of this pipeline run, the contents depends on the type of trigger. For example, the Git event payload is included for Git triggers, or in the case of a manual trigger the override and added properties are included
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
URL for the details page of this pipeline run
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
General href URL
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Information about the user that triggered a pipeline run. Only included for pipeline runs that were manually triggered
Reference to the pipeline definition of a pipeline run
A description of the PipelineRun
Reference to the pipeline to which a pipeline run belongs
Trigger headers object in String format that was passed in upon creation of this pipeline run. Omitted if no trigger_headers object was provided when creating the pipeline run
Properties used in this Tekton pipeline run. Not included when fetching the list of pipeline runs
Possible values: 0 ≤ number of items ≤ 1024
Standard RFC 3339 Date Time String. Only included if the run has been updated since it was created
Possible values: 20 ≤ length ≤ 24
Error message that provides details when a pipeline run encounters an error
Status Code
Pipeline run detail
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Pipeline run not found or authorization failed
Too many requests have been made within a given time window.
{ "id": "1681024e-4dfe-40dd-922b-b55719120078", "worker": { "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f", "agent_id": "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": "cancelled", "pipeline_id": "94619026-912b-4d92-8f51-6c74f0692d90", "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\"}]}", "trigger_headers": "{\"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", "definition": { "id": "ee41a181-afed-4308-bf2a-84d6c677a005" }, "listener_name": "manual-listener", "description": "My custom manual PipelineRun", "created_at": "2021-11-23T21:28:03.824Z", "updated_at": "2022-01-28T19:05:45.764Z", "build_number": 1388, "trigger": { "id": "03b05e3d-cb46-44c9-8a4a-f12b76d7ae57", "name": "manual-trigger", "type": "manual", "enabled": true, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57", "event_listener": "manual-listener", "properties": [ { "name": "new", "value": "123", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57/properties/new" } ] }, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/1681024e-4dfe-40dd-922b-b55719120078", "run_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/open-toolchain/hello-tekton.git", "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, which is identified by {id}
, with the 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); }
response = cd_tekton_pipeline_service.rerun_tekton_pipeline_run( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', id='94619026-912b-4d92-8f51-6c74f0692d90', ) pipeline_run = response.get_result() print(json.dumps(pipeline_run, indent=2))
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);
Response
Single Tekton pipeline run object
UUID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Status of the pipeline run
Possible values: [
pending
,waiting
,queued
,running
,cancelled
,failed
,error
,succeeded
]The aggregated definition ID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Worker details used in this pipeline run
The ID of the pipeline to which this pipeline run belongs
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Listener name used to start the run
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Tekton pipeline trigger
Event parameters object in String format that was passed in upon creation of this pipeline run, the contents depends on the type of trigger. For example, the Git event payload is included for Git triggers, or in the case of a manual trigger the override and added properties are included
Standard RFC 3339 Date Time String
Possible values: 20 ≤ length ≤ 24
URL for the details page of this pipeline run
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
General href URL
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Information about the user that triggered a pipeline run. Only included for pipeline runs that were manually triggered
Reference to the pipeline definition of a pipeline run
A description of the PipelineRun
Reference to the pipeline to which a pipeline run belongs
Trigger headers object in String format that was passed in upon creation of this pipeline run. Omitted if no trigger_headers object was provided when creating the pipeline run
Properties used in this Tekton pipeline run. Not included when fetching the list of pipeline runs
Possible values: 0 ≤ number of items ≤ 1024
Standard RFC 3339 Date Time String. Only included if the run has been updated since it was created
Possible values: 20 ≤ length ≤ 24
Error message that provides details when a pipeline run encounters an error
Status Code
Pipeline run detail
Authentication error or the IAM bearer token is missing
Pipeline run not found or authorization failed
Too many requests have been made within a given time window.
{ "id": "1681024e-4dfe-40dd-922b-b55719120078", "worker": { "id": "6f97df8f-5727-4a2b-bb71-541ba8e3f71f", "agent_id": "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", "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\"}]}", "trigger_headers": "{\"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", "definition": { "id": "ee41a181-afed-4308-bf2a-84d6c677a005" }, "listener_name": "manual-listener", "description": "My custom manual PipelineRun", "created_at": "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", "enabled": true, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57", "event_listener": "manual-listener", "properties": [ { "name": "new", "value": "123", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/03b05e3d-cb46-44c9-8a4a-f12b76d7ae57/properties/new" } ] }, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/pipeline_runs/1681024e-4dfe-40dd-922b-b55719120078", "run_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/open-toolchain/hello-tekton.git", "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 objects
This request fetches a list of log data for a pipeline run identified by {id}
. The href
in each log entry can be used to fetch that individual log
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", ) logsCollection, response, err := cdTektonPipelineService.GetTektonPipelineRunLogs(getTektonPipelineRunLogsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(logsCollection, "", " ") 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); }
response = cd_tekton_pipeline_service.get_tekton_pipeline_run_logs( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', id='94619026-912b-4d92-8f51-6c74f0692d90', ) logs_collection = response.get_result() print(json.dumps(logs_collection, indent=2))
GetTektonPipelineRunLogsOptions getTektonPipelineRunLogsOptions = new GetTektonPipelineRunLogsOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .id("94619026-912b-4d92-8f51-6c74f0692d90") .build(); Response<LogsCollection> response = cdTektonPipelineService.getTektonPipelineRunLogs(getTektonPipelineRunLogsOptions).execute(); LogsCollection logsCollection = response.getResult(); System.out.println(logsCollection);
Response
The list of pipeline run log objects
Possible values: 0 ≤ number of items ≤ 1024
Status Code
List of pipeline run log objects
Authentication error or the IAM bearer token is missing
Pipeline run not found or authorization failed
Too many requests have been made within a given time window.
{ "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/pipeline/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/pipeline/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
This request retrieves the log content of a pipeline run step, where the step is identified by {id}
. To get the log ID use the 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); }
response = 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', ) step_log = response.get_result() print(json.dumps(step_log, indent=2))
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);
Response
Logs for a Tekton pipeline run step
The raw log content of the step. Only included when fetching an individual log object
Possible values: Value must match regular expression
[\s\S]*
Step log ID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Status Code
Log content of a step
Authentication error or the IAM bearer token is missing
Pipeline run logs not found or authorization failed
Too many requests have been made within a given time window.
{ "data": "log content", "id": "e92705ed-e0a0-4f3a-94ed-830df2c4f7fd" }
List pipeline definitions
This request fetches pipeline definitions, which is a collection of individual definition entries. Each entry consists of a repository url, a repository path and a branch or tag. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. The branch or tag of the definition must match against a corresponding branch or tag in the chosen repository, and the path must match a subfolder in the repository
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", ) definitionsCollection, response, err := cdTektonPipelineService.ListTektonPipelineDefinitions(listTektonPipelineDefinitionsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(definitionsCollection, "", " ") 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); }
response = cd_tekton_pipeline_service.list_tekton_pipeline_definitions( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', ) definitions_collection = response.get_result() print(json.dumps(definitions_collection, indent=2))
ListTektonPipelineDefinitionsOptions listTektonPipelineDefinitionsOptions = new ListTektonPipelineDefinitionsOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .build(); Response<DefinitionsCollection> response = cdTektonPipelineService.listTektonPipelineDefinitions(listTektonPipelineDefinitionsOptions).execute(); DefinitionsCollection definitionsCollection = response.getResult(); System.out.println(definitionsCollection);
Response
Pipeline definitions is a collection of individual definition entries, each entry consists of a repository URL, a repository path, and a branch or tag
The list of all definitions in the pipeline
Possible values: 0 ≤ number of items ≤ 128
Status Code
List of pipeline definitions
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "definitions": [ { "source": { "type": "git", "properties": { "path": ".tekton", "url": "https://github.com/open-toolchain/hello-tekton.git", "branch": "master", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "id": "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/definitions/94299034-d45f-4e9a-8ed5-6bd5c7bb7ada" } ] }
Create a single definition
This request adds a single definition. The source properties should consist of a repository url, a repository path and a branch or tag. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. The branch or tag of the definition must match against a corresponding branch or tag in the chosen repository, and the path must match a subfolder in the repository
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 or update a single definition entry. The source property must consist of a properties object containing a repository url, a repository path and a branch or tag
{
"source": {
"type": "git",
"properties": {
"path": ".tekton",
"url": "https://github.com/open-toolchain/hello-tekton.git",
"branch": "master"
}
}
}
Source repository containing the Tekton pipeline definition
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "source": { "type": "git", "properties": { "path": ".tekton", "url": "https://github.com/open-toolchain/hello-tekton.git", "branch": "master" } } }' "{base_url}/tekton_pipelines/{pipeline_id}/definitions"
definitionSourcePropertiesModel := &cdtektonpipelinev2.DefinitionSourceProperties{ URL: core.StringPtr("https://github.com/open-toolchain/hello-tekton.git"), Branch: core.StringPtr("master"), Path: core.StringPtr(".tekton"), } definitionSourceModel := &cdtektonpipelinev2.DefinitionSource{ Type: core.StringPtr("git"), Properties: definitionSourcePropertiesModel, } createTektonPipelineDefinitionOptions := cdTektonPipelineService.NewCreateTektonPipelineDefinitionOptions( "94619026-912b-4d92-8f51-6c74f0692d90", definitionSourceModel, ) 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. // DefinitionSourceProperties const definitionSourcePropertiesModel = { url: 'https://github.com/open-toolchain/hello-tekton.git', branch: 'master', path: '.tekton', }; // DefinitionSource const definitionSourceModel = { type: 'git', properties: definitionSourcePropertiesModel, }; const params = { pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90', source: definitionSourceModel, }; let res; try { res = await cdTektonPipelineService.createTektonPipelineDefinition(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
definition_source_properties_model = { 'url': 'https://github.com/open-toolchain/hello-tekton.git', 'branch': 'master', 'path': '.tekton', } definition_source_model = { 'type': 'git', 'properties': definition_source_properties_model, } response = cd_tekton_pipeline_service.create_tekton_pipeline_definition( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', source=definition_source_model, ) definition = response.get_result() print(json.dumps(definition, indent=2))
DefinitionSourceProperties definitionSourcePropertiesModel = new DefinitionSourceProperties.Builder() .url("https://github.com/open-toolchain/hello-tekton.git") .branch("master") .path(".tekton") .build(); DefinitionSource definitionSourceModel = new DefinitionSource.Builder() .type("git") .xProperties(definitionSourcePropertiesModel) .build(); CreateTektonPipelineDefinitionOptions createTektonPipelineDefinitionOptions = new CreateTektonPipelineDefinitionOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .source(definitionSourceModel) .build(); Response<Definition> response = cdTektonPipelineService.createTektonPipelineDefinition(createTektonPipelineDefinitionOptions).execute(); Definition definition = response.getResult(); System.out.println(definition);
Response
Tekton pipeline definition entry object, consisting of a repository url, a repository path and a branch or tag. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. The branch or tag of the definition must match against a corresponding branch or tag in the chosen repository, and the path must match a subfolder in the repository
Source repository containing the Tekton pipeline definition
The aggregated definition ID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
API URL for interacting with the definition
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Status Code
The added definition
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "source": { "type": "git", "properties": { "path": ".tekton", "url": "https://github.com/open-toolchain/hello-tekton.git", "branch": "master", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/definitions/94299034-d45f-4e9a-8ed5-6bd5c7bb7ada", "id": "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada" }
Retrieve a single definition entry
This request fetches a single definition entry, which consists of the definition repository URL, a repository path, and a branch or tag
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); }
response = cd_tekton_pipeline_service.get_tekton_pipeline_definition( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', definition_id='94299034-d45f-4e9a-8ed5-6bd5c7bb7ada', ) definition = response.get_result() print(json.dumps(definition, indent=2))
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);
Response
Tekton pipeline definition entry object, consisting of a repository url, a repository path and a branch or tag. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. The branch or tag of the definition must match against a corresponding branch or tag in the chosen repository, and the path must match a subfolder in the repository
Source repository containing the Tekton pipeline definition
The aggregated definition ID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
API URL for interacting with the definition
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Status Code
The requested definition entry
Authentication error or the IAM bearer token is missing
Definition not found or authorization failed
Too many requests have been made within a given time window.
{ "source": { "type": "git", "properties": { "path": ".tekton", "url": "https://github.com/open-toolchain/hello-tekton.git", "branch": "master", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "id": "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/definitions/94299034-d45f-4e9a-8ed5-6bd5c7bb7ada" }
Edit a single definition entry
This request updates a definition entry identified by {definition_id}
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
Request body used to create or update a single definition entry. The source property must consist of a properties object containing a repository url, a repository path and a branch or tag
{
"source": null,
"type": "git",
"properties": {
"path": ".tekton",
"url": "https://github.com/open-toolchain/hello-tekton.git",
"branch": "master"
}
}
Source repository containing the Tekton pipeline definition
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{"source":null,"type":"git","properties":{"path":".tekton","url":"https://github.com/open-toolchain/hello-tekton.git","branch":"master"}}' "{base_url}/tekton_pipelines/{pipeline_id}/definitions/{definition_id}"
definitionSourcePropertiesModel := &cdtektonpipelinev2.DefinitionSourceProperties{ URL: core.StringPtr("testString"), Path: core.StringPtr("testString"), } definitionSourceModel := &cdtektonpipelinev2.DefinitionSource{ Type: core.StringPtr("testString"), Properties: definitionSourcePropertiesModel, } replaceTektonPipelineDefinitionOptions := cdTektonPipelineService.NewReplaceTektonPipelineDefinitionOptions( "94619026-912b-4d92-8f51-6c74f0692d90", "94299034-d45f-4e9a-8ed5-6bd5c7bb7ada", definitionSourceModel, ) 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. // DefinitionSourceProperties const definitionSourcePropertiesModel = { url: 'testString', path: 'testString', }; // DefinitionSource const definitionSourceModel = { type: 'testString', properties: definitionSourcePropertiesModel, }; const params = { pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90', definitionId: '94299034-d45f-4e9a-8ed5-6bd5c7bb7ada', source: definitionSourceModel, }; let res; try { res = await cdTektonPipelineService.replaceTektonPipelineDefinition(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
definition_source_properties_model = { 'url': 'testString', 'path': 'testString', } definition_source_model = { 'type': 'testString', 'properties': definition_source_properties_model, } response = cd_tekton_pipeline_service.replace_tekton_pipeline_definition( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', definition_id='94299034-d45f-4e9a-8ed5-6bd5c7bb7ada', source=definition_source_model, ) definition = response.get_result() print(json.dumps(definition, indent=2))
DefinitionSourceProperties definitionSourcePropertiesModel = new DefinitionSourceProperties.Builder() .url("testString") .path("testString") .build(); DefinitionSource definitionSourceModel = new DefinitionSource.Builder() .type("testString") .xProperties(definitionSourcePropertiesModel) .build(); ReplaceTektonPipelineDefinitionOptions replaceTektonPipelineDefinitionOptions = new ReplaceTektonPipelineDefinitionOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .definitionId("94299034-d45f-4e9a-8ed5-6bd5c7bb7ada") .source(definitionSourceModel) .build(); Response<Definition> response = cdTektonPipelineService.replaceTektonPipelineDefinition(replaceTektonPipelineDefinitionOptions).execute(); Definition definition = response.getResult(); System.out.println(definition);
Response
Tekton pipeline definition entry object, consisting of a repository url, a repository path and a branch or tag. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. The branch or tag of the definition must match against a corresponding branch or tag in the chosen repository, and the path must match a subfolder in the repository
Source repository containing the Tekton pipeline definition
The aggregated definition ID
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
API URL for interacting with the definition
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Status Code
Updated definition metadata
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Definition not found or authorization failed
Too many requests have been made within a given time window.
{ "source": { "type": "git", "properties": { "path": ".tekton", "url": "https://github.com/open-toolchain/hello-tekton.git", "branch": "master", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "id": "22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/definitions/22f92ab1-e0ac-4c65-84e7-8a4cb32dba0f" }
Delete a single definition entry
This request deletes a single definition from the 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); }
response = cd_tekton_pipeline_service.delete_tekton_pipeline_definition( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', definition_id='94299034-d45f-4e9a-8ed5-6bd5c7bb7ada', )
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();
List the pipeline's environment properties
This request lists the environment properties of the pipeline identified by {pipeline_id}
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: 0 ≤ number of items ≤ 5
Examples:[ "secure", "text" ]
Sorts the returned properties by name, in ascending order using
name
or in descending order using-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") propertiesCollection, response, err := cdTektonPipelineService.ListTektonPipelineProperties(listTektonPipelinePropertiesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(propertiesCollection, "", " ") 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); }
response = cd_tekton_pipeline_service.list_tekton_pipeline_properties( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', name='prod', type=['secure', 'text'], sort='name', ) properties_collection = response.get_result() print(json.dumps(properties_collection, indent=2))
ListTektonPipelinePropertiesOptions listTektonPipelinePropertiesOptions = new ListTektonPipelinePropertiesOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .name("prod") .type(java.util.Arrays.asList("secure", "text")) .sort("name") .build(); Response<PropertiesCollection> response = cdTektonPipelineService.listTektonPipelineProperties(listTektonPipelinePropertiesOptions).execute(); PropertiesCollection propertiesCollection = response.getResult(); System.out.println(propertiesCollection);
Response
Pipeline properties object
Pipeline properties list
Possible values: 0 ≤ number of items ≤ 1024
Status Code
List of pipeline's environment properties
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "properties": [ { "name": "ad123", "value": "ad123-value", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123" } ] }
Create a pipeline environment property
This request creates an 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
{
"name": "prop1",
"value": "https://github.com/open-toolchain/hello-tekton.git",
"type": "text"
}
{
"name": "secret1",
"value": "C1V8amO0VYga5gD7PstC8mhnLi9iYVaWUb/CHLoFWGpSnf8c7LBwT4picQRBXlKa2WG5eEn534mB2eorKfetEw==",
"type": "secure"
}
{
"name": "enums",
"type": "single_select",
"enum": [
"option1",
"option2",
"option3"
],
"value": "option1"
}
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Allowable values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
Options for
single_select
property type. Only needed when usingsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
When true, this property cannot be overridden by a trigger property or at runtime. Attempting to override it will result in run requests being rejected. The default is false.
Default:
false
A dot notation path for
integration
type properties only, to select a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "prop1", "value": "https://github.com/open-toolchain/hello-tekton.git", "type": "text" }' "{base_url}/tekton_pipelines/{pipeline_id}/properties"
createTektonPipelinePropertiesOptions := cdTektonPipelineService.NewCreateTektonPipelinePropertiesOptions( "94619026-912b-4d92-8f51-6c74f0692d90", "prop1", "text", ) createTektonPipelinePropertiesOptions.SetValue("https://github.com/open-toolchain/hello-tekton.git") 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: 'prop1', type: 'text', value: 'https://github.com/open-toolchain/hello-tekton.git', }; let res; try { res = await cdTektonPipelineService.createTektonPipelineProperties(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = cd_tekton_pipeline_service.create_tekton_pipeline_properties( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', name='prop1', type='text', value='https://github.com/open-toolchain/hello-tekton.git', ) property = response.get_result() print(json.dumps(property, indent=2))
CreateTektonPipelinePropertiesOptions createTektonPipelinePropertiesOptions = new CreateTektonPipelinePropertiesOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .name("prop1") .type("text") .value("https://github.com/open-toolchain/hello-tekton.git") .build(); Response<Property> response = cdTektonPipelineService.createTektonPipelineProperties(createTektonPipelinePropertiesOptions).execute(); Property property = response.getResult(); System.out.println(property);
Response
Property object
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Possible values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
API URL for interacting with the property
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Options for
single_select
property type. Only needed when usingsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
When true, this property cannot be overridden by a trigger property or at runtime. Attempting to override it will result in run requests being rejected. The default is false.
A dot notation path for
integration
type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
Status Code
Environment property added
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "ad123", "value": "ad123-value", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123" }
Get a pipeline environment property
This request gets the data of an environment property identified by {property_name}
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 name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
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); }
response = cd_tekton_pipeline_service.get_tekton_pipeline_property( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', property_name='debug-pipeline', ) property = response.get_result() print(json.dumps(property, indent=2))
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);
Response
Property object
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Possible values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
API URL for interacting with the property
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Options for
single_select
property type. Only needed when usingsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
When true, this property cannot be overridden by a trigger property or at runtime. Attempting to override it will result in run requests being rejected. The default is false.
A dot notation path for
integration
type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
Status Code
Single property
Authentication error or the IAM bearer token is missing
Pipeline property not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "ad123", "value": "ad123-value", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123" }
Replace the value of an environment property
This request updates the value of an environment property identified by {property_name}
, its type and name are immutable
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 name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Example:
debug-pipeline
Property object
{
"name": "prop1",
"value": "https://github.com/open-toolchain/hello-tekton.git",
"type": "text"
}
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Allowable values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
Options for
single_select
property type. Only needed when usingsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
When true, this property cannot be overridden by a trigger property or at runtime. Attempting to override it will result in run requests being rejected. The default is false.
Default:
false
A dot notation path for
integration
type properties only, to select a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "prop1", "value": "https://github.com/open-toolchain/hello-tekton.git", "type": "text" }' "{base_url}/tekton_pipelines/{pipeline_id}/properties/{property_name}"
replaceTektonPipelinePropertyOptions := cdTektonPipelineService.NewReplaceTektonPipelinePropertyOptions( "94619026-912b-4d92-8f51-6c74f0692d90", "debug-pipeline", "prop1", "text", ) replaceTektonPipelinePropertyOptions.SetValue("https://github.com/open-toolchain/hello-tekton.git") 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: 'prop1', type: 'text', value: 'https://github.com/open-toolchain/hello-tekton.git', }; let res; try { res = await cdTektonPipelineService.replaceTektonPipelineProperty(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = cd_tekton_pipeline_service.replace_tekton_pipeline_property( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', property_name='debug-pipeline', name='prop1', type='text', value='https://github.com/open-toolchain/hello-tekton.git', ) property = response.get_result() print(json.dumps(property, indent=2))
ReplaceTektonPipelinePropertyOptions replaceTektonPipelinePropertyOptions = new ReplaceTektonPipelinePropertyOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .propertyName("debug-pipeline") .name("prop1") .type("text") .value("https://github.com/open-toolchain/hello-tekton.git") .build(); Response<Property> response = cdTektonPipelineService.replaceTektonPipelineProperty(replaceTektonPipelinePropertyOptions).execute(); Property property = response.getResult(); System.out.println(property);
Response
Property object
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Possible values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
API URL for interacting with the property
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Options for
single_select
property type. Only needed when usingsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
When true, this property cannot be overridden by a trigger property or at runtime. Attempting to override it will result in run requests being rejected. The default is false.
A dot notation path for
integration
type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
Status Code
Replaced pipeline property
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Pipeline property not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "ad123", "value": "ad123-value", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123" }
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 name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
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); }
response = cd_tekton_pipeline_service.delete_tekton_pipeline_property( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', property_name='debug-pipeline', )
DeleteTektonPipelinePropertyOptions deleteTektonPipelinePropertyOptions = new DeleteTektonPipelinePropertyOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .propertyName("debug-pipeline") .build(); Response<Void> response = cdTektonPipelineService.deleteTektonPipelineProperty(deleteTektonPipelinePropertyOptions).execute();
List pipeline triggers
This request lists pipeline triggers for the pipeline identified by {pipeline_id}
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
Optional filter by "type", accepts a comma separated list of types. Valid types are "manual", "scm", "generic", and "timer"
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_,]+$
Example:
manual,scm
Optional filter by "name", accepts a single string value
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_,]+$
Optional filter by "event_listener", accepts a single string value
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_,]+$
Optional filter by "worker.id", accepts a single string value
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_,]+$
Optional filter by "worker.name", accepts a single string value
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_,]+$
Optional filter by "disabled" state, possible values are "true" or "false"
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_,]+$
Example:
true
Optional filter by "tags", accepts a comma separated list of tags. The response lists triggers having at least 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") triggersCollection, response, err := cdTektonPipelineService.ListTektonPipelineTriggers(listTektonPipelineTriggersOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(triggersCollection, "", " ") 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); }
response = cd_tekton_pipeline_service.list_tekton_pipeline_triggers( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', type='manual,scm', disabled='true', tags='tag1,tag2', ) triggers_collection = response.get_result() print(json.dumps(triggers_collection, indent=2))
ListTektonPipelineTriggersOptions listTektonPipelineTriggersOptions = new ListTektonPipelineTriggersOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .type("manual,scm") .disabled("true") .tags("tag1,tag2") .build(); Response<TriggersCollection> response = cdTektonPipelineService.listTektonPipelineTriggers(listTektonPipelineTriggersOptions).execute(); TriggersCollection triggersCollection = response.getResult(); System.out.println(triggersCollection);
Response
Tekton pipeline triggers object
Tekton pipeline triggers list
Possible values: 0 ≤ number of items ≤ 1024
- triggers
Status Code
List of triggers for the pipeline identified by
{pipeline_id}
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "triggers": [ { "type": "scm", "name": "git-trigger", "event_listener": "pr-listener", "id": "50283ad5-90f3-48f1-9a59-47e8abf0062b", "enabled": true, "tags": [ "tag1", "tag2" ], "properties": [ { "name": "asd", "value": "asd", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/50283ad5-90f3-48f1-9a59-47e8abf0062b/properties/asd" } ], "source": { "type": "git", "properties": { "url": "https://github.com/open-toolchain/hello-tekton.git", "blind_connection": false, "branch": "master", "hook_id": "330377364", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "events": [ "push", "pull_request" ], "enable_events_from_forks": false, "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/50283ad5-90f3-48f1-9a59-47e8abf0062b" } ] }
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
Tekton pipeline trigger
{
"type": "manual",
"event_listener": "pr-listener",
"name": "Manual Trigger",
"enabled": true,
"max_concurrent_runs": 3,
"worker": {
"id": "public"
}
}
{
"type": "scm",
"event_listener": "pr-listener",
"name": "Git Trigger",
"enabled": true,
"source": {
"type": "git",
"properties": {
"url": "https://github.com/open-toolchain/hello-tekton.git",
"branch": "master"
}
},
"events": [
"push",
"pull_request"
],
"enable_events_from_forks": true,
"properties": [
{
"name": "prop1",
"value": "https://github.com/open-toolchain/hello-tekton.git",
"type": "text"
},
{
"name": "secret1",
"value": "C1V8amO0VYga5gD7PstC8mhnLi9iYVaWUb/CHLoFWGpSnf8c7LBwT4picQRBXlKa2WG5eEn534mB2eorKfetEw==",
"type": "secure"
},
{
"name": "enums",
"type": "single_select",
"enum": [
"option1",
"option2",
"option3"
],
"value": "option1"
}
]
}
{
"type": "timer",
"enabled": true,
"event_listener": "pr-listener",
"name": "Timer Trigger",
"cron": "*/5 * * * *",
"timezone": "America/Toronto",
"worker": {
"id": "public"
}
}
{
"type": "generic",
"name": "Generic Webhook Trigger",
"event_listener": "pr-listener",
"enabled": true,
"tags": [
"prod",
"dev"
],
"worker": {
"id": "5df804a4-9d7b-44e1-874f-3810866fb80b"
},
"secret": {
"value": "secret",
"type": "token_matches",
"source": "query",
"key_name": "auth"
}
}
Trigger type
Allowable values: [
manual
,scm
,timer
,generic
]Trigger name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\(\)\[\]]{1,251}[a-zA-Z0-9])$
Example:
start-deploy
Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Trigger tags array
Possible values: 0 ≤ number of items ≤ 128, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Specify the worker used to run the trigger. Use
worker: { id: 'public' }
to use the IBM Managed workers. The default is to inherit the worker set in the pipeline settings, which can also be explicitly set usingworker: { id: 'inherit' }
- worker
ID of the worker
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z]{1,253}$
Defines the maximum number of concurrent runs for this trigger. If omitted then the concurrency limit is disabled for this trigger
Example:
4
Flag to check if the trigger is enabled. If omitted the trigger is enabled by default
Default:
true
Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger
Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 */2 * * * - translates to - every 2 hours
Possible values: 5 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z,\*\/ ]{5,253}$
Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z+_., /]{1,253}$
Example:
America/Los_Angeles, CET, Europe/London, GMT, US/Eastern, or UTC
Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools
Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'
Allowable values: [
push
,pull_request
,pull_request_closed
]Possible values: 0 ≤ number of items ≤ 3
Examples:[ "push", "pull_request" ]
Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^.*$
Example:
header['x-github-event'] == 'push' && body.ref == 'refs/heads/main'
Mark the trigger as a favorite
Default:
false
Only used for SCM triggers. When enabled, pull request events from forks of the selected repository will trigger a pipeline run
Default:
false
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "type": "manual", "event_listener": "pr-listener", "name": "Manual Trigger", "enabled": true, "max_concurrent_runs": 3, "worker": { "id": "public" } }' "{base_url}/tekton_pipelines/{pipeline_id}/triggers"
workerIdentityModel := &cdtektonpipelinev2.WorkerIdentity{ ID: core.StringPtr("public"), } createTektonPipelineTriggerOptions := cdTektonPipelineService.NewCreateTektonPipelineTriggerOptions( "94619026-912b-4d92-8f51-6c74f0692d90", "manual", "Manual Trigger", "pr-listener", ) createTektonPipelineTriggerOptions.SetWorker(workerIdentityModel) createTektonPipelineTriggerOptions.SetMaxConcurrentRuns(int64(3)) createTektonPipelineTriggerOptions.SetEnabled(true) 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. // WorkerIdentity const workerIdentityModel = { id: 'public', }; const params = { pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90', type: 'manual', name: 'Manual Trigger', eventListener: 'pr-listener', worker: workerIdentityModel, maxConcurrentRuns: 3, enabled: true, }; let res; try { res = await cdTektonPipelineService.createTektonPipelineTrigger(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
worker_identity_model = { 'id': 'public', } response = cd_tekton_pipeline_service.create_tekton_pipeline_trigger( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', type='manual', name='Manual Trigger', event_listener='pr-listener', worker=worker_identity_model, max_concurrent_runs=3, enabled=True, ) trigger = response.get_result() print(json.dumps(trigger, indent=2))
WorkerIdentity workerIdentityModel = new WorkerIdentity.Builder() .id("public") .build(); CreateTektonPipelineTriggerOptions createTektonPipelineTriggerOptions = new CreateTektonPipelineTriggerOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .type("manual") .name("Manual Trigger") .eventListener("pr-listener") .worker(workerIdentityModel) .maxConcurrentRuns(Long.valueOf("3")) .enabled(true) .build(); Response<Trigger> response = cdTektonPipelineService.createTektonPipelineTrigger(createTektonPipelineTriggerOptions).execute(); Trigger trigger = response.getResult(); System.out.println(trigger);
Response
Tekton pipeline trigger
Trigger type
Possible values: [
manual
,scm
,timer
,generic
]Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Flag to check if the trigger is enabled
API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run
Possible values: 0 ≤ number of items ≤ 1024
Optional trigger tags array
Possible values: 0 ≤ number of items ≤ 128
Details of the worker used to run the trigger
- worker
ID of the worker
Possible values: 1 ≤ length ≤ 36, Value must match regular expression
^[-0-9a-zA-Z]{1,36}$
Name of the worker. Computed based on the worker ID
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_. \(\)\[\]]{1,253}$
Type of the worker. Computed based on the worker ID
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Mark the trigger as a favorite
Status Code
The created trigger
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Pipeline not found or authorization failed
Too many requests have been made within a given time window.
{ "type": "scm", "name": "git-trigger", "event_listener": "pr-listener", "enabled": true, "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/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/50283ad5-90f3-48f1-9a59-47e8abf0062b/properties/asd" } ], "source": { "type": "git", "properties": { "url": "https://github.com/open-toolchain/hello-tekton.git", "type": "GitHub", "blind_connection": false, "branch": "master", "hook_id": "330377364", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "events": [ "push", "pull_request", "pull_request_closed" ], "enable_events_from_forks": false }
Get a single trigger
This request retrieves a single trigger identified by {trigger_id}
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); }
response = cd_tekton_pipeline_service.get_tekton_pipeline_trigger( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', trigger_id='1bb892a1-2e04-4768-a369-b1159eace147', ) trigger = response.get_result() print(json.dumps(trigger, indent=2))
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);
Response
Tekton pipeline trigger
Trigger type
Possible values: [
manual
,scm
,timer
,generic
]Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Flag to check if the trigger is enabled
API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run
Possible values: 0 ≤ number of items ≤ 1024
Optional trigger tags array
Possible values: 0 ≤ number of items ≤ 128
Details of the worker used to run the trigger
- worker
ID of the worker
Possible values: 1 ≤ length ≤ 36, Value must match regular expression
^[-0-9a-zA-Z]{1,36}$
Name of the worker. Computed based on the worker ID
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_. \(\)\[\]]{1,253}$
Type of the worker. Computed based on the worker ID
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Mark the trigger as a favorite
Status Code
the trigger requested
Authentication error or the IAM bearer token is missing
Trigger not found or authorization failed
Too many requests have been made within a given time window.
{ "type": "generic", "name": "generic webhook trigger", "event_listener": "pr-listener", "id": "62ec6bf4-8cb5-4713-b73a-7baaa9fa876e", "tags": [ "tag2" ], "enabled": true, "secret": { "type": "digest_matches", "value": "hash:SHA3-512:4ce44af678a8acf09c99c2fb6b3b2b9f4e1d9fe016c268388f824cebed34f75c24f8177da5ea9d614fd2cd68ac35ad4da09d8f10f7f0216029f0639785552755", "source": "query", "key_name": "asd123", "algorithm": "md4" }, "webhook_url": "https://devops-api.us-south.devops.cloud.ibm.com/v1/tekton-webhook/94619026-912b-4d92-8f51-6c74f0692d90/run/62ec6bf4-8cb5-4713-b73a-7baaa9fa876e" }
Edit a trigger
This request changes a single field or many fields of the trigger identified by {trigger_id}
. Note that some fields are immutable, and use /properties
endpoint 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 the trigger
{
"name": "start-deploy"
}
{
"source": {
"type": "git",
"properties": {
"branch": "master",
"url": "https://github.com/open-toolchain/hello-tekton.git"
}
}
}
{
"cron": "*/10 * * * *"
}
{
"secret": {
"value": "new-secret"
}
}
Trigger type
Allowable values: [
manual
,scm
,timer
,generic
]Trigger name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\(\)\[\]]{1,251}[a-zA-Z0-9])$
Example:
start-deploy
Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Trigger tags array. Optional tags for the trigger
Possible values: 0 ≤ number of items ≤ 128, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Specify the worker used to run the trigger. Use
worker: { id: 'public' }
to use the IBM Managed workers. Useworker: { id: 'inherit' }
to inherit the worker used by the pipeline- worker
ID of the worker
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z]{1,253}$
Defines the maximum number of concurrent runs for this trigger. If set to 0 then the custom concurrency limit is disabled for this trigger
Example:
4
Defines if this trigger is enabled
Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger
Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 */2 * * * - translates to - every 2 hours
Possible values: 5 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z,\*\/ ]{5,253}$
Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z+_., /]{1,253}$
Example:
America/Los_Angeles, CET, Europe/London, GMT, US/Eastern, or UTC
Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools
Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'
Allowable values: [
push
,pull_request
,pull_request_closed
]Possible values: 0 ≤ number of items ≤ 3
Examples:[ "push", "pull_request" ]
Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^.*$
Example:
header['x-github-event'] == 'push' && body.ref == 'refs/heads/main'
Mark the trigger as a favorite
Default:
false
Only used for SCM triggers. When enabled, pull request events from forks of the selected repository will trigger a pipeline run
Default:
false
curl -X PATCH --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/merge-patch+json" --data '{"name":"start-deploy"}' "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{trigger_id}"
triggerPatchModel := &cdtektonpipelinev2.TriggerPatch{ Name: core.StringPtr("start-deploy"), } triggerPatchModelAsPatch, asPatchErr := triggerPatchModel.AsPatch() Expect(asPatchErr).To(BeNil()) updateTektonPipelineTriggerOptions := cdTektonPipelineService.NewUpdateTektonPipelineTriggerOptions( "94619026-912b-4d92-8f51-6c74f0692d90", "1bb892a1-2e04-4768-a369-b1159eace147", ) updateTektonPipelineTriggerOptions.SetTriggerPatch(triggerPatchModelAsPatch) 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', }; let res; try { res = await cdTektonPipelineService.updateTektonPipelineTrigger(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
trigger_patch_model = { 'name': 'start-deploy', } response = cd_tekton_pipeline_service.update_tekton_pipeline_trigger( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', trigger_id='1bb892a1-2e04-4768-a369-b1159eace147', trigger_patch=trigger_patch_model, ) trigger = response.get_result() print(json.dumps(trigger, indent=2))
TriggerPatch triggerPatchModel = new TriggerPatch.Builder() .name("start-deploy") .build(); Map<String, Object> triggerPatchModelAsPatch = triggerPatchModel.asPatch(); UpdateTektonPipelineTriggerOptions updateTektonPipelineTriggerOptions = new UpdateTektonPipelineTriggerOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .triggerId("1bb892a1-2e04-4768-a369-b1159eace147") .triggerPatch(triggerPatchModelAsPatch) .build(); Response<Trigger> response = cdTektonPipelineService.updateTektonPipelineTrigger(updateTektonPipelineTriggerOptions).execute(); Trigger trigger = response.getResult(); System.out.println(trigger);
Response
Tekton pipeline trigger
Trigger type
Possible values: [
manual
,scm
,timer
,generic
]Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Flag to check if the trigger is enabled
API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run
Possible values: 0 ≤ number of items ≤ 1024
Optional trigger tags array
Possible values: 0 ≤ number of items ≤ 128
Details of the worker used to run the trigger
- worker
ID of the worker
Possible values: 1 ≤ length ≤ 36, Value must match regular expression
^[-0-9a-zA-Z]{1,36}$
Name of the worker. Computed based on the worker ID
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_. \(\)\[\]]{1,253}$
Type of the worker. Computed based on the worker ID
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Mark the trigger as a favorite
Status Code
The updated trigger
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Trigger not found or authorization failed
Too many requests have been made within a given time window.
{ "timer_id": "958d621e-d067-410f-a842-bf1c51a43db4", "enabled": true, "name": "time trigger", "event_listener": "pr-listener", "cron": "*/5 * * * *", "max_concurrent_runs": 2, "tags": [ "tag2", "tag3" ], "timezone": "America/Toronto", "type": "timer", "id": "e3676049-e9f6-4f6a-b8eb-ac58e00c53f7" }
Delete a single trigger
This request deletes the trigger identified by {trigger_id}
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); }
response = cd_tekton_pipeline_service.delete_tekton_pipeline_trigger( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', trigger_id='1bb892a1-2e04-4768-a369-b1159eace147', )
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();
Duplicate a trigger
This request duplicates a trigger from an existing trigger identified by {source_trigger_id}
POST /tekton_pipelines/{pipeline_id}/triggers/{source_trigger_id}/duplicate
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 ID of the trigger to duplicate
Possible values: length = 36, Value must match regular expression
^[-0-9a-z]+$
Example:
1bb892a1-2e04-4768-a369-b1159eace147
Duplicate an existing trigger
{
"name": "triggerName"
}
Trigger name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\(\)\[\]]{1,251}[a-zA-Z0-9])$
Example:
start-deploy
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "triggerName" }' "{base_url}/tekton_pipelines/{pipeline_id}/triggers/{source_trigger_id}/duplicate"
duplicateTektonPipelineTriggerOptions := cdTektonPipelineService.NewDuplicateTektonPipelineTriggerOptions( "94619026-912b-4d92-8f51-6c74f0692d90", "1bb892a1-2e04-4768-a369-b1159eace147", "triggerName", ) trigger, response, err := cdTektonPipelineService.DuplicateTektonPipelineTrigger(duplicateTektonPipelineTriggerOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(trigger, "", " ") fmt.Println(string(b))
const params = { pipelineId: '94619026-912b-4d92-8f51-6c74f0692d90', sourceTriggerId: '1bb892a1-2e04-4768-a369-b1159eace147', name: 'triggerName', }; let res; try { res = await cdTektonPipelineService.duplicateTektonPipelineTrigger(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = cd_tekton_pipeline_service.duplicate_tekton_pipeline_trigger( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', source_trigger_id='1bb892a1-2e04-4768-a369-b1159eace147', name='triggerName', ) trigger = response.get_result() print(json.dumps(trigger, indent=2))
DuplicateTektonPipelineTriggerOptions duplicateTektonPipelineTriggerOptions = new DuplicateTektonPipelineTriggerOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .sourceTriggerId("1bb892a1-2e04-4768-a369-b1159eace147") .name("triggerName") .build(); Response<Trigger> response = cdTektonPipelineService.duplicateTektonPipelineTrigger(duplicateTektonPipelineTriggerOptions).execute(); Trigger trigger = response.getResult(); System.out.println(trigger);
Response
Tekton pipeline trigger
Trigger type
Possible values: [
manual
,scm
,timer
,generic
]Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Flag to check if the trigger is enabled
API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run
Possible values: 0 ≤ number of items ≤ 1024
Optional trigger tags array
Possible values: 0 ≤ number of items ≤ 128
Details of the worker used to run the trigger
- worker
ID of the worker
Possible values: 1 ≤ length ≤ 36, Value must match regular expression
^[-0-9a-zA-Z]{1,36}$
Name of the worker. Computed based on the worker ID
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_. \(\)\[\]]{1,253}$
Type of the worker. Computed based on the worker ID
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Mark the trigger as a favorite
Status Code
The created trigger, which is based on duplicating the source trigger's configuration except that some fields are updated to ensure uniqueness
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Trigger not found or authorization failed
Too many requests have been made within a given time window.
{ "type": "scm", "name": "triggerName", "event_listener": "pr-listener", "enabled": true, "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/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/triggers/50283ad5-90f3-48f1-9a59-47e8abf0062b/properties/asd" } ], "source": { "type": "git", "properties": { "url": "https://github.com/open-toolchain/hello-tekton.git", "type": "GitHub", "blind_connection": false, "branch": "master", "hook_id": "330377364", "tool": { "id": "74895ba2-d6c9-4216-8a3e-eb883ae655d6" } } }, "events": [ "push", "pull_request" ], "enable_events_from_forks": false }
List trigger properties
This request lists trigger properties for the trigger identified by {trigger_id}
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
name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_,]+$
Example:
prod
Filter properties by
type
. Valid types aresecure
,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 name. They can be sorted in ascending order using
name
or in descending order using-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", ) listTektonPipelineTriggerPropertiesOptions.SetName("prod") listTektonPipelineTriggerPropertiesOptions.SetType("secure,text") listTektonPipelineTriggerPropertiesOptions.SetSort("name") triggerPropertiesCollection, response, err := cdTektonPipelineService.ListTektonPipelineTriggerProperties(listTektonPipelineTriggerPropertiesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(triggerPropertiesCollection, "", " ") 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); }
response = 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', ) trigger_properties_collection = response.get_result() print(json.dumps(trigger_properties_collection, indent=2))
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<TriggerPropertiesCollection> response = cdTektonPipelineService.listTektonPipelineTriggerProperties(listTektonPipelineTriggerPropertiesOptions).execute(); TriggerPropertiesCollection triggerPropertiesCollection = response.getResult(); System.out.println(triggerPropertiesCollection);
Response
Trigger properties object
Trigger properties list
Possible values: 0 ≤ number of items ≤ 1024
Status Code
List of trigger properties
Authentication error or the IAM bearer token is missing
Trigger not found or authorization failed
Too many requests have been made within a given time window.
{ "properties": [ { "name": "ad123", "value": "ad123-value", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123" } ] }
Create a trigger property
This request creates a property in the trigger identified by {trigger_id}
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 used to create or edit a property in a trigger
{
"name": "prop1",
"value": "https://github.com/open-toolchain/hello-tekton.git",
"type": "text"
}
{
"name": "secret1",
"value": "C1V8amO0VYga5gD7PstC8mhnLi9iYVaWUb/CHLoFWGpSnf8c7LBwT4picQRBXlKa2WG5eEn534mB2eorKfetEw==",
"type": "secure"
}
{
"name": "enums",
"type": "single_select",
"enum": [
"option1",
"option2",
"option3"
],
"value": "option1"
}
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Allowable values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
Options for
single_select
property type. Only needed forsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
A dot notation path for
integration
type properties only, to select a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
When true, this property cannot be overridden at runtime. Attempting to override it will result in run requests being rejected. The default is false.
Default:
false
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "prop1", "value": "https://github.com/open-toolchain/hello-tekton.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", "prop1", "text", ) createTektonPipelineTriggerPropertiesOptions.SetValue("https://github.com/open-toolchain/hello-tekton.git") 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: 'prop1', type: 'text', value: 'https://github.com/open-toolchain/hello-tekton.git', }; let res; try { res = await cdTektonPipelineService.createTektonPipelineTriggerProperties(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = cd_tekton_pipeline_service.create_tekton_pipeline_trigger_properties( pipeline_id='94619026-912b-4d92-8f51-6c74f0692d90', trigger_id='1bb892a1-2e04-4768-a369-b1159eace147', name='prop1', type='text', value='https://github.com/open-toolchain/hello-tekton.git', ) trigger_property = response.get_result() print(json.dumps(trigger_property, indent=2))
CreateTektonPipelineTriggerPropertiesOptions createTektonPipelineTriggerPropertiesOptions = new CreateTektonPipelineTriggerPropertiesOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .triggerId("1bb892a1-2e04-4768-a369-b1159eace147") .name("prop1") .type("text") .value("https://github.com/open-toolchain/hello-tekton.git") .build(); Response<TriggerProperty> response = cdTektonPipelineService.createTektonPipelineTriggerProperties(createTektonPipelineTriggerPropertiesOptions).execute(); TriggerProperty triggerProperty = response.getResult(); System.out.println(triggerProperty);
Response
Trigger property object
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Possible values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
API URL for interacting with the trigger property
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Options for
single_select
property type. Only needed forsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
A dot notation path for
integration
type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
When true, this property cannot be overridden at runtime. Attempting to override it will result in run requests being rejected. The default is false.
Status Code
Trigger property added
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Trigger not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "ad123", "value": "ad123-value", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123" }
Get a trigger property
This request retrieves a trigger 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 name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
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); }
response = 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', ) trigger_property = response.get_result() print(json.dumps(trigger_property, indent=2))
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);
Response
Trigger property object
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Possible values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
API URL for interacting with the trigger property
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Options for
single_select
property type. Only needed forsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
A dot notation path for
integration
type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
When true, this property cannot be overridden at runtime. Attempting to override it will result in run requests being rejected. The default is false.
Status Code
Trigger property
Authentication error or the IAM bearer token is missing
Trigger not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "ad123", "value": "ad123-value", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/ad123" }
Replace a trigger property value
This request updates a trigger property value, type and name are immutable
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 name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Example:
debug-pipeline
Trigger property object used to create or edit a property in a trigger
{
"name": "prop1",
"value": "https://github.com/open-toolchain/hello-tekton.git",
"type": "text"
}
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Allowable values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
Options for
single_select
property type. Only needed forsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
A dot notation path for
integration
type properties only, to select a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
When true, this property cannot be overridden at runtime. Attempting to override it will result in run requests being rejected. The default is false.
Default:
false
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "prop1", "value": "https://github.com/open-toolchain/hello-tekton.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", "prop1", "text", ) replaceTektonPipelineTriggerPropertyOptions.SetValue("https://github.com/open-toolchain/hello-tekton.git") 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: 'prop1', type: 'text', value: 'https://github.com/open-toolchain/hello-tekton.git', }; let res; try { res = await cdTektonPipelineService.replaceTektonPipelineTriggerProperty(params); console.log(JSON.stringify(res.result, null, 2)); } catch (err) { console.warn(err); }
response = 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='prop1', type='text', value='https://github.com/open-toolchain/hello-tekton.git', ) trigger_property = response.get_result() print(json.dumps(trigger_property, indent=2))
ReplaceTektonPipelineTriggerPropertyOptions replaceTektonPipelineTriggerPropertyOptions = new ReplaceTektonPipelineTriggerPropertyOptions.Builder() .pipelineId("94619026-912b-4d92-8f51-6c74f0692d90") .triggerId("1bb892a1-2e04-4768-a369-b1159eace147") .propertyName("debug-pipeline") .name("prop1") .type("text") .value("https://github.com/open-toolchain/hello-tekton.git") .build(); Response<TriggerProperty> response = cdTektonPipelineService.replaceTektonPipelineTriggerProperty(replaceTektonPipelineTriggerPropertyOptions).execute(); TriggerProperty triggerProperty = response.getResult(); System.out.println(triggerProperty);
Response
Trigger property object
Property name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
Property type
Possible values: [
secure
,text
,integration
,single_select
,appconfig
]Property value. Any string value is valid
Possible values: 0 ≤ length ≤ 4096, Value must match regular expression
^.*$
API URL for interacting with the trigger property
Possible values: 10 ≤ length ≤ 2048, Value must match regular expression
^http(s)?:\/\/([^\/?#]*)([^?#]*)(\?([^#]*))?(#(.*))?$
Options for
single_select
property type. Only needed forsingle_select
property typePossible values: 0 ≤ number of items ≤ 256, 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
A dot notation path for
integration
type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be usedPossible values: 0 ≤ length ≤ 4096, Value must match regular expression
^[-0-9a-zA-Z_.]*$
When true, this property cannot be overridden at runtime. Attempting to override it will result in run requests being rejected. The default is false.
Status Code
Edited trigger property
Malformed request syntax or invalid request body
Authentication error or the IAM bearer token is missing
Trigger not found or authorization failed
Too many requests have been made within a given time window.
{ "name": "prop1", "value": "https://github.com/open-toolchain/hello-tekton.git", "type": "text", "href": "https://api.us-south.devops.cloud.ibm.com/pipeline/v2/tekton_pipelines/94619026-912b-4d92-8f51-6c74f0692d90/properties/prop1" }
Delete a trigger property
This request deletes a trigger 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 name
Possible values: 1 ≤ length ≤ 253, Value must match regular expression
^[-0-9a-zA-Z_.]{1,253}$
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); }
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', )
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();