Add graphql types/filters/schema for VLANTranslationRule

This commit is contained in:
Brian Tiemann 2024-10-21 16:16:19 -04:00
parent a94fe018ac
commit 9da0191b09
3 changed files with 21 additions and 1 deletions

View File

@ -20,6 +20,7 @@ __all__ = (
'VLANFilter', 'VLANFilter',
'VLANGroupFilter', 'VLANGroupFilter',
'VLANTranslationPolicyFilter', 'VLANTranslationPolicyFilter',
'VLANTranslationRuleFilter',
'VRFFilter', 'VRFFilter',
) )
@ -120,6 +121,12 @@ class VLANTranslationPolicyFilter(BaseFilterMixin):
pass pass
@strawberry_django.filter(models.VLANTranslationRule, lookups=True)
@autotype_decorator(filtersets.VLANTranslationRuleFilterSet)
class VLANTranslationRuleFilter(BaseFilterMixin):
pass
@strawberry_django.filter(models.VRF, lookups=True) @strawberry_django.filter(models.VRF, lookups=True)
@autotype_decorator(filtersets.VRFFilterSet) @autotype_decorator(filtersets.VRFFilterSet)
class VRFFilter(BaseFilterMixin): class VRFFilter(BaseFilterMixin):

View File

@ -56,5 +56,8 @@ class IPAMQuery:
vlan_translation_policy: VLANTranslationPolicyType = strawberry_django.field() vlan_translation_policy: VLANTranslationPolicyType = strawberry_django.field()
vlan_translation_policy_list: List[VLANTranslationPolicyType] = strawberry_django.field() vlan_translation_policy_list: List[VLANTranslationPolicyType] = strawberry_django.field()
vlan_translation_rule: VLANTranslationRuleType = strawberry_django.field()
vlan_translation_rule_list: List[VLANTranslationRuleType] = strawberry_django.field()
vrf: VRFType = strawberry_django.field() vrf: VRFType = strawberry_django.field()
vrf_list: List[VRFType] = strawberry_django.field() vrf_list: List[VRFType] = strawberry_django.field()

View File

@ -28,6 +28,7 @@ __all__ = (
'VLANType', 'VLANType',
'VLANGroupType', 'VLANGroupType',
'VLANTranslationPolicyType', 'VLANTranslationPolicyType',
'VLANTranslationRuleType',
'VRFType', 'VRFType',
) )
@ -277,13 +278,22 @@ class VLANGroupType(OrganizationalObjectType):
@strawberry_django.type( @strawberry_django.type(
models.VLANTranslationPolicy, models.VLANTranslationPolicy,
exclude=('scope_type', 'scope_id'), fields='__all__',
filters=VLANTranslationPolicyFilter filters=VLANTranslationPolicyFilter
) )
class VLANTranslationPolicyType(NetBoxObjectType): class VLANTranslationPolicyType(NetBoxObjectType):
pass pass
@strawberry_django.type(
models.VLANTranslationRule,
fields='__all__',
filters=VLANTranslationRuleFilter
)
class VLANTranslationRuleType(NetBoxObjectType):
pass
@strawberry_django.type( @strawberry_django.type(
models.VRF, models.VRF,
fields='__all__', fields='__all__',