Pipeline retry API
Using API to retry pipeline with input set YAML
This knowledge base article provides step-by-step guidance on how to retry a pipeline based on the latest ExecutionId using Harness APIs.
Problem Statement
Retrying a pipeline based on the latest ExecutionId can be a challenging task, especially when dealing with complex deployment scenarios. Retrying a pipeline with an input set requires two API's :
API to get input set YAML from execution ID to get the inputset YAML used in the execution
API to rerty pipeline with input set YAML to retry the pipeline with input set YAML fetched from first API
Solution
Use the API Endpoint to get the input set YAML from pipeline execution id
Use the pipeline retry API Endpoint to retry the pipeline by passing the fetched input set YAML.
For example, the following Shell script uses Harness API endpoints to retrieve the input set YAML and retry the pipeline with the extracted input set YAML.To use this Shell script, replace placeholders, like ExecutionId, YOUR_API_TOKEN, YOUR_APPLICATION_ID, and YOUR_PIPELINE_ID with actual values relevant to your Harness account.
Problem
Retrying a pipeline based on the latest ExecutionId can be a challenging task, especially when dealing with complex deployment scenarios. Retrying a pipeline with an input set requires two endpoints:
Pipeline Execution Details API - Get the inputSet YAML used for a given Plan Execution endpoint
Pipeline Execute API - Retry an executed pipeline with inputSet pipeline YAML endpoint
Solution
Use the Pipeline Execution Details API to get the inputSet YAML used for the Plan Execution that you want to retry.
Use the Pipeline Execute API to retry the pipeline with the inputSet pipeline YAML.
Here is a Shell script that uses these two endpoints. To use this Shell script for yourself, replace placeholders, like ExecutionId, YOUR_API_TOKEN, YOUR_APPLICATION_ID, and YOUR_PIPELINE_ID, with actual values relevant to your Harness account.
Last updated
Was this helpful?