1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #5610: Add REST API endpoint for webhooks

This commit is contained in:
Jeremy Stretch
2021-03-09 09:22:58 -05:00
parent 38ded66c4e
commit 6ffadb501b
9 changed files with 233 additions and 11 deletions

View File

@@ -21,6 +21,19 @@ from utilities.querysets import RestrictedQuerySet
from utilities.utils import deepmerge, render_jinja2
__all__ = (
'ConfigContext',
'ConfigContextModel',
'CustomLink',
'ExportTemplate',
'ImageAttachment',
'JobResult',
'Report',
'Script',
'Webhook',
)
#
# Webhooks
#
@@ -109,6 +122,8 @@ class Webhook(BigIDModel):
'Leave blank to use the system defaults.'
)
objects = RestrictedQuerySet.as_manager()
class Meta:
ordering = ('name',)
unique_together = ('payload_url', 'type_create', 'type_update', 'type_delete',)