You can call the DeleteTunnel operation to delete a tunnel that you no longer require. When you delete a tunnel, you must specify the name of the data table for which the tunnel is created and the name of the tunnel.
Usage notes
Before you delete a channel, make sure that no data is being consumed in the channel. Otherwise, data consumption may fail.
A channel cannot be restored after it is deleted. Exercise caution when you perform this operation.
Parameters
Request parameters
Parameter | Description |
TableName | The name of the data table whose tunnel you want to delete. You can call the ListTable operation to query the names of tables in an instance. For more information, see List the names of tables. |
TunnelName | The name of the tunnel. You can call the ListTunnel operation to query information about all tunnels of a data table. For more information, see Query information about all tunnels of a data table. |
Response parameters
Parameter | Description |
ResponseInfo | Other fields returned in the request, including the RequestId field in the request. RequestId uniquely identifies the request. |
Examples
The following sample code provides an example on how to delete a tunnel of a data table:
req := &tunnel.DeleteTunnelRequest {
TableName: "<TABLE_NAME>",
TunnelName: "<TUNNEL_NAME>",
}
_, err := tunnelClient.DeleteTunnel(req)
if err != nil {
log.Fatal("delete tunnel failed", err)
}
References
For information about the API operation that you can call to delete a tunnel, see DeleteTunnel.
If an error occurs when you call the DeleteTunnel operation, search for the error cause in Error codes based on the error message and handle the error.