Logo
OpenScaler

Retrieve an existing VM

Retrieve details about an existing VM by its ID.

GET
/v1/vms/{vm_id}

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

Path Parameters

vm_idRequiredstring

A unique identifier for a VM instance.

Query Parameters

onlyarray<string>

request specific information only, if not send all by default :

  • basic : request basic information only (ex: id, name, etc.). Note that this info is always present no matter the request.
  • state : request domain state (ex: running, paused, etc.)
  • disks : request attached disks information
  • network : request network information
curl -X GET "https://api.alpha.openscaler.net/v1/vms/23" \
  -H "Authorization: Bearer <token>"

VM info, Can contain any (or all) of the variants mentioned below Depending on requested data.

{
  "id": 8,
  "name": "my-example-computer",
  "user_id": "7247ba6a-b17d-4c72-94f1-a36108aee56d",
  "project_id": "default",
  "uuid": "c8bcdc74-fe5d-11ee-9a99-1e3c3b352c51",
  "region": "alg1",
  "description": "My example computer (generated from API)",
  "distro": "debian-13",
  "vcpus": 1,
  "storageGB": 50,
  "memoryMB": 2048,
  "transferGB": 2048,
  "vpc_id": 1,
  "created_at": "2024-04-19T15:02:04",
  "updated_at": "2024-04-19T15:02:04",
  "size": "b-1-500mb-10",
  "node_type": "VM",
  "state": "running",
  "disks": [
    {
      "is_main_disk": true,
      "capacityBytes": 53687091200,
      "allocationBytes": 1391562197,
      "path": "/",
      "target_device": "vda"
    },
    {
      "is_main_disk": false,
      "capacityBytes": 5368709120,
      "allocationBytes": 4486426928,
      "path": "/mnt/vdc1",
      "target_device": "vdc"
    }
  ],
  "network": {
    "resource_type": "vm",
    "mac": "02:00:00:00:00:01",
    "private_ip": "10.0.1.2",
    "vpc_subnet": "10.0.1.0/24",
    "vpc_id": 1,
    "region": "alg1",
    "public_ip": "10.99.88.77",
    "public_ip_ports": [
      {
        "description": "SSH port for VM 8 (internal port 22)",
        "port": 9000,
        "internal_port": 22
      },
      {
        "description": "HTTP port for VM 8 (internal port 80)",
        "port": 9001,
        "internal_port": 80
      },
      {
        "description": "HTTPS port for VM 8 (internal port 443)",
        "port": 9002,
        "internal_port": 443
      }
    ]
  },
  "price_hourly": 0.01786,
  "price_monthly": 12
}