Skip to content

suspend_microvm async

suspend_microvm(
    microvm_identifier: MicrovmIdentifier,
    *,
    config_overrides: Optional[AsyncLambdaMicrovmsClientConfig] = None,
) -> SuspendMicrovmResponse

Suspends a running MicroVM, preserving its full memory and disk state. The MicroVM transitions through SUSPENDING to SUSPENDED. To restore, call ResumeMicrovm or send traffic to the endpoint if autoResumeEnabled is true.

Parameters:

Raises:

Source code in docs_src/capo_lambda_microvms/_services/async_lambda_microvms.py
async def suspend_microvm(
    self,
    microvm_identifier: "capo_lambda_microvms.types.microvm_identifier.MicrovmIdentifier",
    *,
    config_overrides: Optional[AsyncLambdaMicrovmsClientConfig] = None,
) -> "capo_lambda_microvms.types.suspend_microvm_response.SuspendMicrovmResponse":
    """<p>Suspends a running MicroVM, preserving its full memory and disk state. The MicroVM transitions through SUSPENDING to SUSPENDED. To restore, call ResumeMicrovm or send traffic to the endpoint if autoResumeEnabled is true.</p>

    Args:
        microvm_identifier: <p>The ID of the MicroVM to suspend.</p>

    Raises:
        capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
        capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
        capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
        capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
        capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lambda_microvms.types.suspend_microvm_request.SuspendMicrovmRequest]",
    ) -> AsyncOperationResponse[
        "capo_lambda_microvms.types.suspend_microvm_response.SuspendMicrovmResponse"
    ]:
        import capo_lambda_microvms._operations.lambda_microvms.suspend_microvm

        (
            output,
            http_response,
        ) = await capo_lambda_microvms._operations.lambda_microvms.suspend_microvm.async_suspend_microvm(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SuspendMicrovm")
    )
    input_: capo_lambda_microvms.types.suspend_microvm_request.SuspendMicrovmRequest = {
        "microvm_identifier": microvm_identifier
    }

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