retryStageExecution method

Future<RetryStageExecutionOutput> retryStageExecution({
  1. required String pipelineExecutionId,
  2. required String pipelineName,
  3. required StageRetryMode retryMode,
  4. required String stageName,
})

You can retry a stage that has failed without having to run a pipeline again from the beginning. You do this by either retrying the failed actions in a stage or by retrying all actions in the stage starting from the first action in the stage. When you retry the failed actions in a stage, all actions that are still in progress continue working, and failed actions are triggered again. When you retry a failed stage from the first action in the stage, the stage cannot have any actions in progress. Before a stage can be retried, it must either have all actions failed or some actions failed and some succeeded.

May throw ConcurrentPipelineExecutionsLimitExceededException. May throw ConflictException. May throw NotLatestPipelineExecutionException. May throw PipelineNotFoundException. May throw StageNotFoundException. May throw StageNotRetryableException. May throw ValidationException.

Parameter pipelineExecutionId : The ID of the pipeline execution in the failed stage to be retried. Use the GetPipelineState action to retrieve the current pipelineExecutionId of the failed stage

Parameter pipelineName : The name of the pipeline that contains the failed stage.

Parameter retryMode : The scope of the retry attempt.

Parameter stageName : The name of the failed stage to be retried.

Implementation

Future<RetryStageExecutionOutput> retryStageExecution({
  required String pipelineExecutionId,
  required String pipelineName,
  required StageRetryMode retryMode,
  required String stageName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodePipeline_20150709.RetryStageExecution'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'pipelineExecutionId': pipelineExecutionId,
      'pipelineName': pipelineName,
      'retryMode': retryMode.value,
      'stageName': stageName,
    },
  );

  return RetryStageExecutionOutput.fromJson(jsonResponse.body);
}