Add target owners and alert notification management.
All checks were successful
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 6s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 6s
All checks were successful
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 6s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 6s
This commit implements the addition of `target_owners` and `alert_notification_events` tables, enabling management of responsible users for targets. Backend and frontend components are updated to allow viewing, assigning, and notifying target owners about critical alerts via email.
This commit is contained in:
@@ -20,6 +20,7 @@ from app.services.alerts import (
|
||||
validate_alert_sql,
|
||||
validate_alert_thresholds,
|
||||
)
|
||||
from app.services.alert_notifications import process_target_owner_notifications
|
||||
from app.services.audit import write_audit_log
|
||||
|
||||
router = APIRouter()
|
||||
@@ -38,7 +39,9 @@ async def list_alert_status(
|
||||
user: User = Depends(get_current_user), db: AsyncSession = Depends(get_db)
|
||||
) -> AlertStatusResponse:
|
||||
_ = user
|
||||
return await get_alert_status(db, use_cache=True)
|
||||
payload = await get_alert_status(db, use_cache=True)
|
||||
await process_target_owner_notifications(db, payload)
|
||||
return payload
|
||||
|
||||
|
||||
@router.get("/definitions", response_model=list[AlertDefinitionOut])
|
||||
|
||||
Reference in New Issue
Block a user