Skip to content

cancel_plan_execution

cancel_plan_execution(
    plan_arn: PlanArn,
    execution_id: ExecutionId,
    *,
    config_overrides: Optional[ARCRegionswitchClientConfig] = None,
    comment: Optional[ExecutionComment] = None,
) -> CancelPlanExecutionResponse

Cancels an in-progress plan execution. This operation stops the execution of the plan and prevents any further steps from being processed.

You must specify the plan ARN and execution ID. You can also provide an optional comment explaining why the execution was canceled.

Parameters:

  • plan_arn (PlanArn) –

    The Amazon Resource Name (ARN) of the plan.

  • execution_id (ExecutionId) –

    The execution identifier of a plan execution.

  • comment (Optional[ExecutionComment], default: None ) –

    A comment that you can enter about canceling a plan execution step.

Raises:

Source code in docs_src/capo_arc_region_switch/_services/arc_regionswitch.py
def cancel_plan_execution(
    self,
    plan_arn: "capo_arc_region_switch.types.plan_arn.PlanArn",
    execution_id: "capo_arc_region_switch.types.execution_id.ExecutionId",
    *,
    config_overrides: Optional[ARCRegionswitchClientConfig] = None,
    comment: Optional[
        "capo_arc_region_switch.types.execution_comment.ExecutionComment"
    ] = None,
) -> "capo_arc_region_switch.types.cancel_plan_execution_response.CancelPlanExecutionResponse":
    """<p>Cancels an in-progress plan execution. This operation stops the execution of the plan and prevents any further steps from being processed.</p> <p>You must specify the plan ARN and execution ID. You can also provide an optional comment explaining why the execution was canceled.</p>

    Args:
        plan_arn: <p>The Amazon Resource Name (ARN) of the plan.</p>
        execution_id: <p>The execution identifier of a plan execution.</p>
        comment: <p>A comment that you can enter about canceling a plan execution step.</p>

    Raises:
        capo_arc_region_switch.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p> <p>HTTP Status Code: 403</p>
        capo_arc_region_switch.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p> <p>HTTP Status Code: 404</p>
        capo_arc_region_switch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_arc_region_switch.types.cancel_plan_execution_request.CancelPlanExecutionRequest]",
    ) -> OperationResponse[
        "capo_arc_region_switch.types.cancel_plan_execution_response.CancelPlanExecutionResponse"
    ]:
        import capo_arc_region_switch._operations.arc_region_switch.cancel_plan_execution

        output, http_response = (
            capo_arc_region_switch._operations.arc_region_switch.cancel_plan_execution.cancel_plan_execution(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelPlanExecution")
    )
    input_: capo_arc_region_switch.types.cancel_plan_execution_request.CancelPlanExecutionRequest = {
        "plan_arn": plan_arn,
        "execution_id": execution_id,
    }
    if comment is not None:
        input_["comment"] = comment

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