Skip to content

Notification types

The functions of connectors.notifications.catalogue, taken from their docstrings.

connectors.notifications.catalogue

What every notification says on every channel, and which parts of it a superuser can choose.

Field dataclass

One line of a message. A channel the field has no line for does not show it.

Layout dataclass

Message of one channel: head, then one line per selected field, then tail. TheHive also has a title.

EmailSpec dataclass

Subject of the email (a format string) and a function that builds the sample body with the existing template.

stamp()

The time shown under the headline of a Slack or Citadel message (server time), e.g. 27 Nov 16:42.

render_text(ntype, channel, ctx, selected=None)

Message of a type on a text channel. selected are the field ids to show (None: every field).

render_title(ntype, ctx)

Title of the TheHive alert, from the catalogue layout.

register(*types)

Add notification types to the catalogue.

find_type(type_id)

The notification type of this id, or None.

get_type(type_id)

The notification type of this id. KeyError: unknown notification.

all_types()

Every notification type, in the order they were registered.