Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions netbox_acls/graphql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .types import (
AccessListType,
ACLExtendedRuleType,
ACLInterfaceAssignmentType,
ACLStandardRuleType,
)

Expand All @@ -24,3 +25,6 @@ class NetBoxACLSQuery:

acl_standard_rule: ACLStandardRuleType = strawberry_django.field()
acl_standard_rule_list: List[ACLStandardRuleType] = strawberry_django.field()

acl_interface_assignment: ACLInterfaceAssignmentType = strawberry_django.field()
acl_interface_assignment_list: List[ACLInterfaceAssignmentType] = strawberry_django.field()
8 changes: 6 additions & 2 deletions netbox_acls/graphql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class AccessListType(NetBoxObjectType):
Defines the object type for the django model AccessList.
"""

# Model fields
assigned_object_type: Annotated["ContentTypeType", strawberry.lazy("netbox.graphql.types")]
assigned_object: Annotated[
Union[
Expand All @@ -41,17 +42,18 @@ class AccessListType(NetBoxObjectType):
)
class ACLInterfaceAssignmentType(NetBoxObjectType):
"""
Defines the object type for the django model AccessList.
Defines the object type for the django model ACLInterfaceAssignment.
"""

# Model fields
access_list: Annotated["AccessListType", strawberry.lazy("netbox_acls.graphql.types")]
assigned_object_type: Annotated["ContentTypeType", strawberry.lazy("netbox.graphql.types")]
assigned_object: Annotated[
Union[
Annotated["InterfaceType", strawberry.lazy("dcim.graphql.types")],
Annotated["VMInterfaceType", strawberry.lazy("virtualization.graphql.types")],
],
strawberry.union("ACLInterfaceAssignmentType"),
strawberry.union("ACLInterfaceAssignedObjectType"),
]


Expand All @@ -65,6 +67,7 @@ class ACLStandardRuleType(NetBoxObjectType):
Defines the object type for the django model ACLStandardRule.
"""

# Model fields
access_list: Annotated["AccessListType", strawberry.lazy("netbox_acls.graphql.types")]
source_prefix: Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")] | None

Expand All @@ -79,6 +82,7 @@ class ACLExtendedRuleType(NetBoxObjectType):
Defines the object type for the django model ACLExtendedRule.
"""

# Model fields
access_list: Annotated["AccessListType", strawberry.lazy("netbox_acls.graphql.types")]
source_prefix: Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")] | None
source_ports: List[int] | None
Expand Down