Docs
Live demo
PATCH/api/v2/ssh-tunnels/{id}

Update an existing SSH tunnel. Only the fields present in the body change. A change of the SSH host, port, user or key of a connected tunnel is saved and the tunnel reconnects with it, which interrupts the connections running through it. A new forwarded endpoint, set directly or by linking a target, is used by a connected tunnel without a reconnect. A failed or disconnected tunnel reconnects after any change. When the reconnect fails, the change stays saved and the response shows the tunnel failed with the reason.

Parameters

Path1 required of 1
idstringpathrequired

SSH Tunnel ID (UUID)

Request body application/json · UpdateSSHTunnelRequest

SSH tunnel update request

Optional9 fields
namestring
min length 1 · max length 100
remote_hoststring

Host the tunnel forwards to, as seen from the bastion. A connected tunnel uses it without a reconnect.

remote_portinteger

Port the tunnel forwards to. Requires remote_host in the request or on the tunnel.

min 1 · max 65535
ssh_key_idstring
ssh_hoststring
ssh_portinteger
min 1 · max 65535
ssh_userstring
min length 1 · max length 255
sudo_passwordstring

Password for sudo operations on remote server

min length 1 · max length 255
target_idstring

PostgreSQL target to link the tunnel to. An empty string unlinks the linked target.

Responses

200

OK

SSHTunnelResponse · 18 fields
created_atstring
error_messagestring

Reason of the last failure of the tunnel in Principal's words. Never a driver or dial error

health_checked_atstring
health_error_messagestring

Reason of the last failed health check, or of the failed reconnects of a tunnel that stopped because nobody used it

health_statusstring
idstring
last_connected_atstring
local_portinteger

Always 0. Principal no longer opens a local port for a tunnel. Kept for wire compatibility.

deprecated
namestring
remote_hoststring
remote_portinteger
ssh_hoststring
ssh_key_idstring

SSH key the tunnel signs in with. Omitted when the tunnel has no key.

ssh_portinteger
ssh_userstring
statusstring
disconnectedconnectingconnectedfailed
target_idstring
updated_atstring
409

Changes of a target that depends on the tunnel, linked or selecting it in its connection settings, are paused by the operator. The detail names the paused targets

Common errors: 400 401 403 404 413 429 503 504. They mean the same for every operation, see Errors.

↑ ↓ to moveEnter to openEsc to close