Compute API

VM lifecycle, networking primitives, and the auto-scaling control loop. Base URL: https://cloudnx.in/compute/.

Instances

MethodPathPurpose
GET / POST/compute/instancesList or launch instances.
GET / DELETE/compute/instances/{id}Show or terminate.
POST/compute/instances/{id}/startPower on a stopped instance.
POST/compute/instances/{id}/stopGraceful shutdown.
POST/compute/instances/{id}/rebootSoft reboot.
GET/compute/instances/{id}/metricsPer-VM CPU / RAM / network metrics.
WS/compute/ws/instances/{id}/consoleWebSocket — browser SSH console.

Launch payload

POST /compute/instances
{
  "name":              "web-01",                       // RFC-1123 hostname
  "instance_type_id":  "285863dd-…",                   // see catalog
  "image_id":          "ubuntu-22.04",
  "ssh_key_id":        "01HZK…"                        // optional
}

Response

{
  "id":               "01HZK…",
  "name":             "web-01",
  "status":           "provisioning",   // → running in 40-60s
  "private_ip":       "10.10.0.5",
  "public_ip":        "65.108.205.210", // shared host IP
  "public_hostname":  "vm-x4f8a1b2.vm.cloudnx.in",
  "ssh_port":         22042,
  "plan": { "name": "Small", "cpu": 2, "ram": 2147483648, "disk": 32212254720, "price_monthly": 149900 }
}

Auto Scaling Groups

MethodPathPurpose
GET / POST/compute/asgList or create ASGs.
GET / PATCH / DELETE/compute/asg/{id}Show, update, or delete.
GET / PUT / DELETE/compute/instances/{id}/autoscalingSingle-VM autoscale rule.

Networking

MethodPathPurpose
GET / POST/compute/elastic-ipsAllocate from the EIP pool.
POST/compute/elastic-ips/{id}/attach1:1 forward to an instance.
POST/compute/elastic-ips/{id}/detachDetach.
DELETE/compute/elastic-ips/{id}Release back to pool.
GET / POST / DELETE/compute/instances/{id}/firewall[/rules/{rule_id}]Per-VM inbound/outbound rules.
GET / POST / DELETE/compute/vpcs[/{id}]VPC CRUD.

Storage / volumes / snapshots

MethodPathPurpose
GET / POST/compute/volumesBlock-volume CRUD.
POST/compute/volumes/{vol_id}/{attach,detach}Attach to / detach from a VM.
GET / POST / DELETE/compute/instances/{id}/snapshots[/{snap_id}]Per-instance snapshot lifecycle.
POST/compute/instances/{id}/snapshots/{snap_id}/restoreRestore a snapshot in place.
GET / PUT/compute/instances/{id}/backup-scheduleCron-style automatic snapshots.

Load balancers

MethodPathPurpose
GET / POST/compute/load-balancersLB CRUD.
GET / DELETE/compute/load-balancers/{id}Show / delete.
POST / DELETE/compute/load-balancers/{id}/backends[/{instance_id}]Add / remove backend instances.

Curl example — list instances

curl -H "Authorization: Bearer $TOKEN" https://cloudnx.in/compute/instances

$TOKEN can be obtained via POST /auth/login or POST /auth/iam/exchange-credentials. The cloudnx CLI handles this automatically.