Chame a operação DescribeTimeseriesTable para consultar informações de uma tabela de séries temporais, como tempo de vida (TTL), status da tabela e configuração de metadados das séries temporais.
Notas de uso
O modelo TimeSeries é compatível com o Tablestore SDK for Python V6.1.0 ou posterior. Verifique se você tem a versão correta do Tablestore SDK for Python.
Nota
Para mais informações, consulte Histórico de versões do SDK para Python.
Pré-requisitos
Inicialize um cliente do Tablestore. Para mais informações, consulte Inicializar um cliente do Tablestore.
Parâmetros
|
Parâmetro |
Descrição |
|
timeseries_table_name |
Nome da tabela de séries temporais. |
Exemplos
O código de exemplo a seguir demonstra como consultar as informações de uma tabela de séries temporais:
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)