s365b.core.events ================= .. py:module:: s365b.core.events .. autoapi-nested-parse:: Recording notification events. Anything admins should hear about is first written to the ``event`` table. Delivery (email via Graph or SMTP) happens later in a separate job, so a mail problem never fails a backup and every event is visible in the UI. Attributes ---------- .. autoapisummary:: s365b.core.events.JOB_FAILED s365b.core.events.JOB_WARNING s365b.core.events.JOB_STOPPED s365b.core.events.JOB_SUCCEEDED Functions --------- .. autoapisummary:: s365b.core.events.emit Module Contents --------------- .. py:data:: JOB_FAILED :value: 'job_failed' .. py:data:: JOB_WARNING :value: 'job_warning' .. py:data:: JOB_STOPPED :value: 'job_stopped' .. py:data:: JOB_SUCCEEDED :value: 'job_succeeded' .. py:function:: emit(session: sqlalchemy.ext.asyncio.AsyncSession, type_: str, severity: s365b.modules.sdk.Severity, subject: str, *, body: dict[str, Any] | None = None, dedup_key: str | None = None, run_fk: int | None = None) -> s365b.db.models.Event :async: Record an event for delivery. :param session: Open session; the caller commits. :param type_: Event type, e.g. ``job_failed``. :param severity: Severity. :param subject: One-line summary, used as the email subject. :param body: Structured details for the email template and UI. :param dedup_key: Events with the same key are throttled together (e.g. ``job_failed:3``). :param run_fk: Related job run. :returns: The new event row.