-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Enable webhooks for JobResults #8958
Comments
I tried just adding |
Looking into this more, I guess JobResults would be to be changed to inherit from ChangeLoggedModel. Not sure how feasible that is or if it just works out of the box. The migration would make it a significant change I guess. |
We can enable webhooks for the model separately, without having to inherit the other stuff ChangeLoggedModel provides. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary. |
@kkthxbye-code would we want to evaluate webhook on every call to |
@jeremystretch - The original issue we were having, was that we had to poll to check for script completion when triggering scripts from external systems. So only triggering for terminal statuses would probably be fine for that use-case. However I don't think it should be an issue doing it on all saves, unless JobResults are saved multiple times during execution? A normal script run would be Pending -> Running -> Completed right? |
Right, what I mean is that each change to a job's status has to be written to the database (although it might not actually call |
I suppose for the initial implementation at least we can enable webhooks for all statuses, and then constrain to only terminal statuses if needed. |
I ended up introducing two new event types, |
NetBox version
v3.1.9
Feature type
Change to existing functionality
Proposed functionality
Add the @extra_features('webhooks') to the JobResult model.
Use case
When triggering Netbox scripts via. the API it would be useful to be able to send a webhook when the status changes. This would prevent the need for polling the API for scripts with longer runtime.
Database changes
None
External dependencies
No response
The text was updated successfully, but these errors were encountered: