The admin API, under /api on the web server (Sovite.Core.Web),
for sovitectl, monitoring, and the UI. Every request needs the token
from admin.token_file:
curl -H "Authorization: Bearer $(cat /var/lib/sovite/admin.token)" http://127.0.0.1:9025/api/status| Request | |
|---|---|
GET /api/status | Version, uptime, listeners, queue sizes (Sovite.Core.Control.status/1) |
GET /api/queue | Queued messages; ?queue=deferred for one queue, ?limit=n (Sovite.Core.QueueInfo.list/2) |
GET /api/queue/ID | One message (Sovite.Core.QueueInfo.show/2) |
POST /api/queue/flush | Retry every deferred message |
POST /api/queue/ID/retry, hold, release, delete, requeue | See Sovite.Core.QueueManager |
GET /api/config | The running settings, secrets hidden (Sovite.Core.Config.Settings) |
POST /api/config/reload | Reload the config file |
GET /api/route?address=A&sender=S | How A is routed (Sovite.Core.RouteInfo) |
GET /api/trace?id=ID | A message's log lines (Sovite.Core.Trace), with [log] directory |
GET /api/cluster | The cluster's nodes and the copies of their queues (Sovite.Core.Cluster) |
POST /api/cluster/config | Send {"content": TOML} to every node as the shared configuration |
POST /api/cluster/join | Join the cluster of {"peer": "name@host:port"} |
POST /api/cluster/leave | Hand the queue to the other nodes, and leave the cluster |
GET /api/ip_pools | The IP pools: messages sent today from each address, and today's limits (Sovite.Core.IPPools) |
GET /metrics | Prometheus metrics (Sovite.Core.Metrics), with metrics.enabled |
Responses are JSON (/metrics is the Prometheus text format). Errors
are {"error": "..."} with 400, 401, 403, 404, 405, 409,
422, or 429.
Summary
Functions
Callback implementation for Plug.call/2.
Callback implementation for Plug.init/1.