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 22Define 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
75from netbox .graphql .types import NetBoxObjectType
86
9- from . import filtersets , models
7+ from .. import filtersets , models
108
119__all__ = (
1210 "AccessListType" ,
1513 "ACLStandardRuleType" ,
1614)
1715
18- #
19- # Object types
20- #
21-
2216
2317class 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
Original file line number Diff line number Diff line change @@ -17,11 +17,7 @@ def test_root(self):
1717
1818
1919class 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
You can’t perform that action at this time.
0 commit comments