You can call the DescribeTimeseriesTable operation to query the information about a time series table, such as the time to live (TTL) configuration.
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.
Parameter
Parameter | Description |
timeseriesTableName | The name of the time series table. |
Examples
The following sample code provides an example on how to query the information about a time series table:
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())
}
References
For more information about the API operation, see DescribeTimeseriesTable.
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 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.
You can delete a time series table that you no longer require. For more information, see Delete a time series table.