You can call the DeleteTimeseries operation to delete a time series table.
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.
Parameters
Parameter | Description |
timeseriesTableName | The name of the time series table. You can query the names of time series tables in an instance. For more information, see Query the names of time series tables. |
Examples
The following sample code provides an example on how to delete a time series table in an instance:
func DeleteTimeseriesTableSample(client *tablestore.TimeseriesClient , timeseriesTableName string) {
fmt.Println("[Info]: Begin to delete timeseries table !")
// Construct the request to delete the time series table.
deleteTimeseriesTableRequest := tablestore.NewDeleteTimeseriesTableRequest(timeseriesTableName)
// Call the time series client-related API operation to delete the time series table.
deleteTimeseriesTableResponse , err := client.DeleteTimeseriesTable(deleteTimeseriesTableRequest)
if err != nil {
fmt.Println("[Error]: Delete timeseries table failed with error: " , err)
return
}
fmt.Println("[Info]: DeleteTimeseriesTableSample finished ! RequestId: " , deleteTimeseriesTableResponse.RequestId)
}
References
For more information about the API operation, see DeleteTimeseriesTable.