For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 :

  1. API to get input set YAML from execution ID to get the inputset YAML used in the execution

  2. API to rerty pipeline with input set YAML to retry the pipeline with input set YAML fetched from first API

Solution

  1. Use the API Endpoint to get the input set YAML from pipeline execution id

  2. 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:

Solution

  1. Use the Pipeline Execution Details API to get the inputSet YAML used for the Plan Execution that you want to retry.

  2. 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?