Skip to content

retry_stage_execution async

retry_stage_execution(
    pipeline_name: PipelineName,
    stage_name: StageName,
    pipeline_execution_id: PipelineExecutionId,
    retry_mode: StageRetryMode,
    *,
    config_overrides: Optional[AsyncCodePipelineClientConfig] = None,
) -> RetryStageExecutionOutput

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.

Parameters:

  • pipeline_name (PipelineName) –

    The name of the pipeline that contains the failed stage.

  • stage_name (StageName) –

    The name of the failed stage to be retried.

  • pipeline_execution_id (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

  • retry_mode (StageRetryMode) –

    The scope of the retry attempt.

Raises:

Source code in docs_src/capo_codepipeline/_services/async_code_pipeline.py
async def retry_stage_execution(
    self,
    pipeline_name: "capo_codepipeline.types.pipeline_name.PipelineName",
    stage_name: "capo_codepipeline.types.stage_name.StageName",
    pipeline_execution_id: "capo_codepipeline.types.pipeline_execution_id.PipelineExecutionId",
    retry_mode: "capo_codepipeline.types.stage_retry_mode.StageRetryMode",
    *,
    config_overrides: Optional[AsyncCodePipelineClientConfig] = None,
) -> (
    "capo_codepipeline.types.retry_stage_execution_output.RetryStageExecutionOutput"
):
    """<p>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.</p>

    Args:
        pipeline_name: <p>The name of the pipeline that contains the failed stage.</p>
        stage_name: <p>The name of the failed stage to be retried.</p>
        pipeline_execution_id: <p>The ID of the pipeline execution in the failed stage to be retried. Use the <a>GetPipelineState</a> action to retrieve the current pipelineExecutionId of the failed stage</p>
        retry_mode: <p>The scope of the retry attempt.</p>

    Raises:
        capo_codepipeline.errors.concurrent_pipeline_executions_limit_exceeded_exception.ConcurrentPipelineExecutionsLimitExceededException: <p>The pipeline has reached the limit for concurrent pipeline executions.</p>
        capo_codepipeline.errors.conflict_exception.ConflictException: <p>Your request cannot be handled because the pipeline is busy handling ongoing activities. Try again later.</p>
        capo_codepipeline.errors.not_latest_pipeline_execution_exception.NotLatestPipelineExecutionException: <p>The stage has failed in a later run of the pipeline and the <code>pipelineExecutionId</code> associated with the request is out of date.</p>
        capo_codepipeline.errors.pipeline_not_found_exception.PipelineNotFoundException: <p>The pipeline was specified in an invalid format or cannot be found.</p>
        capo_codepipeline.errors.stage_not_found_exception.StageNotFoundException: <p>The stage was specified in an invalid format or cannot be found.</p>
        capo_codepipeline.errors.stage_not_retryable_exception.StageNotRetryableException: <p>Unable to retry. The pipeline structure or stage state might have changed while actions awaited retry, or the stage contains no failed actions.</p>
        capo_codepipeline.errors.validation_exception.ValidationException: <p>The validation was specified in an invalid format.</p>
        capo_codepipeline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codepipeline.types.retry_stage_execution_input.RetryStageExecutionInput]",
    ) -> AsyncOperationResponse[
        "capo_codepipeline.types.retry_stage_execution_output.RetryStageExecutionOutput"
    ]:
        import capo_codepipeline._operations.code_pipeline_20150709.retry_stage_execution

        (
            output,
            http_response,
        ) = await capo_codepipeline._operations.code_pipeline_20150709.retry_stage_execution.async_retry_stage_execution(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RetryStageExecution")
    )
    input_: capo_codepipeline.types.retry_stage_execution_input.RetryStageExecutionInput = {
        "pipeline_name": pipeline_name,
        "stage_name": stage_name,
        "pipeline_execution_id": pipeline_execution_id,
        "retry_mode": retry_mode,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output