s365b.core.events

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

Functions

emit(session, type_, severity, subject, *[, body, ...]) → s365b.db.models.Event

Record an event for delivery.

Module Contents

s365b.core.events.JOB_FAILED = 'job_failed'[source]
s365b.core.events.JOB_WARNING = 'job_warning'[source]
s365b.core.events.JOB_STOPPED = 'job_stopped'[source]
s365b.core.events.JOB_SUCCEEDED = 'job_succeeded'[source]
async s365b.core.events.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[source]

Record an event for delivery.

Parameters:
  • session – Open session; the caller commits.

  • type – Event type, e.g. job_failed.

  • severity – Severity.

  • subject – One-line summary, used as the email subject.

  • body – Structured details for the email template and UI.

  • dedup_key – Events with the same key are throttled together (e.g. job_failed:3).

  • run_fk – Related job run.

Returns:

The new event row.