diff --git a/netbox/dcim/graphql/types.py b/netbox/dcim/graphql/types.py index b951aead0..96fa3c162 100644 --- a/netbox/dcim/graphql/types.py +++ b/netbox/dcim/graphql/types.py @@ -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')]] diff --git a/netbox/ipam/graphql/filters.py b/netbox/ipam/graphql/filters.py index 5f6602416..2d366379a 100644 --- a/netbox/ipam/graphql/filters.py +++ b/netbox/ipam/graphql/filters.py @@ -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): diff --git a/netbox/ipam/graphql/schema.py b/netbox/ipam/graphql/schema.py index 072f8cbcd..d991d68f7 100644 --- a/netbox/ipam/graphql/schema.py +++ b/netbox/ipam/graphql/schema.py @@ -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() diff --git a/netbox/ipam/graphql/types.py b/netbox/ipam/graphql/types.py index 46d45816e..875675147 100644 --- a/netbox/ipam/graphql/types.py +++ b/netbox/ipam/graphql/types.py @@ -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__', diff --git a/netbox/virtualization/graphql/types.py b/netbox/virtualization/graphql/types.py index 2d872322b..bed65a3b3 100644 --- a/netbox/virtualization/graphql/types.py +++ b/netbox/virtualization/graphql/types.py @@ -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')]]