All Products
Search
Document Center

Tablestore:Query the names of time series tables

Last Updated:Jun 07, 2024

You can call the ListTimeseriesTable operation to query the names and metadata of all time series tables in the current instance.

Prerequisites

Examples

The following sample code provides an example on how to query the names and metadata of all time series tables in an instance:

func ListTimeseriesTableSample(client *tablestore.TimeseriesClient) {
    fmt.Println("[Info]: Begin to list timeseries table !")
    listTimeseriesTableResponse , err := client.ListTimeseriesTable()
    if err != nil {
        fmt.Println("[Info]: List timeseries table failed with error: " , err)
    }
    fmt.Println("[Info]: Timeseries table Meta: ")
    for i := 0; i < len(listTimeseriesTableResponse.GetTimeseriesTableMeta()); i++ {
        curTimeseriesTableMeta := listTimeseriesTableResponse.GetTimeseriesTableMeta()[i]
        fmt.Println("[Info]: Timeseries table name: " , curTimeseriesTableMeta.GetTimeseriesTableName() , "TTL: " , curTimeseriesTableMeta.GetTimeseriesTableOPtions().GetTimeToLive())
    }
    fmt.Println("[Info]: ListTimeseriesTableSample finished !")
}

References