Skip to content

list_databases async

list_databases(
    *,
    config_overrides: Optional[AsyncTimestreamWriteClientConfig] = None,
    next_token: Optional[String] = None,
    max_results: Optional[PaginationLimit] = None,
) -> ListDatabasesResponse

Returns a list of your Timestream databases. Service quotas apply. See code sample for details.

Parameters:

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

    The pagination token. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

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

    The total number of items to return in the output. If the total number of items available is more than the value specified, a NextToken is provided in the output. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

Raises:

Source code in docs_src/capo_timestream_write/_services/async_timestream_write.py
async def list_databases(
    self,
    *,
    config_overrides: Optional[AsyncTimestreamWriteClientConfig] = None,
    next_token: Optional["capo_timestream_write.types.string.String"] = None,
    max_results: Optional[
        "capo_timestream_write.types.pagination_limit.PaginationLimit"
    ] = None,
) -> "capo_timestream_write.types.list_databases_response.ListDatabasesResponse":
    """<p>Returns a list of your Timestream databases. <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/ts-limits.html">Service quotas apply</a>. See <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.list-db.html">code sample</a> for details. </p>

    Args:
        next_token: <p>The pagination token. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.</p>
        max_results: <p>The total number of items to return in the output. If the total number of items available is more than the value specified, a NextToken is provided in the output. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.</p>

    Raises:
        capo_timestream_write.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to perform this action.</p>
        capo_timestream_write.errors.internal_server_exception.InternalServerException: <p> Timestream was unable to fully process this request because of an internal server error.</p>
        capo_timestream_write.errors.invalid_endpoint_exception.InvalidEndpointException: <p>The requested endpoint was not valid.</p>
        capo_timestream_write.errors.throttling_exception.ThrottlingException: <p> Too many requests were made by a user and they exceeded the service quotas. The request was throttled.</p>
        capo_timestream_write.errors.validation_exception.ValidationException: <p> An invalid or malformed request.</p>
        capo_timestream_write.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_timestream_write.types.list_databases_request.ListDatabasesRequest]",
    ) -> AsyncOperationResponse[
        "capo_timestream_write.types.list_databases_response.ListDatabasesResponse"
    ]:
        import capo_timestream_write._operations.timestream_20181101.list_databases

        (
            output,
            http_response,
        ) = await capo_timestream_write._operations.timestream_20181101.list_databases.async_list_databases(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDatabases")
    )
    input_: capo_timestream_write.types.list_databases_request.ListDatabasesRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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