Enable plugins to register custom event types #9974

Closed
opened 2025-12-29 21:25:06 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jul 11, 2024).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v4.0.7

Feature type

New functionality

Proposed functionality

Event rules can be defined to automatically take a certain action (i.e. execute a custom script or generate an outbound webhook) in response to particular events in NetBox. Five event types are currently defined:

  • Object created
  • Object updated
  • Object deleted
  • Job started
  • Job completed

This FR proposes enabling NetBox plugin to register their own custom event types, and extending the EventRule model to allow association with these dynamically-registered types.

Some of the initial work toward this functionality has already been completed under #15621.

Use case

As an example, a plugin which tracks network device configurations might introduce a "Configuration changed" event. More generally, this change will also allow more flexibility in defining new event types internally.

Database changes

The set of boolean type_* fields which currently exist on the EventRule model will likely need to be changed to an array of event type names (to accommodate unknown future event types).

External dependencies

None

Originally created by @jeremystretch on GitHub (Jul 11, 2024). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v4.0.7 ### Feature type New functionality ### Proposed functionality Event rules can be defined to automatically take a certain action (i.e. execute a custom script or generate an outbound webhook) in response to particular events in NetBox. Five event types are currently defined: - Object created - Object updated - Object deleted - Job started - Job completed This FR proposes enabling NetBox plugin to register their own custom event types, and extending the EventRule model to allow association with these dynamically-registered types. Some of the initial work toward this functionality has already been completed under #15621. ### Use case As an example, a plugin which tracks network device configurations might introduce a "Configuration changed" event. More generally, this change will also allow more flexibility in defining new event types internally. ### Database changes The set of boolean `type_*` fields which currently exist on the EventRule model will likely need to be changed to an array of event type names (to accommodate unknown future event types). ### External dependencies None
adam closed this issue 2025-12-29 21:25:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9974