Files
p5g-marvis/app/routers/actions.py
2026-04-23 13:50:31 -05:00

17 lines
482 B
Python

from fastapi import APIRouter
from app.services import log_analyzer
router = APIRouter()
@router.get("/actions")
async def get_actions():
"""Return current action analysis: categorised issues from logs + Prometheus + Alertmanager."""
return await log_analyzer.analyze_logs()
@router.get("/actions/history")
async def get_actions_history():
"""Return the in-memory history ring-buffer for the time-series chart."""
return {"history": log_analyzer.get_history()}