All Products
Search
Document Center

Tablestore:Query the names of time series tables

Last Updated:Apr 18, 2025

You can call the ListTimeseriesTable operation to retrieve the names and configuration information of all time series tables in the current instance.

Usage notes

The TimeSeries model is supported by Tablestore SDK for Python V6.1.0 and later. Make sure that you have obtained a correct version of Tablestore SDK for Python.

Note

For more information, see Version history of Tablestore SDK for Python.

Prerequisites

A Tablestore client is initialized. For more information, see Initialize a Tablestore client.

Example

The following sample code provides an example on how to query the names and metadata of all time series tables in an instance:

try:
    # Call the operation to obtain the names and time series metadata of time series tables.
    response = ots_client.list_timeseries_table()
    for tableMeta in response:
        print('timeseries table name: %s, ttl: %s.' % (tableMeta.timeseries_table_name, tableMeta.timeseries_table_options.time_to_live))
    print("list timeseries table succeeded.")
except Exception as e:
    print("list timeseries table failed. %s" % e)