[PR #14267] [MERGED] 14132 Add EventRule - change webhook and add in script processing to events #14360

Closed
opened 2025-12-29 23:24:02 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/14267
Author: @arthanson
Created: 11/14/2023
Status: Merged
Merged: 11/30/2023
Merged by: @jeremystretch

Base: featureHead: 14132-event-refactor-2


📝 Commits (10+)

  • ee913e1 14132 change_logging -> event_logging
  • 3b5c682 14132 event_logging -> event_wrapper
  • 4b3b88f 14132 webhooks_queue -> events_queue
  • 9148029 14132 flush_webhooks -> flush_events
  • 38d46af 14132 add models and forms
  • 498ac5e 14132 fixes
  • 1cc8a82 14132 model changes
  • e6f048b 14132 remove fields from Webhook model, consolidate migrations
  • 854b3ba 14132 cleanup tables and detail views
  • e0b10c9 14132 form cleanup

📊 Changes

55 files changed (+1564 additions, -584 deletions)

View changed files

📝 docs/configuration/required-parameters.md (+3 -6)
📝 docs/development/application-registry.md (+1 -1)
📝 docs/development/models.md (+14 -14)
📝 docs/features/api-integration.md (+2 -2)
docs/features/event-rules.md (+31 -0)
📝 docs/index.md (+1 -1)
📝 docs/integrations/webhooks.md (+4 -20)
docs/models/extras/eventrule.md (+35 -0)
📝 docs/plugins/development/models.md (+5 -2)
📝 mkdocs.yml (+2 -0)
📝 netbox/core/models/contenttypes.py (+1 -1)
📝 netbox/core/models/jobs.py (+14 -23)
📝 netbox/extras/api/nested_serializers.py (+27 -0)
📝 netbox/extras/api/serializers.py (+47 -11)
📝 netbox/extras/api/urls.py (+1 -0)
📝 netbox/extras/api/views.py (+11 -0)
📝 netbox/extras/choices.py (+15 -0)
📝 netbox/extras/context_managers.py (+8 -8)
netbox/extras/events.py (+178 -0)
📝 netbox/extras/filtersets.py (+38 -6)

...and 35 more files

📄 Description

Fixes: #14132

Adds a new EventRule class that splits the event processing of webhooks to a separate model and adds a configurable pipeilne that includes allowing scripts to run in response to events.

  • Added new EventRule class
  • Split out eventing code from webhook to EventRule class
  • Added in configurable pipeline for event processing
  • Added ability to run scripts for events
  • Refactored / renamed routines from webhook specific to event_rules
  • Added documentation for EventRule and modified Webhook documentation for EventRule

Monosnap Add a new event rule | NetBox 2023-11-17 10-34-48


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/14267 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 11/14/2023 **Status:** ✅ Merged **Merged:** 11/30/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `14132-event-refactor-2` --- ### 📝 Commits (10+) - [`ee913e1`](https://github.com/netbox-community/netbox/commit/ee913e1f91dc6981a87a0e1d5585fcafc8ba1cb8) 14132 change_logging -> event_logging - [`3b5c682`](https://github.com/netbox-community/netbox/commit/3b5c68251183e15c2eaf9e777577c57cc2829898) 14132 event_logging -> event_wrapper - [`4b3b88f`](https://github.com/netbox-community/netbox/commit/4b3b88f23d7dd950e40a72d526fef0b9efeae0eb) 14132 webhooks_queue -> events_queue - [`9148029`](https://github.com/netbox-community/netbox/commit/91480299ecbc26d49a7596d702605eeb972b40ac) 14132 flush_webhooks -> flush_events - [`38d46af`](https://github.com/netbox-community/netbox/commit/38d46afdbe84fe1c216c50ca78e9447e02dd0f84) 14132 add models and forms - [`498ac5e`](https://github.com/netbox-community/netbox/commit/498ac5e44f828b0205394f99dc743fcabfaeb736) 14132 fixes - [`1cc8a82`](https://github.com/netbox-community/netbox/commit/1cc8a82921e3cd578fd808fb8e9c45496c40ab94) 14132 model changes - [`e6f048b`](https://github.com/netbox-community/netbox/commit/e6f048b6390cbb80a10bab91894530829cb33f58) 14132 remove fields from Webhook model, consolidate migrations - [`854b3ba`](https://github.com/netbox-community/netbox/commit/854b3ba63218445899c8b9e24f9b236e06083905) 14132 cleanup tables and detail views - [`e0b10c9`](https://github.com/netbox-community/netbox/commit/e0b10c984b31c2f8c8210edcaa7b57ca99935816) 14132 form cleanup ### 📊 Changes **55 files changed** (+1564 additions, -584 deletions) <details> <summary>View changed files</summary> 📝 `docs/configuration/required-parameters.md` (+3 -6) 📝 `docs/development/application-registry.md` (+1 -1) 📝 `docs/development/models.md` (+14 -14) 📝 `docs/features/api-integration.md` (+2 -2) ➕ `docs/features/event-rules.md` (+31 -0) 📝 `docs/index.md` (+1 -1) 📝 `docs/integrations/webhooks.md` (+4 -20) ➕ `docs/models/extras/eventrule.md` (+35 -0) 📝 `docs/plugins/development/models.md` (+5 -2) 📝 `mkdocs.yml` (+2 -0) 📝 `netbox/core/models/contenttypes.py` (+1 -1) 📝 `netbox/core/models/jobs.py` (+14 -23) 📝 `netbox/extras/api/nested_serializers.py` (+27 -0) 📝 `netbox/extras/api/serializers.py` (+47 -11) 📝 `netbox/extras/api/urls.py` (+1 -0) 📝 `netbox/extras/api/views.py` (+11 -0) 📝 `netbox/extras/choices.py` (+15 -0) 📝 `netbox/extras/context_managers.py` (+8 -8) ➕ `netbox/extras/events.py` (+178 -0) 📝 `netbox/extras/filtersets.py` (+38 -6) _...and 35 more files_ </details> ### 📄 Description ### Fixes: #14132 Adds a new EventRule class that splits the event processing of webhooks to a separate model and adds a configurable pipeilne that includes allowing scripts to run in response to events. * Added new EventRule class * Split out eventing code from webhook to EventRule class * Added in configurable pipeline for event processing * Added ability to run scripts for events * Refactored / renamed routines from webhook specific to event_rules * Added documentation for EventRule and modified Webhook documentation for EventRule ![Monosnap Add a new event rule | NetBox 2023-11-17 10-34-48](https://github.com/netbox-community/netbox/assets/99642/44241697-a92a-4bef-b0f7-26758ccf7fff) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:24:02 +01:00
adam closed this issue 2025-12-29 23:24:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14360