mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-15 11:42:52 -06:00

* Initial work on #16886 * Restore GraphQL filter * Remove namespace * Add Event documentation * Use MultipleChoiceField for event_types * Fix event_types field class on EventRuleImportForm * Fix tests * Simplify event queue handling logic * Misc cleanup
548 B
548 B
Events
Plugins can register their own custom event types for use with NetBox event rules. This is accomplished by calling the register()
method on an instance of the Event
class. This can be done anywhere within the plugin. An example is provided below.
from django.utils.translation import gettext_lazy as _
from netbox.events import Event, EVENT_TYPE_SUCCESS
Event(
name='ticket_opened',
text=_('Ticket opened'),
type=EVENT_TYPE_SUCCESS
).register()
::: netbox.events.Event