Liking cljdoc? Tell your friends :D

lb.admin

Public API for Admin HTTP REST server.

This module provides a RESTful HTTP API for runtime management of the load balancer, enabling automation, scripting, and integration with orchestration tools without requiring REPL access.

Configuration:

{:settings
 {:admin-api {:enabled true
              :port 8081              ; HTTP port (default 8081)
              :api-key "secret-key"  ; Optional API key auth
              :allowed-origins nil}}} ; Optional CORS origins

Example usage:

# Get status
curl http://localhost:8081/api/v1/status

# List proxies
curl http://localhost:8081/api/v1/proxies

# Add a proxy
curl -X POST http://localhost:8081/api/v1/proxies \
  -H 'Content-Type: application/json' \
  -d '{"name":"web","listen":{"interfaces":["eth0"],"port":80}}'

# With API key authentication
curl -H 'X-API-Key: secret-key' http://localhost:8081/api/v1/status
Public API for Admin HTTP REST server.

This module provides a RESTful HTTP API for runtime management of the
load balancer, enabling automation, scripting, and integration with
orchestration tools without requiring REPL access.

Configuration:
```clojure
{:settings
 {:admin-api {:enabled true
              :port 8081              ; HTTP port (default 8081)
              :api-key "secret-key"  ; Optional API key auth
              :allowed-origins nil}}} ; Optional CORS origins
```

Example usage:
```bash
# Get status
curl http://localhost:8081/api/v1/status

# List proxies
curl http://localhost:8081/api/v1/proxies

# Add a proxy
curl -X POST http://localhost:8081/api/v1/proxies \
  -H 'Content-Type: application/json' \
  -d '{"name":"web","listen":{"interfaces":["eth0"],"port":80}}'

# With API key authentication
curl -H 'X-API-Key: secret-key' http://localhost:8081/api/v1/status
```
raw docstring

get-statusclj

(get-status)

Get admin server status.

Returns nil if not running, or map with: :running - true :port - Port number :auth-enabled - Whether API key auth is enabled :cors-enabled - Whether CORS is enabled :base-url - Base URL for API requests

Get admin server status.

Returns nil if not running, or map with:
  :running - true
  :port - Port number
  :auth-enabled - Whether API key auth is enabled
  :cors-enabled - Whether CORS is enabled
  :base-url - Base URL for API requests
sourceraw docstring

running?clj

(running?)

Check if admin server is running.

Check if admin server is running.
sourceraw docstring

start!clj

(start! config)

Start the admin HTTP server.

config is an AdminApiConfig record or map with: :enabled - Whether to start the server :port - Port to listen on (default 8081) :api-key - Optional API key for authentication :allowed-origins - Optional list of CORS allowed origins

Returns true if started successfully, false otherwise.

Start the admin HTTP server.

config is an AdminApiConfig record or map with:
  :enabled - Whether to start the server
  :port - Port to listen on (default 8081)
  :api-key - Optional API key for authentication
  :allowed-origins - Optional list of CORS allowed origins

Returns true if started successfully, false otherwise.
sourceraw docstring

stop!clj

(stop!)

Stop the admin HTTP server.

Returns true if stopped successfully, false if not running.

Stop the admin HTTP server.

Returns true if stopped successfully, false if not running.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close