mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-20 12:22:23 -06:00
Expose BaseObjectType and NetBoxObjectType for plugins
This commit is contained in:
@@ -2,7 +2,7 @@ import graphene
|
||||
|
||||
from ipam import filtersets, models
|
||||
from netbox.graphql.scalars import BigInt
|
||||
from netbox.graphql.types import BaseObjectType, OrganizationalObjectType, PrimaryObjectType
|
||||
from netbox.graphql.types import BaseObjectType, OrganizationalObjectType, NetBoxObjectType
|
||||
|
||||
__all__ = (
|
||||
'ASNType',
|
||||
@@ -23,7 +23,7 @@ __all__ = (
|
||||
)
|
||||
|
||||
|
||||
class ASNType(PrimaryObjectType):
|
||||
class ASNType(NetBoxObjectType):
|
||||
asn = graphene.Field(BigInt)
|
||||
|
||||
class Meta:
|
||||
@@ -32,7 +32,7 @@ class ASNType(PrimaryObjectType):
|
||||
filterset_class = filtersets.ASNFilterSet
|
||||
|
||||
|
||||
class AggregateType(PrimaryObjectType):
|
||||
class AggregateType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.Aggregate
|
||||
@@ -40,7 +40,7 @@ class AggregateType(PrimaryObjectType):
|
||||
filterset_class = filtersets.AggregateFilterSet
|
||||
|
||||
|
||||
class FHRPGroupType(PrimaryObjectType):
|
||||
class FHRPGroupType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.FHRPGroup
|
||||
@@ -59,7 +59,7 @@ class FHRPGroupAssignmentType(BaseObjectType):
|
||||
filterset_class = filtersets.FHRPGroupAssignmentFilterSet
|
||||
|
||||
|
||||
class IPAddressType(PrimaryObjectType):
|
||||
class IPAddressType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.IPAddress
|
||||
@@ -70,7 +70,7 @@ class IPAddressType(PrimaryObjectType):
|
||||
return self.role or None
|
||||
|
||||
|
||||
class IPRangeType(PrimaryObjectType):
|
||||
class IPRangeType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.IPRange
|
||||
@@ -81,7 +81,7 @@ class IPRangeType(PrimaryObjectType):
|
||||
return self.role or None
|
||||
|
||||
|
||||
class PrefixType(PrimaryObjectType):
|
||||
class PrefixType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.Prefix
|
||||
@@ -105,7 +105,7 @@ class RoleType(OrganizationalObjectType):
|
||||
filterset_class = filtersets.RoleFilterSet
|
||||
|
||||
|
||||
class RouteTargetType(PrimaryObjectType):
|
||||
class RouteTargetType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.RouteTarget
|
||||
@@ -113,7 +113,7 @@ class RouteTargetType(PrimaryObjectType):
|
||||
filterset_class = filtersets.RouteTargetFilterSet
|
||||
|
||||
|
||||
class ServiceType(PrimaryObjectType):
|
||||
class ServiceType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.Service
|
||||
@@ -121,7 +121,7 @@ class ServiceType(PrimaryObjectType):
|
||||
filterset_class = filtersets.ServiceFilterSet
|
||||
|
||||
|
||||
class ServiceTemplateType(PrimaryObjectType):
|
||||
class ServiceTemplateType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.ServiceTemplate
|
||||
@@ -129,7 +129,7 @@ class ServiceTemplateType(PrimaryObjectType):
|
||||
filterset_class = filtersets.ServiceTemplateFilterSet
|
||||
|
||||
|
||||
class VLANType(PrimaryObjectType):
|
||||
class VLANType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.VLAN
|
||||
@@ -145,7 +145,7 @@ class VLANGroupType(OrganizationalObjectType):
|
||||
filterset_class = filtersets.VLANGroupFilterSet
|
||||
|
||||
|
||||
class VRFType(PrimaryObjectType):
|
||||
class VRFType(NetBoxObjectType):
|
||||
|
||||
class Meta:
|
||||
model = models.VRF
|
||||
|
||||
Reference in New Issue
Block a user