Sovite.Core.Web.API (sovite v0.6.0)

Copy Markdown View Source

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/statusVersion, uptime, listeners, queue sizes (Sovite.Core.Control.status/1)
GET /api/queueQueued messages; ?queue=deferred for one queue, ?limit=n (Sovite.Core.QueueInfo.list/2)
GET /api/queue/IDOne message (Sovite.Core.QueueInfo.show/2)
POST /api/queue/flushRetry every deferred message
POST /api/queue/ID/retry, hold, release, delete, requeueSee Sovite.Core.QueueManager
GET /api/configThe running settings, secrets hidden (Sovite.Core.Config.Settings)
POST /api/config/reloadReload the config file
GET /api/route?address=A&sender=SHow A is routed (Sovite.Core.RouteInfo)
GET /api/trace?id=IDA message's log lines (Sovite.Core.Trace), with [log] directory
GET /api/clusterThe cluster's nodes and the copies of their queues (Sovite.Core.Cluster)
POST /api/cluster/configSend {"content": TOML} to every node as the shared configuration
POST /api/cluster/joinJoin the cluster of {"peer": "name@host:port"}
POST /api/cluster/leaveHand the queue to the other nodes, and leave the cluster
GET /api/ip_poolsThe IP pools: messages sent today from each address, and today's limits (Sovite.Core.IPPools)
GET /metricsPrometheus 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.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.