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

#6732 - GraphQL support

This commit is contained in:
Daniel Sheppard
2021-10-27 23:06:09 -05:00
parent 8235b339ee
commit 0ad440fea5
2 changed files with 12 additions and 0 deletions

View File

@ -5,6 +5,9 @@ from .types import *
class IPAMQuery(graphene.ObjectType):
asn = ObjectField(ASNType)
asn_list = ObjectListField(ASNType)
aggregate = ObjectField(AggregateType)
aggregate_list = ObjectListField(AggregateType)

View File

@ -2,6 +2,7 @@ from ipam import filtersets, models
from netbox.graphql.types import OrganizationalObjectType, PrimaryObjectType
__all__ = (
'ASNType',
'AggregateType',
'IPAddressType',
'IPRangeType',
@ -16,6 +17,14 @@ __all__ = (
)
class ASNType(PrimaryObjectType):
class Meta:
model = models.ASN
fields = '__all__'
filterset_class = filtersets.ASNFilterSet
class AggregateType(PrimaryObjectType):
class Meta: