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

Closes #1556: Added API endpoints listing static field choices for each app

This commit is contained in:
Jeremy Stretch
2017-10-10 16:41:35 -04:00
parent afbbe1148f
commit f824d1eb3b
15 changed files with 187 additions and 8 deletions

View File

@@ -12,10 +12,24 @@ from django.shortcuts import get_object_or_404
from ipam.models import Aggregate, IPAddress, Prefix, RIR, Role, Service, VLAN, VLANGroup, VRF
from ipam import filters
from extras.api.views import CustomFieldModelViewSet
from utilities.api import WritableSerializerMixin
from utilities.api import FieldChoicesViewSet, WritableSerializerMixin
from . import serializers
#
# Field choices
#
class IPAMFieldChoicesViewSet(FieldChoicesViewSet):
fields = (
(Aggregate, ['family']),
(Prefix, ['family', 'status']),
(IPAddress, ['family', 'status', 'role']),
(VLAN, ['status']),
(Service, ['protocol']),
)
#
# VRFs
#