Logo
OpenScaler

Retrieve aggregate live stats

Get live stats for all VMs, VPCs, and other resources (Useful for dashboard).

Notes :

  • sometimes the reply might be delayed for few seconds, this will happen if you request was sent while new stats are being written.
GET
/v1/stats/live

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

curl -X GET "https://api.alpha.openscaler.net/v1/stats/live" \
  -H "Authorization: Bearer <token>"

Returns live stats for all VMs, VPCs, and other resources as well as stats for individual resources.

{
  "timestamp": 1713525285,
  "step": 5,
  "data": {
    "cpu": 58.54400337,
    "memory.used": 2543343553.3566084,
    "memory.total": 4294967296,
    "disk.read": 2446788.2,
    "disk.write": 3507564.04,
    "disk.allocation": 70368256460.6,
    "disk.capacity": 107374182400,
    "disk.usage": 65.53554577808828,
    "block_storage.read": 2669941.64,
    "block_storage.write": 2375633,
    "block_storage.allocation": 3148015832.2,
    "block_storage.capacity": 10737418240,
    "block_storage.usage": 58.636364195495844,
    "network.rx": 2132314.2800000003,
    "network.tx": 3001534.4000000004,
    "vms": [
      {
        "vm_id": 4,
        "name": "my-example-computer",
        "state": "running",
        "region": "alg1",
        "created_at": "2024-04-19T11:13:49",
        "os": "debian-13",
        "cpu": 100,
        "memory.used": 469027631.7276006,
        "memory.total": 2147483648,
        "disk.read": 968189.2,
        "disk.write": 1479661.64,
        "disk.allocation": 19540550470.6,
        "disk.capacity": 53687091200,
        "disk.usage": 36.39711154736578,
        "network.rx": 804.24,
        "network.tx": 1355.08
      },
      {
        "vm_id": 5,
        "name": "my-example-computer",
        "state": "running",
        "region": "alg1",
        "created_at": "2024-04-19T11:14:36",
        "os": "debian-13",
        "cpu": 17.08800674,
        "memory.used": 2074315921.629008,
        "memory.total": 2147483648,
        "disk.read": 1478599,
        "disk.write": 2027902.4,
        "disk.allocation": 50827705990,
        "disk.capacity": 53687091200,
        "disk.usage": 94.67398000881076,
        "network.rx": 2037,
        "network.tx": 311.8
      }
    ],
    "vpcs": [
      {
        "vpc_id": 1,
        "network.rx": 1026426.56,
        "network.tx": 1302641.2799999998
      },
      {
        "vpc_id": 2,
        "network.rx": 1105887.72,
        "network.tx": 1698893.1200000003
      }
    ]
  }
}