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

@@ -12,9 +12,18 @@ __all__ = [
'NestedImageAttachmentSerializer',
'NestedJobResultSerializer',
'NestedTagSerializer',
'NestedWebhookSerializer',
]
class NestedWebhookSerializer(WritableNestedSerializer):
url = serializers.HyperlinkedIdentityField(view_name='extras-api:webhook-detail')
class Meta:
model = models.Webhook
fields = ['id', 'url', 'name']
class NestedCustomFieldSerializer(WritableNestedSerializer):
url = serializers.HyperlinkedIdentityField(view_name='extras-api:customfield-detail')