Skip to content

Commit 7647ecf

Browse files
authored
Merge pull request #220 from gellis713/routing_policy_graphql_enhancement
Add list of "RoutingPolicyRule" objects to GraphQL "RoutingPolicy" object
2 parents db5b10f + fcebf91 commit 7647ecf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

netbox_bgp/graphql/types.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ class BGPPeerGroupType(NetBoxObjectType):
8282
class RoutingPolicyType(NetBoxObjectType):
8383
name: str
8484
description: str
85+
rules: List[
86+
Annotated["RoutingPolicyRuleType", strawberry.lazy("netbox_bgp.graphql.types")]
87+
]
8588

8689

8790
@strawberry_django.type(
@@ -102,10 +105,10 @@ class RoutingPolicyRuleType(NetBoxObjectType):
102105
Annotated["CommunityListType", strawberry.lazy("netbox_bgp.graphql.types")]
103106
]
104107
match_ip_address: List[
105-
Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")]
108+
Annotated["PrefixListType", strawberry.lazy("netbox_bgp.graphql.types")]
106109
]
107110
match_ipv6_address: List[
108-
Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")]
111+
Annotated["PrefixListType", strawberry.lazy("netbox_bgp.graphql.types")]
109112
]
110113

111114

@@ -114,6 +117,9 @@ class PrefixListType(NetBoxObjectType):
114117
name: str
115118
description: str
116119
family: str
120+
prefrules: List[
121+
Annotated["PrefixListRuleType", strawberry.lazy("netbox_bgp.graphql.types")]
122+
]
117123

118124

119125
@strawberry_django.type(PrefixListRule, fields="__all__", filters=PrefixListRuleFilter)
@@ -134,6 +140,9 @@ class PrefixListRuleType(NetBoxObjectType):
134140
class CommunityListType(NetBoxObjectType):
135141
name: str
136142
description: str
143+
commlistrules: List[
144+
Annotated["CommunityListRuleType", strawberry.lazy("netbox_bgp.graphql.types")]
145+
]
137146

138147

139148
@strawberry_django.type(

0 commit comments

Comments
 (0)