Skip to content

Commit 6fd9fba

Browse files
authored
Merge branch 'dev' into issue_47
2 parents 36920fb + 1cdc9a4 commit 6fd9fba

File tree

4 files changed

+25
-34
lines changed

4 files changed

+25
-34
lines changed

netbox_acls/graphql/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .schema import *
2+
from .types import *

netbox_acls/graphql/schema.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from graphene import ObjectType
2+
from netbox.graphql.fields import ObjectField, ObjectListField
3+
4+
from .types import *
5+
6+
class Query(ObjectType):
7+
"""
8+
Defines the queries available to this plugin via the graphql api.
9+
"""
10+
11+
access_list = ObjectField(AccessListType)
12+
access_list_list = ObjectListField(AccessListType)
13+
14+
acl_extended_rule = ObjectField(ACLExtendedRuleType)
15+
acl_extended_rule_list = ObjectListField(ACLExtendedRuleType)
16+
17+
acl_standard_rule = ObjectField(ACLStandardRuleType)
18+
acl_standard_rule_list = ObjectListField(ACLStandardRuleType)
19+
20+
21+
schema = Query

netbox_acls/graphql.py renamed to netbox_acls/graphql/types.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
Define the object types and queries availble via the graphql api.
33
"""
44

5-
from graphene import ObjectType
6-
from netbox.graphql.fields import ObjectField, ObjectListField
75
from netbox.graphql.types import NetBoxObjectType
86

9-
from . import filtersets, models
7+
from .. import filtersets, models
108

119
__all__ = (
1210
"AccessListType",
@@ -15,10 +13,6 @@
1513
"ACLStandardRuleType",
1614
)
1715

18-
#
19-
# Object types
20-
#
21-
2216

2317
class AccessListType(NetBoxObjectType):
2418
"""
@@ -79,25 +73,3 @@ class Meta:
7973
fields = "__all__"
8074
filterset_class = filtersets.ACLStandardRuleFilterSet
8175

82-
83-
#
84-
# Queries
85-
#
86-
87-
88-
class Query(ObjectType):
89-
"""
90-
Defines the queries availible to this plugin via the graphql api.
91-
"""
92-
93-
access_list = ObjectField(AccessListType)
94-
access_list_list = ObjectListField(AccessListType)
95-
96-
acl_extended_rule = ObjectField(ACLExtendedRuleType)
97-
acl_extended_rule_list = ObjectListField(ACLExtendedRuleType)
98-
99-
acl_standard_rule = ObjectField(ACLStandardRuleType)
100-
acl_standard_rule_list = ObjectListField(ACLStandardRuleType)
101-
102-
103-
schema = Query

netbox_acls/tests/test_api.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ def test_root(self):
1717

1818

1919
class ACLTestCase(
20-
APIViewTestCases.GetObjectViewTestCase,
21-
APIViewTestCases.ListObjectsViewTestCase,
22-
APIViewTestCases.CreateObjectViewTestCase,
23-
APIViewTestCases.UpdateObjectViewTestCase,
24-
APIViewTestCases.DeleteObjectViewTestCase,
20+
APIViewTestCases.APIViewTestCase,
2521
):
2622
"""Test the AccessList Test"""
2723

0 commit comments

Comments
 (0)