File tree Expand file tree Collapse file tree 4 files changed +25
-34
lines changed Expand file tree Collapse file tree 4 files changed +25
-34
lines changed Original file line number Diff line number Diff line change
1
+ from .schema import *
2
+ from .types import *
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change 2
2
Define the object types and queries availble via the graphql api.
3
3
"""
4
4
5
- from graphene import ObjectType
6
- from netbox .graphql .fields import ObjectField , ObjectListField
7
5
from netbox .graphql .types import NetBoxObjectType
8
6
9
- from . import filtersets , models
7
+ from .. import filtersets , models
10
8
11
9
__all__ = (
12
10
"AccessListType" ,
15
13
"ACLStandardRuleType" ,
16
14
)
17
15
18
- #
19
- # Object types
20
- #
21
-
22
16
23
17
class AccessListType (NetBoxObjectType ):
24
18
"""
@@ -79,25 +73,3 @@ class Meta:
79
73
fields = "__all__"
80
74
filterset_class = filtersets .ACLStandardRuleFilterSet
81
75
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
Original file line number Diff line number Diff line change @@ -17,11 +17,7 @@ def test_root(self):
17
17
18
18
19
19
class ACLTestCase (
20
- APIViewTestCases .GetObjectViewTestCase ,
21
- APIViewTestCases .ListObjectsViewTestCase ,
22
- APIViewTestCases .CreateObjectViewTestCase ,
23
- APIViewTestCases .UpdateObjectViewTestCase ,
24
- APIViewTestCases .DeleteObjectViewTestCase ,
20
+ APIViewTestCases .APIViewTestCase ,
25
21
):
26
22
"""Test the AccessList Test"""
27
23
You can’t perform that action at this time.
0 commit comments