mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 12:06:53 -06:00
Add GraphQL typing
This commit is contained in:
parent
18becdd0b5
commit
ae7c67a1d6
@ -384,6 +384,7 @@ class InterfaceType(IPAddressesMixin, ModularComponentType, CabledObjectMixin, P
|
||||
wireless_link: Annotated["WirelessLinkType", strawberry.lazy('wireless.graphql.types')] | None
|
||||
untagged_vlan: Annotated["VLANType", strawberry.lazy('ipam.graphql.types')] | None
|
||||
vrf: Annotated["VRFType", strawberry.lazy('ipam.graphql.types')] | None
|
||||
vlan_translation_policy: Annotated["VLANTranslationPolicyType", strawberry.lazy('ipam.graphql.types')] | None
|
||||
|
||||
vdcs: List[Annotated["VirtualDeviceContextType", strawberry.lazy('dcim.graphql.types')]]
|
||||
tagged_vlans: List[Annotated["VLANType", strawberry.lazy('ipam.graphql.types')]]
|
||||
|
@ -19,6 +19,7 @@ __all__ = (
|
||||
'ServiceTemplateFilter',
|
||||
'VLANFilter',
|
||||
'VLANGroupFilter',
|
||||
'VLANTranslationPolicyFilter',
|
||||
'VRFFilter',
|
||||
)
|
||||
|
||||
@ -113,6 +114,12 @@ class VLANGroupFilter(BaseFilterMixin):
|
||||
pass
|
||||
|
||||
|
||||
@strawberry_django.filter(models.VLANTranslationPolicy, lookups=True)
|
||||
@autotype_decorator(filtersets.VLANTranslationPolicyFilterSet)
|
||||
class VLANTranslationPolicyFilter(BaseFilterMixin):
|
||||
pass
|
||||
|
||||
|
||||
@strawberry_django.filter(models.VRF, lookups=True)
|
||||
@autotype_decorator(filtersets.VRFFilterSet)
|
||||
class VRFFilter(BaseFilterMixin):
|
||||
|
@ -53,5 +53,8 @@ class IPAMQuery:
|
||||
vlan_group: VLANGroupType = strawberry_django.field()
|
||||
vlan_group_list: List[VLANGroupType] = strawberry_django.field()
|
||||
|
||||
vlan_translation_policy: VLANTranslationPolicyType = strawberry_django.field()
|
||||
vlan_translation_policy_list: List[VLANTranslationPolicyType] = strawberry_django.field()
|
||||
|
||||
vrf: VRFType = strawberry_django.field()
|
||||
vrf_list: List[VRFType] = strawberry_django.field()
|
||||
|
@ -27,6 +27,7 @@ __all__ = (
|
||||
'ServiceTemplateType',
|
||||
'VLANType',
|
||||
'VLANGroupType',
|
||||
'VLANTranslationPolicyType',
|
||||
'VRFType',
|
||||
)
|
||||
|
||||
@ -266,6 +267,15 @@ class VLANGroupType(OrganizationalObjectType):
|
||||
return self.scope
|
||||
|
||||
|
||||
@strawberry_django.type(
|
||||
models.VLANTranslationPolicy,
|
||||
exclude=('scope_type', 'scope_id'),
|
||||
filters=VLANTranslationPolicyFilter
|
||||
)
|
||||
class VLANTranslationPolicyType(NetBoxObjectType):
|
||||
pass
|
||||
|
||||
|
||||
@strawberry_django.type(
|
||||
models.VRF,
|
||||
fields='__all__',
|
||||
|
@ -100,6 +100,7 @@ class VMInterfaceType(IPAddressesMixin, ComponentType):
|
||||
bridge: Annotated["VMInterfaceType", strawberry.lazy('virtualization.graphql.types')] | None
|
||||
untagged_vlan: Annotated["VLANType", strawberry.lazy('ipam.graphql.types')] | None
|
||||
vrf: Annotated["VRFType", strawberry.lazy('ipam.graphql.types')] | None
|
||||
vlan_translation_policy: Annotated["VLANTranslationPolicyType", strawberry.lazy('ipam.graphql.types')] | None
|
||||
|
||||
tagged_vlans: List[Annotated["VLANType", strawberry.lazy('ipam.graphql.types')]]
|
||||
bridge_interfaces: List[Annotated["VMInterfaceType", strawberry.lazy('virtualization.graphql.types')]]
|
||||
|
Loading…
Reference in New Issue
Block a user