Skip to content

override_stage_condition

override_stage_condition(
    pipeline_name: PipelineName,
    stage_name: StageName,
    pipeline_execution_id: PipelineExecutionId,
    condition_type: ConditionType,
    *,
    config_overrides: Optional[CodePipelineClientConfig] = None,
) -> None

Used to override a stage condition. For more information about conditions, see Stage conditions and How do stage conditions work?.

Parameters:

  • pipeline_name (PipelineName) –

    The name of the pipeline with the stage that will override the condition.

  • stage_name (StageName) –

    The name of the stage for the override.

  • pipeline_execution_id (PipelineExecutionId) –

    The ID of the pipeline execution for the override.

  • condition_type (ConditionType) –

    The type of condition to override for the stage, such as entry conditions, failure conditions, or success conditions.

Raises:

Source code in docs_src/capo_codepipeline/_services/code_pipeline.py
def override_stage_condition(
    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",
    condition_type: "capo_codepipeline.types.condition_type.ConditionType",
    *,
    config_overrides: Optional[CodePipelineClientConfig] = None,
) -> None:
    """<p>Used to override a stage condition. For more information about conditions, see <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/stage-conditions.html">Stage conditions</a> and <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts-how-it-works-conditions.html">How do stage conditions work?</a>.</p>

    Args:
        pipeline_name: <p>The name of the pipeline with the stage that will override the condition.</p>
        stage_name: <p>The name of the stage for the override.</p>
        pipeline_execution_id: <p>The ID of the pipeline execution for the override.</p>
        condition_type: <p>The type of condition to override for the stage, such as entry conditions, failure conditions, or success conditions.</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.condition_not_overridable_exception.ConditionNotOverridableException: <p>Unable to override because the condition does not allow overrides.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_codepipeline.types.override_stage_condition_input.OverrideStageConditionInput]",
    ) -> OperationResponse[None]:
        import capo_codepipeline._operations.code_pipeline_20150709.override_stage_condition

        output, http_response = (
            capo_codepipeline._operations.code_pipeline_20150709.override_stage_condition.override_stage_condition(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("OverrideStageCondition")
    )
    input_: capo_codepipeline.types.override_stage_condition_input.OverrideStageConditionInput = {
        "pipeline_name": pipeline_name,
        "stage_name": stage_name,
        "pipeline_execution_id": pipeline_execution_id,
        "condition_type": condition_type,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output