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

Provide the ability to execute custom scripts in response to object changes #11827

Closed
jeremystretch opened this issue Feb 24, 2023 · 2 comments
Closed
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@jeremystretch
Copy link
Member

NetBox version

v3.4.5

Feature type

New functionality

Proposed functionality

Establish a mechanism by which a custom script can "attach" to one or more signals, so that the script automatically runs when the signal is received. This will likely need to be done programmatically as scripts are discovered. It should be possible to associate a script with a particular arbitrary signal and optionally only to certain senders for that signal.

We'll need to devise a way to automatically discover scripts, as scripts are currently only loaded as needed (e.g. in response to UI/API requests). Special consideration must also be paid to the execution workflow, to ensure that a catastrophic script error does not interfere with the triggering behavior.

For registration, it may be sufficient to call get_scripts() upon NetBox initialization, and execute a prescribed class method on each discovered script to handle its signal attachment. We'll also need to devise a convention for declaring receiver methods on each script.

Use case

Often it is desirable to automatically execute a custom script in response to the creation, modification, or deletion of a NetBox object (similar to how webhooks function).

Database changes

No response

External dependencies

No response

@jeremystretch jeremystretch added type: feature Introduction of new functionality to the application status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Feb 24, 2023
@PieterL75
Copy link
Contributor

I use webhooks for this, pointing to itself 😃
But a native way to call a script would be great! (No more apikey issues after migrating db to my dev server)

@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels May 4, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Oct 13, 2023
@jeremystretch jeremystretch added this to the v3.7 milestone Oct 13, 2023
@arthanson arthanson self-assigned this Oct 23, 2023
@arthanson
Copy link
Collaborator

Closing this issue as it is supplanted by the more general-purpose FR #14132

@jeremystretch jeremystretch removed this from the v3.7 milestone Oct 30, 2023
@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants