🔐 Camera Management API v2.1

Complete REST API with HTTP Basic Authentication

🔒 Authentication Required
All endpoints (except / and /health) require HTTP Basic Authentication.
Include credentials in your requests: username:password

📡 Dashboard & Capacity Endpoints

GET /api/dashboard 🔒 AUTH REQUIRED

Get complete camera dashboard with online/offline counts

curl -u admin:password http://localhost:8000/api/dashboard
GET /api/users/{username}/cameras 🔒 AUTH REQUIRED

Get camera statistics for specific user

curl -u admin:password http://localhost:8000/api/users/salwan/cameras
GET /api/capacity 🔒 AUTH REQUIRED

Get current server capacity status

GET /api/alerts 🔒 AUTH REQUIRED

Get capacity alert history

GET /api/servers/{server_id}/cameras 🔒 AUTH REQUIRED

Get cameras running on specific server

📹 Camera Status Endpoints

GET /api/cameras/status 🔒 AUTH REQUIRED

Get camera status summary (online/offline/initializing counts)

GET /api/cameras/offline 🔒 AUTH REQUIRED

Get detailed list of offline cameras with reasons

🎥 FPS Endpoints

GET /api/fps/camera/{internal_camera_id} 🔒 AUTH REQUIRED

Get current FPS for camera by internal_camera_id (includes restart count)

GET /api/fps/all 🔒 AUTH REQUIRED

Get current FPS for all cameras

GET /api/cameras/high-restarts?min_count=N 🔒 AUTH REQUIRED

Get cameras with restart count >= N (e.g., ?min_count=2)

🏥 Public Endpoints (No Auth)

GET /health

Check API and database health (public)

📖 Documentation

Visit /docs for interactive Swagger UI (requires auth)

🔑 How to Authenticate

From Browser: Login popup will appear automatically

From curl: curl -u username:password URL

From Python: requests.get(url, auth=('username', 'password'))

From JavaScript: Use Authorization header with base64 encoded credentials