Appearance
Load balancers
Not open to customers yet
The load balancer endpoints are currently reserved for Anikeen staff: customer tokens get 403 on all of them. They are documented here for completeness and will be opened later.
Load balancers with their backends (server pools), frontends (listeners) and routing rules (scope console-load-balancers beta, or user / user:read / products:read).
| Method | Path | |
|---|---|---|
| GET | /load-balancers | list |
| GET | /load-balancers/{load_balancer} | one, with its frontends and backends |
| GET, POST | /load-balancers/{load_balancer}/backends | list, create backends |
| GET, PUT, DELETE | /load-balancers/{load_balancer}/backends/{backend} | read (with its servers), change, delete |
| POST | /load-balancers/{load_balancer}/backends/{backend}/servers | add a server to a backend |
| PUT, DELETE | /load-balancers/{load_balancer}/backends/{backend}/servers/{server} | change, remove |
| POST | /load-balancers/{load_balancer}/frontends | create a frontend |
| PUT, DELETE | /load-balancers/{load_balancer}/frontends/{frontend} | change, delete |
| POST | /load-balancers/{load_balancer}/frontends/{frontend}/backends | add a routing rule |
| PUT, DELETE | /load-balancers/{load_balancer}/frontends/{frontend}/backends/{pivot} | change, delete a routing rule |
| POST | /load-balancers/{load_balancer}/frontends/{frontend}/binds | add a bind (address and port) |
| PUT, DELETE | /load-balancers/{load_balancer}/frontends/{frontend}/binds/{bind} | change, delete |
Nested objects only resolve within their parent: a backend of another load balancer answers 404.
How the parts fit together
text
client ──▶ frontend (binds: address:port, mode http|tcp)
│ routing rules: if/unless <condition> → backend
│ default backend
▼
backend (mode, balance) ──▶ servers (address:port, health check)Backends
| Field | Rules |
|---|---|
mode | required, http or tcp |
balance | required, roundrobin |
description | optional |
bash
curl -X POST https://console.anikeen.com/api/v1/load-balancers/01JC…/backends \
-H "Authorization: Bearer $ANIKEEN_TOKEN" -H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"mode":"http","balance":"roundrobin","description":"web"}'A backend that is the default backend of a frontend cannot be deleted (409).
Backend servers
| Field | Rules |
|---|---|
address | required |
port | required, integer |
check | optional boolean: health check on |
Frontends
| Field | Create | Change | |
|---|---|---|---|
mode | required | required | http or tcp |
description | optional | optional | |
load_balancer_backend_id | optional | optional | the default backend |
inspect_sni_capability | - | optional | tcp frontends only: route TLS traffic by its SNI host name |
Binds
Where the frontend listens:
| Field | Rules |
|---|---|
address | required |
port | required, integer |
Routing rules
A routing rule sends matching requests of a frontend to a backend:
| Field | Rules |
|---|---|
load_balancer_backend_id | required, the target backend |
cond | required, if or unless |
cond_test | required, the condition; {hostname} is replaced with hostname |
hostname | required |
json
{"load_balancer_backend_id": "01JC…", "cond": "if", "cond_test": "{ req.hdr(host) -i {hostname} }", "hostname": "www.example.com"}Creating a rule answers 204. The Console itself uses { req.hdr(host) -i {hostname} } for http frontends and { req_ssl_sni -i {hostname} } for tcp frontends with SNI inspection.