-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Event Rule Action Data passed to Script #14884
Comments
I don't think we have a mechanism in place within a script right now to accept this data. Could you please expand your proposal above to specify exactly how a script would receive this data, in addition to the form data it currently accepts? |
In the current implementation the EventRule passes a serialized version of the instance as data to the script., so it isn't possible to pass any input to the Script using the EventRule. |
In run_script data is passed as a dict where the keys are the Script Input, but when the Job is schedules in process_event_rules it passed as built in enqueue_object, (the serialized model) and that way it ain't gonna pass the expected dict to the Script since its expecting a dict with keys as the Script Inputs. |
I think I get what this is saying. Basically, you can define your data template for what is passed to a script. This is originally what I thought "action data" wass for. |
@DanSheps I thougt that it was the purpose of "action data" too. |
I've assigned this to @renatoalmeidaoliveira with the understanding that its scope is limited to passing the |
@renatoalmeidaoliveira are you still planning to work on this? |
@jeremystretch yes, I've talked with @arthanson in slack and waiting for some guidance to move on |
From the Script Developer point of view I think that Action Data should be passed to the Script the same way as the Input Form and REST API. |
@renatoalmeidaoliveira I notice your PR got robo-closed. Do you anticipate having time to work on it soon, or should I let it go? |
I'd like to see that feature, too. |
@jeffgdotorg I think we need to discuss a bit more about that PR, because the maintainer team wants the sent the data field as is without Jinja2 processing but IMO that isn't very usefull for the end user since if he wanna a static field he could just hard code in the Script. |
NetBox version
v3.7.0
Feature type
Change to existing functionality
Proposed functionality
Currently EventRules passes a serialized version of the model as data to the linked Script, I think it would be better if the Action Data was processed like the Body Template of Webhoocks and passed to the Script.
Use case
It would allow users to build Script to react NetBox changes with the change context, currently the user cannot get directly the changelog. And by passing a parsed data with Event Data gives the plugin developer a lot of flexibility to build automations
Database changes
None
External dependencies
None
The text was updated successfully, but these errors were encountered: