Appearance
Servers beta
Virtual servers (product family server, scope console-servers).
| Method | Path | Ability | Notes |
|---|---|---|---|
| GET | /servers | view | ?name= |
| GET | /servers/{server} | view | with status, location, floating_ips, post_install |
| PUT/PATCH | /servers/{server} | update | name |
| DELETE | /servers/{server} | delete | body name = the server's name → 204 |
| POST | /servers/{server}/power | power | action → 202 |
| POST | /servers/{server}/reinstall | reinstall | operating_system_id, optional post_install_script → 202 |
| GET | /servers/{server}/post-install | view | the latest post-install run; 404 without one |
| GET | /servers/{server}/backups | view | |
| POST | /servers/{server}/backups | update | notes (optional) → 202 |
| POST | /servers/{server}/backups/{backup}/restore | update | 202 |
| DELETE | /servers/{server}/backups/{backup} | update | 202 |
| GET | /servers/{server}/snapshots | view | |
| POST | /servers/{server}/snapshots | update | name, description, state → 202 |
| POST | /servers/{server}/snapshots/{name}/rollback | update | 202 |
| DELETE | /servers/{server}/snapshots/{name} | update | 202 |
Access
{server}is the server's id. Servers you cannot see answer404.- The abilities are those of the Console: team members may do everything; a reseller's end customer by its grant level -
view,powerfor power and reinstall,managefor name, backups and snapshots. Deleting is for the team only. Otherwise403.
Background operations
202 operations run in the background ({"message": "…"}); check the result with GET.
statusis read from the host at most every 15 seconds; it isnullwhile the host is not reachable.- Reading backups or snapshots, creating a snapshot or renaming while the host is not reachable answers
503. - Unknown backups and snapshots answer
404.
The server object
GET /servers (paginated) lists the servers with their own fields only; ?name= filters by the exact name. GET /servers/{server} (and the answer of a rename) adds:
| Field | |
|---|---|
status | the live status, or null; provisioning while the server is being set up beta |
provisioning_status beta | null when ready, provisioning or failed - see Products being set up |
location | {id, name, country} |
floating_ips | [{ip, version, floating_ip_id, provisioning_status}] - floating_ip_id is the floating IP product, null for an address that came with the server; provisioning_status is the floating IP product's (null when ready) |
post_install | the latest post-install run (see Post-install scripts) |
bash
curl "https://console.anikeen.com/api/v1/servers?name=web-01.example.com" \
-H "Authorization: Bearer $ANIKEEN_TOKEN" -H "Accept: application/json"Rename
http
PUT /v1/servers/{server}
{"name": "web-02.example.com"}name is a hostname (max. 254 characters); the virtual machine is renamed too.
Delete
http
DELETE /v1/servers/{server}
{"name": "web-02.example.com"}- The name must match (
422otherwise). - The server is switched off and billing stops right away. It is purged after 14 days (until then support can restore it).
- A server with the deletion protection on answers
409,error: server_protected(switch it off in the Console).
Power
http
POST /v1/servers/{server}/power
{"action": "start"}action: start, stop, shutdown, reboot → 202.
A server suspended for an unpaid subscription is not started, restarted or reinstalled: 409, error: billing_suspended. Stopping stays possible.
Reinstall
http
POST /v1/servers/{server}/reinstall
{"operating_system_id": "01JC…", "post_install_script": "#!/bin/bash\napt-get update"}| Field | |
|---|---|
operating_system_id | required, one of the images available for the server's host (as on its reinstall page in the Console) |
post_install_script | optional - see Post-install scripts |
Backups
| Request | Body | Result |
|---|---|---|
GET …/backups | {"data": [...]} with id, notes, size (bytes), created_at, newest first | |
POST …/backups | {"notes": "before update"} (optional, max. 1000) | 202 |
POST …/backups/{backup}/restore | 202; the server is stopped and overwritten | |
DELETE …/backups/{backup} | 202 |
Snapshots
| Request | Body | Result |
|---|---|---|
GET …/snapshots | {"data": [...]} with name, description, parent, state (with RAM), created_at, newest first | |
POST …/snapshots | {"name": "before_update", "description": "…", "state": true} | 202 |
POST …/snapshots/{name}/rollback | 202 | |
DELETE …/snapshots/{name} | 202 |
Snapshot name: a letter, then letters, digits, -, _; 2–40 characters; an existing name answers 422. description: optional, max. 1000 characters. state (boolean, default false) includes the RAM in the snapshot.
Floating IPs
Floating IPs are ordered as family floatingIp (see Order attributes) and show up in the server's floating_ips. They belong to the scope console-servers.