Compute API
VM lifecycle, networking primitives, and the auto-scaling control loop. Base URL: https://cloudnx.in/compute/.
Instances
| Method | Path | Purpose |
|---|
| GET / POST | /compute/instances | List or launch instances. |
| GET / DELETE | /compute/instances/{id} | Show or terminate. |
| POST | /compute/instances/{id}/start | Power on a stopped instance. |
| POST | /compute/instances/{id}/stop | Graceful shutdown. |
| POST | /compute/instances/{id}/reboot | Soft reboot. |
| GET | /compute/instances/{id}/metrics | Per-VM CPU / RAM / network metrics. |
| WS | /compute/ws/instances/{id}/console | WebSocket — 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
| Method | Path | Purpose |
|---|
| GET / POST | /compute/asg | List or create ASGs. |
| GET / PATCH / DELETE | /compute/asg/{id} | Show, update, or delete. |
| GET / PUT / DELETE | /compute/instances/{id}/autoscaling | Single-VM autoscale rule. |
Networking
| Method | Path | Purpose |
|---|
| GET / POST | /compute/elastic-ips | Allocate from the EIP pool. |
| POST | /compute/elastic-ips/{id}/attach | 1:1 forward to an instance. |
| POST | /compute/elastic-ips/{id}/detach | Detach. |
| 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
| Method | Path | Purpose |
|---|
| GET / POST | /compute/volumes | Block-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}/restore | Restore a snapshot in place. |
| GET / PUT | /compute/instances/{id}/backup-schedule | Cron-style automatic snapshots. |
Load balancers
| Method | Path | Purpose |
|---|
| GET / POST | /compute/load-balancers | LB 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.