After you create a tunnel, you can call the DescribeTunnel operation to query information about the tunnel, such as information about channels in the tunnel.
Prerequisites
A TunnelClient instance is initialized.
A tunnel is created for the data table. For more information, see Create a tunnel.
Parameters
Request parameters
Parameter | Description |
TableName | The name of the data table whose tunnel information you want to query. |
TunnelName | The name of the tunnel. |
Response parameters
Parameter | Description |
TunnelRPO | The most recent time when the tunnel is used to consume incremental data. The time is the point in time when the slowest channel in the tunnel is used to consume data. Default value: January 1, 1970 (UTC). |
List<TunnelInfo> | The information about the tunnel. The following information is included in the response:
|
List<ChannelInfo> | The information about the channels in the tunnel. The following information is included in the response:
|
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 query information about a tunnel, including the most recent time when the tunnel is used to consume incremental data and the information about the channels in the tunnel:
req := &tunnel.DescribeTunnelRequest{
TableName: "<TABLE_NAME>",
TunnelName: "TUNNEL_NAME",
}
resp, err := tunnelClient.DescribeTunnel(req)
if err != nil {
log.Fatal("describe tunnel failed", err)
}
log.Println("tunnel id is", resp.Tunnel.TunnelId)
References
For information about the API operation that you can call to query information about a tunnel, see DescribeTunnel.
If you want to quickly use Tunnel Service to consume data, see Getting started.
You can query information about all tunnels of a table. For more information, see Query information about all tunnels of a data table.
You can delete a tunnel that you no longer require. For more information, see Delete a tunnel.