Skip to content

cancel_plan_execution async

cancel_plan_execution(
    plan_arn: PlanArn,
    execution_id: ExecutionId,
    *,
    config_overrides: Optional[AsyncARCRegionswitchClientConfig] = 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/async_arc_regionswitch.py
async 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[AsyncARCRegionswitchClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_arc_region_switch.types.cancel_plan_execution_request.CancelPlanExecutionRequest]",
    ) -> AsyncOperationResponse[
        "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,
        ) = await capo_arc_region_switch._operations.arc_region_switch.cancel_plan_execution.async_cancel_plan_execution(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output