Skip to content
Odinex Cloud
Concepts

Actions

Long-running operations and how to follow them.

Creating a server, attaching a volume, powering off: many operations take seconds to minutes. The API does not keep the connection open until they are done. It starts the operation and answers right away (201) with an action:

{
  "action": {
    "id": 4211,
    "command": "create_server",
    "status": "running",
    "progress": 0,
    "started": "2026-10-09T08:00:00Z",
    "finished": null,
    "resources": [{ "id": 42, "type": "server" }],
    "error": null
  }
}

Poll GET /actions/{id} until status is no longer running (or listen to real-time events instead):

StatusMeaning
runningStill in progress; progress goes from 0 to 100
successDone
errorFailed; error.code and error.message say why. Changes are rolled back where possible
while :; do
  status=$(curl -s -H "Authorization: Bearer $ODX_TOKEN" \
    https://api.odinex.cloud/v1/actions/4211 | jq -r .action.status)
  [ "$status" = running ] || break
  sleep 2
done
echo "$status"

The odx CLI and the Terraform provider wait for actions automatically (odx … --no-wait returns at once).

  • resources lists the resources the action works on.
  • GET /actions lists the project's actions, newest first, filtered by status or by resource_type and resource_id.
  • While an action runs on a resource, other changes to that resource fail with 409 resource_busy. Wait for the action to finish, then retry.
  • The resource returned next to the action (for example server from POST /servers) already exists in the API, with a status such as initializing, before the action has finished.