Overview
The Xloud Compute API provides programmatic control over virtual machine instances, flavors, keypairs, availability zones, server groups, and hypervisor resources. The API follows RESTful conventions with JSON request and response bodies.Prerequisites
- A valid project-scoped token from the Identity API
- Base URL:
https://api.<your-domain>/compute/v2.1 - Minimum API microversion:
2.1
API Versioning (Microversions)
The Compute API uses microversions to add new capabilities without breaking existing clients. Specify the desired microversion in theX-OpenStack-Nova-Microversion header:
Request with specific microversion
Query supported microversions
Key Endpoints
| Resource | Method | Endpoint | Description |
|---|---|---|---|
| List instances | GET | /servers | List all instances in the project |
| Instance detail | GET | /servers/detail | List instances with full details |
| Get instance | GET | /servers/{id} | Get a specific instance |
| Create instance | POST | /servers | Launch a new instance |
| Delete instance | DELETE | /servers/{id} | Delete an instance |
| Instance action | POST | /servers/{id}/action | Perform an action (reboot, resize, etc.) |
| List flavors | GET | /flavors/detail | List all available instance sizes |
| List images | GET | /images | List available images |
| List keypairs | GET | /os-keypairs | List SSH keypairs |
| Create keypair | POST | /os-keypairs | Register or generate an SSH keypair |
| List AZs | GET | /os-availability-zone | List availability zones |
| Server groups | GET | /os-server-groups | List server groups (affinity/anti-affinity) |
| Hypervisors | GET | /os-hypervisors/detail | List hypervisors (admin) |
| Quotas | GET | /os-quota-sets/{project_id} | Show project compute quotas |
Create an Instance
Display name for the instance.
Flavor ID or URL. Determines vCPU, RAM, and disk allocation.
Image ID or URL to boot from. Omit when booting from volume.
List of network objects. Each must include
uuid (network ID) or port (port ID).SSH keypair name to inject into the instance for key-based authentication.
List of security group name objects. Defaults to the
default group.Base64-encoded cloud-init user data script executed at first boot.
Target availability zone. Omit to let the scheduler choose.
Instance Actions
Perform operations on a running instance via the/action endpoint:
- Reboot
- Stop / Start
- Resize
- Snapshot
Soft reboot (graceful OS restart)
Hard reboot (power cycle)
List Instances with Filtering
List all running instances
List instances with full details
List instances across all projects (admin)
| Parameter | Description |
|---|---|
status | Filter by instance status: ACTIVE, SHUTOFF, BUILD, ERROR |
name | Filter by instance name (supports regex) |
flavor | Filter by flavor ID |
image | Filter by image ID |
all_tenants | 1 to list across all projects (admin only) |
limit | Maximum number of results per page |
marker | Pagination cursor — last instance ID from previous page |
Error Reference
| HTTP Status | Error Code | Description |
|---|---|---|
400 | badRequest | Invalid request body or parameter |
401 | unauthorized | Token missing, invalid, or expired |
403 | forbidden | Insufficient permissions for this operation |
404 | itemNotFound | Instance or resource not found |
409 | conflictingRequest | Operation not valid in current instance state |
413 | entityTooLarge | Request exceeds quota limits |
429 | overLimit | Rate limit exceeded |
Next Steps
Storage API
Attach volumes and manage snapshots via the Storage API
Networking API
Create networks and assign floating IPs for your instances
Authentication
Manage tokens and application credentials
Automation
Automate instance lifecycle with scripts and SDKs