HAProxy Plugin¶
Overview¶
HAProxy is a high-availability load balancer for TCP and HTTP applications. StarkOne manages HAProxy configuration, SSL certificates, and provides stats.
Plugin ID: haproxy
Service Control¶
GET /api/haproxy/status
POST /api/haproxy/install
POST /api/haproxy/uninstall
POST /api/haproxy/start
POST /api/haproxy/stop
POST /api/haproxy/reload
Frontends¶
GET /api/haproxy/frontends
POST /api/haproxy/frontends
{
"name": "http-in",
"bind": "*:80",
"default_backend": "webservers",
"mode": "http"
}
PUT /api/haproxy/frontends/:name
DELETE /api/haproxy/frontends/:name
Backends¶
GET /api/haproxy/backends
POST /api/haproxy/backends
{
"name": "webservers",
"mode": "http",
"balance": "roundrobin",
"check_interval": 2000
}
DELETE /api/haproxy/backends/:name
POST /api/haproxy/backends/duplicate
Backend Servers¶
POST /api/haproxy/backends/:name/servers
{
"name": "web1",
"address": "10.0.0.1",
"port": 80,
"weight": 1,
"check": true
}
PUT /api/haproxy/backends/:name/servers/:server
DELETE /api/haproxy/backends/:name/servers/:server
Stats¶
Returns HAProxy stats page in JSON format.
Raw Config¶
Backups¶
GET /api/haproxy/backups
POST /api/haproxy/backups
POST /api/haproxy/backups/auto
{ "enabled": true, "keep": 7 }
POST /api/haproxy/backups/:name/restore
DELETE /api/haproxy/backups/:name
SSL Certificates¶
GET /api/haproxy/certificates
POST /api/haproxy/certificates
{
"domain": "example.com",
"email": "[email protected]"
}
DELETE /api/haproxy/certificates/:domain