Call the DeleteTimeseriesTable operation to delete a time series table that you no longer need.
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 deletes a specified time series table from an instance:
func DeleteTimeseriesTableSample(client *tablestore.TimeseriesClient , timeseriesTableName string) {
fmt.Println("[Info]: Begin to delete timeseries table !")
// Create a request to delete the time series table.
deleteTimeseriesTableRequest := tablestore.NewDeleteTimeseriesTableRequest(timeseriesTableName)
// Call the DeleteTimeseriesTable method to delete the 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 the API reference, see DeleteTimeseriesTable.
该文章对您有帮助吗?