All Products
Search
Document Center

Tablestore:Tunnel service

Last Updated:Jun 16, 2026

You can use Tablestore CLI to create and manage tunnels that consume incremental, full, or full-plus-incremental data from data tables.

Prerequisites

  • Tablestore CLI installed and access credentials configured. For more information, see Tablestore CLI.

  • A data table with Stream (the data change log feature) enabled. For more information, see Data table operations.

Create a tunnel

Run the following command to create a tunnel for a data table.

create_tunnel -n <tunnelName>

Parameter

Required

Description

-t, --table

No

The name of the data table. Not required if you have already selected a data table by using the use command.

-n, --name

Yes

The name of the tunnel.

-m, --mode

No

The tunnel type. Valid values:

  • base_data_only: Full data mode. Consumes only existing data in the table.

  • stream_data_only (default): Incremental data mode. Consumes only incremental data.

  • base_and_stream: Full-plus-incremental mode. Consumes all existing data first, then continues with incremental data.

Example

Create a tunnel named t1 for a data table.

create_tunnel -n t1

Sample output:

New tunnel created, its id is '9933470d-8a5e-4972-a5b0-b7ae6f836460'.

List tunnels

Run the following command to list all tunnels for a data table.

list_tunnel

Parameter

Required

Description

-t, --table

No

The name of the data table. Not required if you have already selected a data table by using the use command.

Example

list_tunnel

View tunnel details

Run the following command to view tunnel and channel details.

describe_tunnel -n <tunnelName>

Parameter

Required

Description

-t, --table

No

The name of the data table. Not required if you have already selected a data table by using the use command.

-n, --name

Yes

The name of the tunnel.

-o, --output

No

Saves the output to a local file.

Example

View the details of the t1 tunnel.

describe_tunnel -n t1

Sample output:

Tunnel Info:
+--------------------------------------+------------+------------+---------------+---------+
| TunnelId                             | TunnelName | TunnelType | Stage         | Expired |
+--------------------------------------+------------+------------+---------------+---------+
| 9933470d-8a5e-4972-a5b0-b7ae6f836460 | t1         | Stream     | ProcessStream | false   |
+--------------------------------------+------------+------------+---------------+---------+

Channel Info:
+-------------------------------------------------------+-------------+---------------+----------+-------------------------------+
| ChannelId                                             | ChannelType | ChannelStatus | ClientId | ChannelRPO                    |
+-------------------------------------------------------+-------------+---------------+----------+-------------------------------+
| cfd2c05b-54b6-48ec-aa6f-feb427f0ca57_1635771329155688 | Stream      | OPEN          |          | 1970-01-01 08:00:00 +0800 CST |
+-------------------------------------------------------+-------------+---------------+----------+-------------------------------+

Simulate tunnel consumption

Run a simulated consumption to preview the data format in a tunnel.

consume_tunnel -n <tunnelName> -m mock_consume

Parameter

Required

Description

-c, --channel

No

The channel ID. If not specified, all channels are consumed.

-t, --table

No

The name of the data table. Not required if you have already selected a data table by using the use command.

-n, --name

Yes

The name of the tunnel.

-m, --mode

Yes

The consumption mode. Valid values:

  • shadow_copy (default): Mirrors the consumption traffic of the online tunnel.

  • mock_consume: Simulates data consumption without updating checkpoint records.

  • real_consume: Consumes data and updates checkpoint records. Not recommended because it affects the checkpoint state of the production tunnel.

Example

Simulate data consumption on the t1 tunnel.

consume_tunnel -n t1 -m mock_consume

After you run the command, the CLI waits for incoming data. When data is written to the table, the consumption records appear in the output. Sample output:

{"Type":0,"Timestamp":1636360028961786,"SequenceInfo":{"Epoch":0,"Timestamp":1636360028961786,"RowIndex":1},"PrimaryKey":{"PrimaryKeys":[{"ColumnName":"uid","Value":"86"},{"ColumnName":"pid","Value":6771}]},"Columns":[{"Type":0,"Name":"name","Value":"redchen","Timestamp":1636360028962},{"Type":0,"Name":"country","Value":"china","Timestamp":1636360028962}]}

Delete a tunnel

Run the following command to delete a tunnel from a data table.

drop_tunnel -n <tunnelName> -y

Parameter

Required

Description

-t, --table

No

The name of the data table. Not required if you have already selected a data table by using the use command.

-n, --name

Yes

The name of the tunnel.

-y, --yes

Yes

Skips the interactive confirmation prompt and proceeds with the deletion.

Example

Delete the t1 tunnel.

drop_tunnel -n t1 -y