feat(schema): add Alert -> enodia.event.v1 reference wrapper

This commit is contained in:
Luna 2026-07-10 04:44:07 -07:00
parent 54bd8ff1f4
commit 65f5be6420
3 changed files with 22 additions and 0 deletions

View file

@ -44,3 +44,8 @@ def build_event(
"host": host,
event_type: payload,
}
def from_alert(alert, *, host: str | None = None, timestamp: str | None = None) -> dict:
"""Wrap an ``Alert`` (via its ``to_dict()``) in an ``alert`` event envelope."""
return build_event("alert", alert.to_dict(), host=host, timestamp=timestamp)