INNER CODE UNIT · Python
list_events
bunkeriot/BunkerM · backend/app/agent-api/main.py:247
async def list_events(
since: str | None = None,
limit: int = 50,
x_api_key: str = Header(...),
):
_auth(x_api_key)
with _lock:
events = _load_events()
if since:
events = [e for e in events if e["fired_at"] > since]
return {"events": events[:limit]}
# ─── Watchers CRUD ────────────────────────────────────────────────────────────
class WatcherCreate(BaseModel):
description: str
topic: str