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. Call the ListTable operation to get the names of tables in an instance. For more information, see List the names of tables. |
|
TunnelName |
The name of the tunnel. Call the ListTunnel operation to get 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 |
Additional fields returned in the response, including RequestId. RequestId uniquely identifies the request. |
Examples
The following code deletes a tunnel from 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.