Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable plugins to register custom event types #16886

Closed
jeremystretch opened this issue Jul 11, 2024 · 0 comments
Closed

Enable plugins to register custom event types #16886

jeremystretch opened this issue Jul 11, 2024 · 0 comments
Assignees
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement status: accepted This issue has been accepted for implementation topic: plugins Relates to the plugins framework type: feature Introduction of new functionality to the application
Milestone

Comments

@jeremystretch
Copy link
Member

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

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application complexity: medium Requires a substantial but not unusual amount of effort to implement labels Jul 11, 2024
@jeremystretch jeremystretch added this to the v4.1 milestone Jul 11, 2024
@jeremystretch jeremystretch self-assigned this Jul 11, 2024
@jeremystretch jeremystretch added the topic: plugins Relates to the plugins framework label Jul 11, 2024
jeremystretch added a commit that referenced this issue Jul 18, 2024
jeremystretch added a commit that referenced this issue Jul 22, 2024
* 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
jeremystretch added a commit that referenced this issue Jul 31, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement status: accepted This issue has been accepted for implementation topic: plugins Relates to the plugins framework type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

1 participant