Update a time series table
Call the UpdateTimeseriesTable operation to update the configuration of a time series table or timeline metadata, such as the time-to-live (TTL) configuration.
Precautions
The time series model feature is available in Tablestore Python SDK 6.1.0 and later. Ensure that you use a supported version of the Python SDK.
NoteFor more information about the release history of the Python SDK, see Python SDK release history.
You cannot change the configuration of a time series table (timeseries_table_options) and the configuration of timeline metadata (timeseries_meta_options) in the same call. You can modify only one of these configurations in a single call.
Prerequisites
Parameters
Parameter | Description |
table_meta (Required) | The structure of the time series table. It includes the following parameters:
|
Example
The following example shows how to update the TTL of a time series table.
try:
# The data lifecycle of the time series table is 604800 seconds (7 days).
tableOption = TimeseriesTableOptions(604800)
tableMeta = TimeseriesTableMeta("<TIMESERIES_TABLE_NAME>", tableOption)
# Call the operation to update the time series table.
otsClient.update_timeseries_table(tableMeta)
print("update timeseries table success.")
except Exception as e:
# If an exception is thrown, the execution failed. Handle the exception.
print("update timeseries table failed. %s" % e)