added multi node functionality
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from fastapi import APIRouter
|
||||
from app.services import alertmanager
|
||||
from app.services import alertmanager, cluster_inventory
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -8,4 +8,9 @@ router = APIRouter()
|
||||
async def get_alerts():
|
||||
alerts = await alertmanager.get_alerts()
|
||||
critical = sum(1 for a in alerts if a.get("severity") == "critical")
|
||||
return {"alerts": alerts, "total": len(alerts), "critical": critical}
|
||||
return {
|
||||
"alerts": alerts,
|
||||
"total": len(alerts),
|
||||
"critical": critical,
|
||||
"cluster": await cluster_inventory.get_cluster_inventory(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user