Skip to content

list_gateways

list_gateways(
    *,
    config_overrides: Optional[BackupGatewayClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListGatewaysOutput

Lists backup gateways owned by an Amazon Web Services account in an Amazon Web Services Region. The returned list is ordered by gateway Amazon Resource Name (ARN).

Parameters:

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

    The maximum number of gateways 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/backup_gateway.py
def list_gateways(
    self,
    *,
    config_overrides: Optional[BackupGatewayClientConfig] = 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_gateways_output.ListGatewaysOutput":
    """<p>Lists backup gateways owned by an Amazon Web Services account in an Amazon Web Services Region. The returned list is ordered by gateway Amazon Resource Name (ARN).</p>

    Args:
        max_results: <p>The maximum number of gateways 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.
    """

    def _handler(
        req: "OperationRequest[capo_backup_gateway.types.list_gateways_input.ListGatewaysInput]",
    ) -> OperationResponse[
        "capo_backup_gateway.types.list_gateways_output.ListGatewaysOutput"
    ]:
        import capo_backup_gateway._operations.backup_on_premises_v20210101.list_gateways

        output, http_response = (
            capo_backup_gateway._operations.backup_on_premises_v20210101.list_gateways.list_gateways(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output