Initial work on IP ranges

This commit is contained in:
jeremystretch
2021-07-16 09:15:19 -04:00
parent 337f95e269
commit 11a14927c9
24 changed files with 994 additions and 20 deletions

View File

@@ -11,6 +11,9 @@ class IPAMQuery(graphene.ObjectType):
ip_address = ObjectField(IPAddressType)
ip_address_list = ObjectListField(IPAddressType)
ip_range = ObjectField(IPRangeType)
ip_range_list = ObjectListField(IPRangeType)
prefix = ObjectField(PrefixType)
prefix_list = ObjectListField(PrefixType)

View File

@@ -4,6 +4,7 @@ from netbox.graphql.types import ObjectType, TaggedObjectType
__all__ = (
'AggregateType',
'IPAddressType',
'IPRangeType',
'PrefixType',
'RIRType',
'RoleType',
@@ -34,6 +35,17 @@ class IPAddressType(TaggedObjectType):
return self.role or None
class IPRangeType(TaggedObjectType):
class Meta:
model = models.IPRange
fields = '__all__'
filterset_class = filtersets.IPRangeFilterSet
def resolve_role(self, info):
return self.role or None
class PrefixType(TaggedObjectType):
class Meta: