41 lines
968 B
Python
41 lines
968 B
Python
"""API adapter for GitOps operations dashboard."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
try:
|
|
from fastapi import APIRouter
|
|
except Exception:
|
|
APIRouter = None
|
|
|
|
from .gitops_ops_operating_audit_dashboard import GitOpsOpsOperatingAuditDashboard
|
|
|
|
|
|
dashboard = GitOpsOpsOperatingAuditDashboard()
|
|
|
|
|
|
def get_gitops_ops_dashboard(
|
|
baseline: dict[str, Any] | None = None,
|
|
runtime: dict[str, Any] | None = None,
|
|
audit_report: dict[str, Any] | None = None,
|
|
) -> dict[str, Any]:
|
|
return dashboard.overview(baseline, runtime, audit_report)
|
|
|
|
|
|
def build_router():
|
|
if APIRouter is None:
|
|
return None
|
|
router = APIRouter(prefix="/admin/ai-evolution/gitops", tags=["gitops-dashboard"])
|
|
|
|
@router.get("/overview", operation_id="getGitOpsOpsOperatingAuditDashboard")
|
|
def overview():
|
|
return get_gitops_ops_dashboard()
|
|
|
|
return router
|
|
|
|
|
|
router = build_router()
|
|
|
|
__all__ = ["router", "get_gitops_ops_dashboard"]
|