Documentation Index
Fetch the complete documentation index at: https://docs.ultrabalancer.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Secure API for managing backends without restart.
Authentication
Add X-API-Key header when API key is configured:
curl -H "X-API-Key: YOUR_KEY" http://localhost:8080/admin/backends
Endpoints
| Method | Endpoint | Description |
|---|
| GET | /admin/backends | List all backends |
| POST | /admin/backends | Add backend |
| DELETE | /admin/backends | Remove backend |
| PUT | /admin/backends/weight | Update weight |
| POST | /admin/backends/drain | Start draining |
| POST | /admin/backends/undrain | Stop draining |
| GET | /admin/health | API health check |
Examples
# List backends
curl -H "X-API-Key: YOUR_KEY" http://localhost:8080/admin/backends
# Add backend
curl -X POST -H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"address":"10.0.0.5:8080","weight":100}' \
http://localhost:8080/admin/backends
# Update weight
curl -X PUT -H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"address":"10.0.0.5:8080","weight":150}' \
http://localhost:8080/admin/backends/weight
# Drain for maintenance
curl -X POST -H "X-API-Key: YOUR_KEY" \
-d '{"address":"10.0.0.5:8080"}' \
http://localhost:8080/admin/backends/drain
{
"success": true,
"message": "Backends listed",
"data": [
{
"address": "10.0.0.1:8080",
"weight": 100,
"healthy": true,
"active_connections": 5,
"total_requests": 1234
}
]
}
Error Response
{
"success": false,
"message": "Backend not found"
}