Logo
OpenScaler

List All VMs

List all VMS owned by a user. Specify project ID to only list VMs within given projects.

GET
/v1/vms

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

Query Parameters

project_idRequiredstring

ID of the project used to filter results.

curl -X GET "https://api.alpha.openscaler.net/v1/vms?project_id=default" \
  -H "Authorization: Bearer <token>"

VM list based on requested filters

{
  "vms": [
    {
      "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
    }
  ]
}