Skip to content

Compute service API reference

See https://docs.openstack.org/api-ref/compute/.

These methods allow you to perform various operations on compute resources, such as managing flavors, images, and instances (servers), as well as controlling the lifecycle and configuration of instances. The {server_id}, {flavor_id}, {image_id}, and {snapshot_name} in the URLs and request bodies are placeholders that should be replaced with the actual IDs or names of the resources.

List flavors

Bash
GET /flavors

Show flavor details

Bash
GET /flavors/{flavor_id}

List images

Bash
GET /images

Show image details

Bash
GET /images/{image_id}

List servers (instances)

Bash
GET /servers

Show server details

Text Only
GET /servers/{server_id}

Create a server

Bash
POST /servers

Delete a server

Bash
DELETE /servers/{server_id}

Start a server

Bash
POST /servers/{server_id}/action with {"os-start": null} in the request body

Stop a server

Bash
POST /servers/{server_id}/action with {"os-stop": null} in the request body

Reboot a server

Bash
POST /servers/{server_id}/action with {"reboot": {"type": "SOFT" or "HARD"}} in the request body

Resize a server

Bash
POST /servers/{server_id}/action with {"resize": {"flavorRef": "{flavor_id}"}} in the request body

Confirm resize

Bash
POST /servers/{server_id}/action with {"confirmResize": null} in the request body

Revert resize

Bash
POST /servers/{server_id}/action with {"revertResize": null} in the request body

List server addresses

Bash
GET /servers/{server_id}/ips

Show server console output

Bash
POST /servers/{server_id}/action with {"os-getConsoleOutput": {"length": "{num_lines}"}} in the request body

Create server snapshot

Bash
POST /servers/{server_id}/action with {"createImage": {"name": "{snapshot_name}", "metadata": {}}} in the request body