Webhook - (En/Dis)able hook based on action "location" (Frontend vs API) #1776

Closed
opened 2025-12-29 17:19:01 +01:00 by adam · 3 comments
Owner

Originally created by @DanSheps on GitHub (Jun 6, 2018).

Issue type

[X ] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.4
  • NetBox version: 2.4-dev

Description

Looking at the webhooks implementation, it appears that it will fire on either a web or api call.

It would be a nice feature to be able to action on only one or the other.

As discussed in slack, this would require a workaround for the Django signals functionality not carrying context. (https://networktocode.slack.com/archives/C3DQ6MZ0Q/p1528320359000565)

Originally created by @DanSheps on GitHub (Jun 6, 2018). ### Issue type [X ] Feature request [ ] Bug report [ ] Documentation ### Environment * Python version: 3.4 * NetBox version: 2.4-dev ### Description Looking at the webhooks implementation, it appears that it will fire on either a web or api call. It would be a nice feature to be able to action on only one or the other. As discussed in slack, this would require a workaround for the Django signals functionality not carrying context. (https://networktocode.slack.com/archives/C3DQ6MZ0Q/p1528320359000565)
adam closed this issue 2025-12-29 17:19:01 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 18, 2018):

Can you provide a use case for this? Typically I'd think you'd want to know about the change regardless of the interface via which it was executed.

(FYI: The NetworkToCode Slack only retains history for a couple days.)

@jeremystretch commented on GitHub (Jul 18, 2018): Can you provide a use case for this? Typically I'd think you'd want to know about the change regardless of the interface via which it was executed. (FYI: The NetworkToCode Slack only retains history for a couple days.)
Author
Owner

@jeremystretch commented on GitHub (Jul 31, 2018):

Closing due to lack of activity.

@jeremystretch commented on GitHub (Jul 31, 2018): Closing due to lack of activity.
Author
Owner

@DanSheps commented on GitHub (Aug 7, 2018):

Sorry, I completely missed this.

I could see a couple use cases where you may want to enable/disable based on what you are doing:

  • Importing data or updating into netbox through the API with something like Ansible, where you might have the GUI portion firing off webhooks to do stuff in ansible or similar
  • Updates on the front-end (import, add, edit, whatever), fires a webhook which does stuff which then writes back to the API (this could fire off the webhook again)
@DanSheps commented on GitHub (Aug 7, 2018): Sorry, I completely missed this. I could see a couple use cases where you may want to enable/disable based on what you are doing: * Importing data or updating into netbox through the API with something like Ansible, where you might have the GUI portion firing off webhooks to do stuff in ansible or similar * Updates on the front-end (import, add, edit, whatever), fires a webhook which does stuff which then writes back to the API (this could fire off the webhook again)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1776