List tunnels
Use Tablestore SDK for Java to list all tunnels of a table and obtain their types, stages, and configurations.
Prerequisites
Install Tablestore SDK for Java and initialize TunnelClient.
Feature description
Call listTunnel to list all tunnels of a table. The response does not include information about the channels in each tunnel. To obtain channel information, query the details of a specific tunnel.
ListTunnelResponse listTunnel(ListTunnelRequest request)
throws TableStoreException, ClientException
The following example lists all tunnels of the example_table table and prints the name, type, stage, and creation time of each tunnel:
String tableName = "example_table";
ListTunnelRequest request = new ListTunnelRequest(tableName);
ListTunnelResponse response = tunnelClient.listTunnel(request);
for (TunnelInfo tunnelInfo : response.getTunnelInfos()) {
System.out.printf(
"name=%s, type=%s, stage=%s, createTime=%d%n",
tunnelInfo.getTunnelName(),
tunnelInfo.getTunnelType(),
tunnelInfo.getStage(),
tunnelInfo.getCreateTime());
}
Parameters
request is of the ListTunnelRequest type and contains the following parameter:
|
Name |
Type |
Description |
|
tableName (required) |
|
The name of the table. |
Return values
The return value is of the ListTunnelResponse type and contains the following field:
|
Name |
Type |
Description |
|
tunnelInfos |
|
The list of tunnels in the table. Call |
Tunnel information
Each element in tunnelInfos[] is of the TunnelInfo type and contains the following fields:
|
Name |
Type |
Description |
|
tunnelName |
|
The name of the tunnel. |
|
tunnelId |
|
The ID of the tunnel. |
|
tunnelType |
|
The tunnel type. Valid values: |
|
tableName |
|
The name of the table. |
|
instanceName |
|
The name of the instance. |
|
stage |
|
The tunnel stage. Valid values: |
|
expired |
|
Indicates whether the tunnel data is expired. |
|
streamTunnelConfig |
|
The incremental data range configuration. If this parameter was not configured, the default configuration is returned. Tunnels of the |
|
createTime |
|
The tunnel creation time. The value is a UNIX timestamp in milliseconds. |
|
streamRecordOptions |
|
The incremental record content configuration. If this parameter was not configured, the default configuration is returned. Tunnels of the |