Delete a time series table by using Go SDK

更新时间:
复制 MD 格式

Call the DeleteTimeseriesTable operation to delete a time series table that you no longer need.

Prerequisites

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.