Skip to content

delete_plan async

delete_plan(
    arn: PlanArn, *, config_overrides: Optional[AsyncARCRegionswitchClientConfig] = None
) -> DeletePlanResponse

Deletes a Region switch plan. You must specify the ARN of the plan to delete.

You cannot delete a plan that has an active execution in progress.

Parameters:

  • arn (PlanArn) –

    The Amazon Resource Name (ARN) of the plan.

Raises:

  • IllegalStateException –

    The operation failed because the current state of the resource doesn't allow the operation to proceed.

    HTTP Status Code: 400

  • ResourceNotFoundException –

    The specified resource was not found.

    HTTP Status Code: 404

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_arc_region_switch/_services/async_arc_regionswitch.py
async def delete_plan(
    self,
    arn: "capo_arc_region_switch.types.plan_arn.PlanArn",
    *,
    config_overrides: Optional[AsyncARCRegionswitchClientConfig] = None,
) -> "capo_arc_region_switch.types.delete_plan_response.DeletePlanResponse":
    """<p>Deletes a Region switch plan. You must specify the ARN of the plan to delete.</p> <p>You cannot delete a plan that has an active execution in progress.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the plan.</p>

    Raises:
        capo_arc_region_switch.errors.illegal_state_exception.IllegalStateException: <p>The operation failed because the current state of the resource doesn't allow the operation to proceed.</p> <p>HTTP Status Code: 400</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.delete_plan_request.DeletePlanRequest]",
    ) -> AsyncOperationResponse[
        "capo_arc_region_switch.types.delete_plan_response.DeletePlanResponse"
    ]:
        import capo_arc_region_switch._operations.arc_region_switch.delete_plan

        (
            output,
            http_response,
        ) = await capo_arc_region_switch._operations.arc_region_switch.delete_plan.async_delete_plan(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeletePlan")
    )
    input_: capo_arc_region_switch.types.delete_plan_request.DeletePlanRequest = {
        "arn": arn
    }

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