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.
A TimeseriesClient instance is initialized. For more information, see Initialize an OTSClient instance.
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
For more information about the API operation, see ListTimeseriesTable.
If you want to modify information about a time series table, such as the time to live (TTL), you can update the time series table. For more information, see Update a time series table.
If you want to read data from or write data to a time series table, you can call the specific API operation. For more information, see Write time series data and Query time series data.
If you want to view the configurations of a time series table, such as the TTL, you can query the information about the time series table. For more information, see Query the information about a time series table.
You can delete a time series table that you no longer require. For more information, see Delete a time series table.