Closed
Description
NetBox version
v3.7.2
Feature type
New functionality
Proposed functionality
3.7.0 introduced the events pipeline described in #14132
This involves making an entry in EVENTS_PIPELINE=[]
within configuration.py
, it would be more ergonomic if plugins could register for events by declaring intent within their configuration.
For example:
from netbox.plugins import PluginConfig
class FooBarConfig(PluginConfig):
name = 'foo_bar'
verbose_name = 'Foo Bar'
description = 'An example NetBox plugin'
version = '0.1'
author = 'Jeremy Stretch'
author_email = 'author@example.com'
base_url = 'foo-bar'
required_settings = []
default_settings = {
'baz': True
}
events_pipeline_registrations = [
"foobar.mymodule.custom_event_handler"
]
django_apps = ["foo", "bar", "baz"]
config = FooBarConfig
events_pipeline_registrations
would be optional to allow for backwards compatibility and default to []
It would allow plugins which require access to the events pipeline to have entries added into EVENTS_PIPELINE
automatically. This reduces complexity on those installing Netbox plugins which need events access.
https://linear.app/netboxlabs/issue/BIZ-6/
Use case
Simplify access to the events pipeline for plugins, reduce configuration complexity.
Database changes
No response
External dependencies
No response