すべてのプロダクト
Search
ドキュメントセンター

Tablestore:時系列テーブルの名前のクエリ

最終更新日:Apr 19, 2025

ListTimeseriesTable 操作を呼び出して、現在のインスタンス内のすべての時系列テーブルの名前と構成情報を取得できます。

使用方法

TimeSeries モデルは、Tablestore SDK for Python V6.1.0 以降でサポートされています。正しいバージョンの Tablestore SDK for Python を取得していることを確認してください。

説明

詳細については、「Tablestore SDK for Python のバージョン履歴」をご参照ください。

前提条件

Tablestore クライアントが初期化されていること。詳細については、「Tablestore クライアントの初期化」をご参照ください。

次のサンプルコードは、インスタンス内のすべての時系列テーブルの名前とメタデータをクエリする方法の例を示しています。

try:
    # 時系列テーブルの名前と時系列メタデータを取得するための操作を呼び出します。
    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) # 時系列テーブルのリスト取得に失敗しました。