Skip to content

Enable plugins to register custom event types #16886

@jeremystretch

Description

@jeremystretch

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

Metadata

Metadata

Assignees

Labels

complexity: mediumRequires a substantial but not unusual amount of effort to implementstatus: acceptedThis issue has been accepted for implementationtopic: event rulesFor issues related to the Event Rules featuretopic: pluginsRelates to the plugins frameworktype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions