Skip to content

list_tables async

list_tables(
    *,
    config_overrides: Optional[AsyncTimestreamWriteClientConfig] = None,
    database_name: Optional[ResourceName] = None,
    next_token: Optional[String] = None,
    max_results: Optional[PaginationLimit] = None,
) -> ListTablesResponse

Provides a list of tables, along with the name, status, and retention properties of each table. See code sample for details.

Parameters:

  • database_name (Optional[ResourceName], default: None ) –

    The name of the Timestream database.

  • 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_tables(
    self,
    *,
    config_overrides: Optional[AsyncTimestreamWriteClientConfig] = None,
    database_name: Optional[
        "capo_timestream_write.types.resource_name.ResourceName"
    ] = 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_tables_response.ListTablesResponse":
    """<p>Provides a list of tables, along with the name, status, and retention properties of each table. See <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.list-table.html">code sample</a> for details. </p>

    Args:
        database_name: <p>The name of the Timestream database.</p>
        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.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent resource. The resource might not be specified correctly, or its status might not be ACTIVE.</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_tables_request.ListTablesRequest]",
    ) -> AsyncOperationResponse[
        "capo_timestream_write.types.list_tables_response.ListTablesResponse"
    ]:
        import capo_timestream_write._operations.timestream_20181101.list_tables

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTables")
    )
    input_: capo_timestream_write.types.list_tables_request.ListTablesRequest = {}
    if database_name is not None:
        input_["database_name"] = database_name
    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