You can call the ListTimeseriesTable operation to query the names and metadata of all time series tables in the current instance.
Prerequisites
- A time series table is created. For more information, see Create a time series table.
- The TimeseriesClient is initialized. For more information, see Initialization.
Example
/**
* Use ListTimeseriesTableSample 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 !")
}