retryStageExecution method

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

Resumes the pipeline execution by retrying the last failed actions in a stage. You can retry a stage immediately if any of the actions in the stage fail. When you retry, all actions that are still in progress continue working, and failed actions are triggered again.

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

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. Currently, the only supported value is FAILED_ACTIONS.

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 {
  ArgumentError.checkNotNull(pipelineExecutionId, 'pipelineExecutionId');
  ArgumentError.checkNotNull(pipelineName, 'pipelineName');
  _s.validateStringLength(
    'pipelineName',
    pipelineName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(retryMode, 'retryMode');
  ArgumentError.checkNotNull(stageName, 'stageName');
  _s.validateStringLength(
    'stageName',
    stageName,
    1,
    100,
    isRequired: true,
  );
  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.toValue(),
      'stageName': stageName,
    },
  );

  return RetryStageExecutionOutput.fromJson(jsonResponse.body);
}