Admin server subsystem for ReifyDB.
This crate provides an Axum-based HTTP server for web-based administration
of ReifyDB. It integrates with the shared tokio runtime and implements the
transaction ReifyDB Subsystem trait for lifecycle management.
Features
- REST API for configuration and metrics
- Authentication support (optional)
- Static file serving for admin UI
- Health check endpoint
- Graceful shutdown support
Endpoints
GET /health- Health checkPOST /v1/auth/login- LoginPOST /v1/auth/logout- LogoutGET /v1/auth/status- Auth statusGET /v1/config- Get configurationPUT /v1/config- Update configurationPOST /v1/execute- Execute queryGET /v1/metrics- System metricsGET /- Admin UI
Example
use reifydb_core::SharedRuntime;
use reifydb_sub_server_admin::{AdminConfig, AdminSubsystem, AdminState};
// Create shared runtime
let runtime = SharedRuntime::new(4);
// Create application state
let state = AdminState::new(engine, 1000, Duration::from_secs(30), false, None);
// Create and start admin subsystem
let mut admin = AdminSubsystem::with_runtime(
"127.0.0.1:9090".to_string(),
state,
Arc::new(runtime),
);
admin.start()?;