DescribeTimeseriesAnalyticalStore API を呼び出して、Time to Live (TTL)、データ同期オプション、データ同期ステータス、データストレージ使用量などの分析ストアに関する情報をクエリできます。
前提条件
パラメーター
|
パラメーター |
説明 |
|
timeseriesTableName |
時系列テーブルの名前。 |
|
analyticalStoreName |
分析ストアの名前。 |
サンプル
次のサンプルコードは、時系列テーブル「test_timeseries_table」に作成された分析ストア「test_analytical_store」の情報をクエリする例です。
func DescribeAnalyticalStore(client *tablestore.TimeseriesClient) {
// 時系列テーブルと分析ストアの名前を指定します。
req := tablestore.NewDescribeTimeseriesAnalyticalStoreRequest("test_timeseries_table", "test_analytical_store")
resp, err := client.DescribeTimeseriesAnalyticalStore(req)
if err != nil {
log.Fatal(err)
}
// 分析ストアの名前を出力します。
fmt.Println("analyticalStoreName:", resp.AnalyticalStore.StoreName)
// 分析ストアの同期オプションを出力します。
if resp.AnalyticalStore.SyncOption != nil {
fmt.Println("syncOption:", *resp.AnalyticalStore.SyncOption)
}
// 分析ストアの TTL を出力します。
if resp.AnalyticalStore.TimeToLive != nil {
fmt.Println("timeToLive:", *resp.AnalyticalStore.TimeToLive)
}
// 分析ストアの現在の同期ステータスを出力します。
if resp.SyncStat != nil {
fmt.Println("syncPhase:", resp.SyncStat.SyncPhase)
fmt.Println("currentSyncTimestamp:", time.Unix(resp.SyncStat.CurrentSyncTimestamp, 0))
}
// 分析ストアの現在のストレージ使用量を出力します。
if resp.StorageSize != nil {
fmt.Println("storageSize:", resp.StorageSize.Size)
fmt.Println("storageSizeTimestamp:", time.Unix(resp.StorageSize.Timestamp, 0))
}
}