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

9856 type updates

This commit is contained in:
Arthur
2024-02-22 16:35:24 -08:00
parent 3c24cf97b6
commit d4812b28fd
8 changed files with 130 additions and 18 deletions

View File

@ -1,3 +1,5 @@
from typing import Annotated, List
import strawberry
import strawberry_django
@ -24,7 +26,18 @@ __all__ = (
filters=ClusterFilter
)
class ClusterType(VLANGroupsMixin, NetBoxObjectType):
pass
@strawberry_django.field
def virtual_machines(self) -> List[Annotated["VirtualMachineType", strawberry.lazy('virtualization.graphql.types')]]:
return self.virtual_machines.all()
@strawberry_django.field
def vlan_groups(self) -> List[Annotated["VLANGroupType", strawberry.lazy('ipam.graphql.types')]]:
return self.vlan_groups.all()
@strawberry_django.field
def devices(self) -> List[Annotated["DeviceType", strawberry.lazy('dcim.graphql.types')]]:
return self.devices.all()
@strawberry_django.type(
@ -33,7 +46,14 @@ class ClusterType(VLANGroupsMixin, NetBoxObjectType):
filters=ClusterGroupFilter
)
class ClusterGroupType(VLANGroupsMixin, OrganizationalObjectType):
pass
@strawberry_django.field
def vlan_groups(self) -> List[Annotated["VLANGroupType", strawberry.lazy('ipam.graphql.types')]]:
return self.vlan_groups.all()
@strawberry_django.field
def clusters(self) -> List[Annotated["ClusterType", strawberry.lazy('virtualization.graphql.types')]]:
return self.clusters.all()
@strawberry_django.type(
@ -42,7 +62,10 @@ class ClusterGroupType(VLANGroupsMixin, OrganizationalObjectType):
filters=ClusterTypeFilter
)
class ClusterTypeType(OrganizationalObjectType):
pass
@strawberry_django.field
def clusters(self) -> List[ClusterType]:
return self.clusters.all()
@strawberry_django.type(