Query information of a time series table

更新时间: 2026-04-30 11:37:11

You can call the DescribeTimeseriesTable operation to query information of a time series table, such as the time to live (TTL) configuration.

Prerequisites

Parameters

Parameter

Description

timeseriesTableName

The name of the time series table.

Example

The following example calls DescribeTimeseriesTable to retrieve the time series table metadata, including the table name, time to live (TTL), and analytical store information.

func DescribeTimeseriesTableSample(client *tablestore.TimeseriesClient, timeseriesTableName string) {
    fmt.Println("[Info]: Begin to require timeseries table description!")
    describeTimeseriesTableRequest := tablestore.NewDescribeTimeseriesTableRequset(timeseriesTableName) // Construct a request and specify the name of the time series table.

    describeTimeseriesTableResponse, err := client.DescribeTimeseriesTable(describeTimeseriesTableRequest)
    if err != nil {
        fmt.Println("[Error]: Failed to require timeseries table description!")
        return
    }
    fmt.Println("[Info]: DescribeTimeseriesTableSample finished. Timeseries table meta: ")
    fmt.Println("[Info]: TimeseriesTableName: ", describeTimeseriesTableResponse.GetTimeseriesTableMeta().GetTimeseriesTableName())
    fmt.Println("[Info]: TimeseriesTable TTL: ", describeTimeseriesTableResponse.GetTimeseriesTableMeta().GetTimeseriesTableOPtions().GetTimeToLive())
    //If you have created an analytical store for the time series table, you can use the following code to obtain the analytical store information.
    analyticalStores := describeTimeseriesTableResponse.GetAnalyticalStores()
    for _, analyticalStore := range analyticalStores {
        fmt.Println("[Info]: AnalyticalStoreName: ", analyticalStore.StoreName)
        if analyticalStore.TimeToLive != nil {
            fmt.Println("[Info]: TimeToLive: ", *analyticalStore.TimeToLive)
        }
        if analyticalStore.SyncOption != nil {
            fmt.Println("[Info]: SyncOption: ", *analyticalStore.SyncOption)
        }
    }
}

References

上一篇: Query the names of time series tables 下一篇: Delete a time series table by using Go SDK
阿里云首页 表格存储 相关技术圈