Logo
OpenScaler
API Documentation/Computer Public Ports

Close port for VM

Closes an exposed port for VM. Note that this operation must be double confirmed especially for port 22, which if deleted will cause user to lose SSH connection to their VM (user needs to be aware of that).

Example: if a user want to stop exposing 80 port in their VM, they can do so by sending a DELETE request to /v2/vms/{vm_id}/public_ports with the following payload:

{
  "port": 80
}
DELETE
/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

The internal port to be removed from public exposure

Path Parameters

vm_idRequiredstring

A unique identifier for a VM instance.

vm_idRequiredstring

A unique identifier for a VM instance.

curl -X DELETE "https://api.alpha.openscaler.net/v1/vms/23/public_ports" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "port": 80
  }'

if VM public port removed successfully, an empty success response is returned.