Skip to content

list_microvms async

list_microvms(
    *,
    config_overrides: Optional[AsyncLambdaMicrovmsClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[String] = None,
    image_identifier: Optional[MicrovmImageIdentifier] = None,
    image_version: Optional[str] = None,
) -> ListMicrovmsResponse

Lists MicroVMs in the account with optional filtering by image and version. We recommend using pagination to ensure that the operation returns quickly and successfully.

Parameters:

  • max_results (Optional[int], default: None ) –

    The maximum number of results to return in a single call.

  • next_token (Optional[String], default: None ) –

    The pagination token from a previous call. Use this token to retrieve the next page of results.

  • image_identifier (Optional[MicrovmImageIdentifier], default: None ) –

    Optional filter to list only MicroVMs running the specified image.

  • image_version (Optional[str], default: None ) –

    Optional filter to list only MicroVMs running the specified image version.

Raises:

Source code in docs_src/capo_lambda_microvms/_services/async_lambda_microvms.py
async def list_microvms(
    self,
    *,
    config_overrides: Optional[AsyncLambdaMicrovmsClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
    image_identifier: Optional[
        "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier"
    ] = None,
    image_version: Optional[str] = None,
) -> "capo_lambda_microvms.types.list_microvms_response.ListMicrovmsResponse":
    """<p>Lists MicroVMs in the account with optional filtering by image and version. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>

    Args:
        max_results: <p>The maximum number of results to return in a single call.</p>
        next_token: <p>The pagination token from a previous call. Use this token to retrieve the next page of results.</p>
        image_identifier: <p>Optional filter to list only MicroVMs running the specified image.</p>
        image_version: <p>Optional filter to list only MicroVMs running the specified image version.</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.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.list_microvms_request.ListMicrovmsRequest]",
    ) -> AsyncOperationResponse[
        "capo_lambda_microvms.types.list_microvms_response.ListMicrovmsResponse"
    ]:
        import capo_lambda_microvms._operations.lambda_microvms.list_microvms

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListMicrovms")
    )
    input_: capo_lambda_microvms.types.list_microvms_request.ListMicrovmsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if image_identifier is not None:
        input_["image_identifier"] = image_identifier
    if image_version is not None:
        input_["image_version"] = image_version

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