By calling the DescribeTimeseriesTable operation, you can query information of a time series table, such as time to live (TTL), table status, and time series metadata configuration.
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.
Parameters
Parameter | Description |
timeseries_table_name | The name of the time series table. |
Examples
The following sample code provides an example on how to query information of a time series table:
try:
# Call the operation to query information of a time series table.
describe_response = ots_client.describe_timeseries_table('')
table_meta = describe_response.table_meta
# Print information of the time series table.
# The name of the time series table
print('TimeseriesTableName: %s.' % table_meta.timeseries_table_name)
# The status of the time series table
print('TimeseriesTableStatus: %s.' % table_meta.status)
# The TTL configuration of the time series table
print('TimeseriesTableTTL: %s.' % table_meta.timeseries_table_options.time_to_live)
# The TTL configuration of the time series metadata
print('TimeseriesMetaTTL: %s.' % table_meta.timeseries_meta_options.meta_time_to_live)
# Whether the attributes of the time series metadata can be updated
print('AllowUpdateTimeseriesMetaAttributes: %s.' % table_meta.timeseries_meta_options.allow_update_attributes)
except Exception as e:
# If an exception is thrown, the operation fails. Handle the exception.
print("describe timeseries table failed. %s" % e)