Skip to content
Coritan Docs

Client API: Cloud Compute: Port forwards

The 3 Client API operations for port forwards.

View as Markdown

Part of Cloud Compute.

Method Path Summary
GET /api/v1/client/vps/{uuid}/port-forwards The ports of the shared address that reach this instance
POST /api/v1/client/vps/{uuid}/port-forwards Forward a port of the shared address to a port of this instance
DELETE /api/v1/client/vps/{uuid}/port-forwards/{forward_uuid} Remove one of this instance's port forwards

The ports of the shared address that reach this instance

Section titled The ports of the shared address that reach this instance

GET /api/v1/client/vps/{uuid}/port-forwards

The ports of the shared address that reach this instance.

Answers {items, limit, used, available, reason, address}. Each item is {uuid, label, kind, protocol, public_port, private_port, address, endpoint, active, created_at}: connections to public_port of the shared address the instance's host gives it reach private_port of the instance. protocol is tcp, udp or both. kind is ssh or rdp for the forward the instance got by itself (port 22 on a Linux or BSD image, Remote Desktop on Windows) and custom for one that was added. active is true while the forward reaches the instance, and address and endpoint (address:public_port) are null while it does not.

available is true while the instance is behind a shared address (outbound.mode is nat), and address is that address. Otherwise reason is public_ipv4 (the instance has an address of its own, so its forwards rest until that address is detached) or no_shared_address. limit is how many forwards an instance holds and used how many it has.

An instance that is not yours answers 404.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Forward a port of the shared address to a port of this instance

Section titled Forward a port of the shared address to a port of this instance

POST /api/v1/client/vps/{uuid}/port-forwards

Forward a port of the shared address to a port of this instance.

Send private_port (1 to 65535), protocol (tcp, udp or both; tcp when left out) and an optional label of up to 64 characters. The public port is given, never chosen: the lowest free port of the shared address, from 10000 to 40000. Answers the new forward, as the list does. The host forwards the port within a minute or two.

Answers 409 when the instance has a public IPv4 address or no shared address, holds five forwards already, already forwards that port with that protocol, or is migrating; 403 when it is suspended; 422 for a port or a protocol that is not one; 404 when the instance is not yours; 429 when asked too often.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
private_port integer yes
protocol string, one of tcp, udp, both no
label string or null no
Status Meaning
201 Success.
422 The request is not valid. detail lists each problem.

Remove one of this instance's port forwards

Section titled Remove one of this instance's port forwards

DELETE /api/v1/client/vps/{uuid}/port-forwards/{forward_uuid}

Remove one of this instance's port forwards.

Answers {removed, public_port} and frees the port. 404 when the forward or the instance is not yours; 409 while the instance is migrating; 429 when asked too often.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes
forward_uuid path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.