Logo
OpenScaler
API Documentation/Computer Public Ports

Expose port for VM

Exposes internal port in VM to public traffic. For example if a user want to publish 80 port in their VM, they can do so by sending a POST request to /v2/vms/{vm_id}/public_ports with the following payload:

{
  "port": 80,
  "desc": "Server 123"
}
POST
/v1/vms/{vm_id}/public_ports

Authorization

AuthorizationRequiredBearer <token>

OAuth Authentication

OpenScaler API uses OAuth, a standard for secure authorization. To access the API, obtain a token via the OpenScaler Platform.

Use the access_token in the Authorization header for requests:

Authorization: Bearer <token>

Always keep your token secure and do not share it with anyone.

In: header

Request Body

application/jsonOptional
portinteger

internal port to be exposed (example: 80 for HTTP or 443 for HTTPS)

descstring

description of what this port is used for, example "SSH" or "Server 123"

Default: ""Maximum length: 255

Path Parameters

vm_idRequiredstring

A unique identifier for a VM instance.

curl -X POST "https://api.alpha.openscaler.net/v1/vms/23/public_ports" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "port": 8080,
    "desc": "My daily blog server"
  }'

VM public port added successfully

{
  "public_port": 9003
}