Tools
CLI
The ankra-cloud command line tool for servers, storage, networks and every other API operation, with JSON output and waiting for operations.
ankra-cloud manages one Ankra Cloud account from a terminal or a script. It has curated commands for the everyday
resources and a generic ankra-cloud api <operation_id> that calls any operation an API token may call.
Install#
The CLI is a single static Go binary built from the Ankra Cloud repository:
make cli-build # writes bin/ankra-cloud
make cli-linux # bin/linux-amd64/ankra-cloud for Linux servers
Configure#
export ANKRA_CLOUD_ENDPOINT=https://cloud.ankra.app
export ANKRA_CLOUD_TOKEN=act_...
| Setting | Flag | Environment |
|---|---|---|
| API token | none, on purpose | ANKRA_CLOUD_TOKEN |
| Endpoint | --endpoint |
ANKRA_CLOUD_ENDPOINT |
| Private certificate authority | --certificate-authority |
ANKRA_CLOUD_CERTIFICATE_AUTHORITY |
The token is read only from the environment, never from a flag, so it never shows in process listings or shell
history. Create one under Settings → API tokens; a read token is a safe way to explore.
Everyday commands#
ankra-cloud zones list
ankra-cloud plans list
ankra-cloud templates list
ankra-cloud servers create --zone de-fsn1 --hostname web-1 --plan starter-1c-1g \
--template debian-13 --ssh-key-file ~/.ssh/id_ed25519.pub --wait
ankra-cloud servers list
ankra-cloud servers get <server-id>
ankra-cloud servers stop <server-id> --wait
ankra-cloud servers delete <server-id> --keep-storages --wait
| Group | Commands |
|---|---|
zones, plans, templates, storage-tiers |
list |
quotas |
limits and usage |
servers |
list, get, create, start, stop, restart, delete |
storages |
list, get, create, attach, detach, resize, backup, delete |
backups |
list, get, restore, delete |
custom-images |
list, copy, delete |
networks |
list, get, create, delete |
routers |
list, get, create, attach-network, detach-network, set-nat, delete |
floating-ips |
list, get, allocate, assign, release |
firewall |
get, set --file firewall.json |
operations |
get, wait |
audit |
list, export, integrity |
ankra-cloud <group> --help lists each command's flags. servers create takes --ssh-key and --ssh-key-file
(repeatable, at least one), --network <network-id>[=<address>], --user-data-file, --storage-gibibytes,
--storage-tier, --public-ipv4 for the IPv4 add-on and --no-public-ipv6.
Waiting and output#
- Writes answer at once with the operation that carries them out. Add
--waitto wait for it (up to--timeout, 30 minutes by default) and print the result;ankra-cloud operations wait <id>waits for any operation. -o table(default) prints tables;-o jsonprints the API's JSON for scripts andjq.- Exit codes:
0on success,1when the API or an operation fails,2for usage and configuration mistakes.
Any operation: ankra-cloud api#
Every operation in the API reference has a stable operationId. ankra-cloud api calls it by
name, so the CLI reaches everything, curated command or not:
ankra-cloud api list # the operations an API token may call
ankra-cloud api list --all # every operation, with who may call it
ankra-cloud api get_server -p id=<server-id>
ankra-cloud api list_servers -p label=env=prod -p limit=20
ankra-cloud api create_edge --data @edge.json
ankra-cloud api redeem_coupon --data '{"code": "WELCOME500"}'
-p name=value(repeatable) fills a path or query parameter.--datais the JSON request body, inline or@file.- The answer is printed as the API sent it, JSON indented. An answer outside 2xx exits with code 1.
Operations that need a signed-in session, a staff session or an operator token appear with --all but cannot be
called with an API token.