Operations, retries and dry runs

Work that takes time answers at once with an operation to follow

Updated

API documentation pages
  1. Getting started
  2. Tokens
  3. Errors
  4. Operations
  5. Deletion
  6. Cost and risk
  7. Changelog

Creating, starting, resizing, deleting and restoring take time. The request answers 202 with an operation at once; the work goes on after the answer.

pending → running → succeeded | failed

Follow an operation#

Terminal
curl -s -H "Authorization: Bearer $XVER_TOKEN" https://api.xver.cloud/v2/operations/OPERATION_ID
  • Until it ends, the answer has Retry-After: ask again after that many seconds.
  • failed has error.code from the list of codes.
  • A token sees only the operations it started; others answer operation_not_found.
  • Work that was accepted is not cancelled, not even when the token is revoked.
  • One resource runs one operation at a time. A second answers 409 resource_busy.

A new server is succeeded once it is running. It then reboots itself once, so it may not answer for a minute or two.

Idempotency-Key#

Every request that creates or deletes something needs an Idempotency-Key header: a value of yours, such as a UUID, new for each piece of work.

  • The same key with the same request within 24 hours answers what the first one answered, with Idempotency-Replayed: true. Nothing is done twice.
  • The same key with another request answers 422 idempotency_mismatch.
  • While the first is still running: 409 idempotency_in_progress with Retry-After.
  • A key belongs to its token. A token made in place of another starts without its keys.

When an answer is lost (timeout, broken connection, 502 outcome_unknown), send the same request with the same key, or read the resource. Never send it with a new key: that can make a second server.

Dry runs#

Requests that create, change or delete take ?dry_run=true. Every check runs and nothing happens. The answer says what would be destroyed, the warnings, the price and every reason it would be refused, all at once. A dry run needs only the read level and takes no key.