Remote Access Tunnel
Overview
This tutorial walks through the 5-Tunnel-Mgmt collection — creating a remote access
tunnel to a WEDA Node device, waiting for it to establish, and terminating it cleanly
when done. Two requests in this collection use automatic polling to track tunnel state.
Prerequisites
- Completed Get Access Token —
accessTokenis set - Completed Register Your Device —
deviceIdis set - The target device must be online and in
Activatedstatus
Auto-captured Variables
| Variable | Set by | Used by |
|---|---|---|
tunnelId | Create Tunnel | Get Detail, Wait for ESTABLISHED, Terminate, Wait for TERMINATED |
Steps
1. List Tunnels with Pagination
Lists all tunnel sessions for the current device, sorted by creation time (newest first).
- API: List Device Tunnels
- Result:
200 OK
2. Create Tunnel
Opens a new remote access tunnel session to the device. Fill in the request body with the tunnel type and target port before sending.
- API: Create Tunnel Session
- Script:
tunnelIdanddeviceIdsaved to environment automatically - Result:
202 Accepted
3. Get Tunnel Detail by ID
Retrieves the current status and connection details for the tunnel stored in tunnelId.
- API: Get Tunnel Detail
- Result:
200 OK
4. Wait for ESTABLISHED Status
Waits until the tunnel reaches ESTABLISHED state and its tunnelEndpoint is available.
After you send this request once, the Postman script takes over. It automatically
re-sends the request at a fixed interval until the tunnel status becomes ESTABLISHED.
Tunnel creation typically takes a few seconds to a minute depending on network conditions.
Just wait — clicking Send again will reset the polling counter.
- API: Get Tunnel Detail
- Script: polls until the status is
ESTABLISHEDandtunnelEndpointhas a value; clears polling variables when confirmed - Result: tunnel status =
ESTABLISHEDwith connection information available
Once established, use the connection details in the response to connect to the device via your preferred remote access client.
5. Terminate Tunnel
Closes the tunnel session stored in tunnelId.
Always terminate tunnels when you are done. Open tunnels consume connection resources on both the cloud and device sides.
- API: Terminate Tunnel Session
- Script: logs termination status and advances state for the next polling request
- Result:
202 Accepted