Skip to content

Plugin events pipeline registration #15093

Closed
@natm

Description

@natm

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

Metadata

Metadata

Assignees

Labels

complexity: mediumRequires a substantial but not unusual amount of effort to implementstatus: acceptedThis issue has been accepted for implementationtopic: 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