Skip to content

The port rules of an SVM and the presigned links of authenticated ports

Resource, request and plan limits are listed on Limits.

Download OpenAPI specification · Version 0.1.0

List the open ports of an SVM

GET
/svms/{ref}/ports

Returns the open ports of an SVM with a fresh presigned link for each authenticated port; a port that is not listed is closed.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Response Body

The open ports of the SVM, by port; a port that is not listed is closed.

application/json
  1. response

The open ports of the SVM, by port; a port that is not listed is closed.

[index: integer]?

One open port of an SVM.

Example Request
curl -X GET 'https://api.slashinfra.com/svms/build-1/ports'
Example Response
[  {    "access": "authenticated",    "port": 3000,    "url": "https://3000-6f1c0f0e8a.slashinfra.dev/?si_access=..."  }]

Close a port of an SVM

DELETE
/svms/{ref}/ports/{port}

Closes a port so only members of the organization reach it, and every presigned link of the port stops working, even after the port is opened again. Closing an already closed port changes nothing.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length
port*string

The port of the SVM, from 1 to 65535.

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Response Body

The port is closed, and every link of the port stops working at once.

response?stringtext/plain

The port is closed, and every link of the port stops working at once.

Example Request
curl -X DELETE 'https://api.slashinfra.com/svms/build-1/ports/3000'
Example Response
"string"

Open or change a port of an SVM

PUT
/svms/{ref}/ports/{port}

Opens a port or changes its access; a port that is not open is closed and only members reach it. The first open, an access change, a close or a rotate each make a new generation, and every link minted before it stops working.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length
port*string

The port of the SVM, from 1 to 65535.

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Request Body

  1. body
access*string

The access to open the port with: authenticated accepts members and holders of the link, public accepts anyone, and any other value answers 400 invalid_access.

Response Body

One open port of an SVM.

application/json
  1. response

One open port of an SVM.

access*string

authenticated accepts members and holders of the link; public accepts anyone.

Value in"authenticated""public"
port*integer

The port of the SVM, from 1 to 65535.

url*|

A presigned link of the port.

Example Request
curl -X PUT 'https://api.slashinfra.com/svms/build-1/ports/3000' \  -H 'Content-Type: application/json' \  -d '{  "access": "authenticated"}'
Example Response
{  "access": "authenticated",  "port": 3000,  "url": "https://3000-6f1c0f0e8a.slashinfra.dev/?si_access=..."}
POST
/svms/{ref}/ports/{port}/rotate

Makes a new generation of an open port, so every link minted before it answers 401 unauthorized; the port keeps its access and returns a fresh link when authenticated.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length
port*string

The port of the SVM, from 1 to 65535.

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Response Body

One open port of an SVM.

application/json
  1. response

One open port of an SVM.

access*string

authenticated accepts members and holders of the link; public accepts anyone.

Value in"authenticated""public"
port*integer

The port of the SVM, from 1 to 65535.

url*|

A presigned link of the port.

Example Request
curl -X POST 'https://api.slashinfra.com/svms/build-1/ports/3000/rotate'
Example Response
{  "access": "authenticated",  "port": 3000,  "url": "https://3000-6f1c0f0e8a.slashinfra.dev/?si_access=..."}
POST
/svms/{ref}/ports/{port}/url

Mints a stateless link for one SVM, one port and the current generation of an authenticated or public port, valid for ttl_s. Closing or rotating the port invalidates it.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length
port*string

The port of the SVM, from 1 to 65535.

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Request Body

  1. body
ttl_s?number

The life of the link in seconds, 3600 by default; the longest is the max_url_ttl_s of the plan, 30 days on both plans.

Response Body

A presigned link of one port and its expiry.

application/json
  1. response

A presigned link of one port and its expiry.

expires_at*integer

The expiry of the link in milliseconds since the Unix epoch.

url*string

The presigned URL of the port: https://<port>-<id>.<SVM domain>/?si_access=<token>; the first GET answers a 303 without the token and sets the access cookie.

Example Request
curl -X POST 'https://api.slashinfra.com/svms/build-1/ports/3000/url' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "expires_at": 1767229200000,  "url": "https://3000-6f1c0f0e8a.slashinfra.dev/?si_access=..."}