Skip to content

list_hypervisors async

list_hypervisors(
    *,
    config_overrides: Optional[AsyncBackupGatewayClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListHypervisorsOutput

Lists your hypervisors.

Parameters:

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

    The maximum number of hypervisors to list.

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

    The next item following a partial list of returned resources. For example, if a request is made to return maxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

Raises:

  • InternalServerException –

    The operation did not succeed because an internal error occurred. Try again later.

  • ThrottlingException –

    TPS has been limited to protect against intentional or unintentional high request volumes.

  • ValidationException –

    The operation did not succeed because a validation error occurred.

  • UnknownServiceError –

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

Source code in docs_src/capo_backup_gateway/_services/async_backup_gateway.py
async def list_hypervisors(
    self,
    *,
    config_overrides: Optional[AsyncBackupGatewayClientConfig] = None,
    max_results: Optional[
        "capo_backup_gateway.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_backup_gateway.types.next_token.NextToken"] = None,
) -> "capo_backup_gateway.types.list_hypervisors_output.ListHypervisorsOutput":
    """<p>Lists your hypervisors.</p>

    Args:
        max_results: <p>The maximum number of hypervisors to list.</p>
        next_token: <p>The next item following a partial list of returned resources. For example, if a request is made to return <code>maxResults</code> number of resources, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>

    Raises:
        capo_backup_gateway.errors.internal_server_exception.InternalServerException: <p>The operation did not succeed because an internal error occurred. Try again later.</p>
        capo_backup_gateway.errors.throttling_exception.ThrottlingException: <p>TPS has been limited to protect against intentional or unintentional high request volumes.</p>
        capo_backup_gateway.errors.validation_exception.ValidationException: <p>The operation did not succeed because a validation error occurred.</p>
        capo_backup_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup_gateway.types.list_hypervisors_input.ListHypervisorsInput]",
    ) -> AsyncOperationResponse[
        "capo_backup_gateway.types.list_hypervisors_output.ListHypervisorsOutput"
    ]:
        import capo_backup_gateway._operations.backup_on_premises_v20210101.list_hypervisors

        (
            output,
            http_response,
        ) = await capo_backup_gateway._operations.backup_on_premises_v20210101.list_hypervisors.async_list_hypervisors(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListHypervisors")
    )
    input_: capo_backup_gateway.types.list_hypervisors_input.ListHypervisorsInput = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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