Files
checkbot/app/web/baseline_pages.py
patrickandClaude Sonnet 5.5 347f55cf7c
test / pytest (3.11) (push) Canceled after 0s
test / pytest (3.13) (push) Canceled after 0s
feat: Phase 6c baseline, ack, host alarms, outage notice, send limit, privacy mode, UI link
Includes atomic migrations, per-rule reminder semantics, first-run helper script
and the note on the undecided UI chat idea.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 03:06:23 +01:00

23 lines
800 B
Python

import asyncio
from fastapi import APIRouter, Depends, Request
from fastapi.responses import JSONResponse
from .. import audit
from ..users import User
from .alerting_section import BASELINE_PATH
from .deps import require_admin
router = APIRouter()
AUDIT_ACTION = "baseline.request"
MSG_REQUESTED = ("Baseline angefordert: Der nächste erfolgreiche Abruf zeichnet den Zustand still auf und "
"sendet eine Zusammenfassung.")
@router.post(BASELINE_PATH)
async def request_baseline(request: Request, admin: User = Depends(require_admin)):
await asyncio.to_thread(request.app.state.runtime.baseline.request)
await asyncio.to_thread(audit.record, request.app.state.db, admin.username, AUDIT_ACTION, "baseline")
return JSONResponse({"ok": True, "detail": MSG_REQUESTED})