-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from k01ek/develop
Develop
- Loading branch information
Showing
4 changed files
with
164 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from graphene import ObjectType, Field | ||
|
||
from netbox.graphql.scalars import BigInt | ||
from netbox.graphql.types import NetBoxObjectType | ||
from netbox.graphql.fields import ObjectField, ObjectListField | ||
|
||
from . import models, filters | ||
|
||
|
||
class CommunityType(NetBoxObjectType): | ||
class Meta: | ||
model = models.Community | ||
fields = '__all__' | ||
filterset_class = filters.CommunityFilterSet | ||
|
||
|
||
class AsnType(NetBoxObjectType): | ||
number = Field(BigInt) | ||
|
||
class Meta: | ||
model = models.ASN | ||
fields = '__all__' | ||
filterset_class = filters.ASNFilterSet | ||
|
||
|
||
class BgpSessionType(NetBoxObjectType): | ||
class Meta: | ||
model = models.BGPSession | ||
fields = '__all__' | ||
filterset_class = filters.BGPSessionFilterSet | ||
|
||
|
||
class PeerGroupType(NetBoxObjectType): | ||
class Meta: | ||
model = models.BGPPeerGroup | ||
fields = '__all__' | ||
filterset_class = filters.BGPPeerGroupFilterSet | ||
|
||
|
||
class RoutingPolicyType(NetBoxObjectType): | ||
class Meta: | ||
model = models.RoutingPolicy | ||
fields = '__all__' | ||
filterset_class = filters.RoutingPolicyFilterSet | ||
|
||
|
||
class BGPQuery(ObjectType): | ||
community = ObjectField(CommunityType) | ||
community_list = ObjectListField(CommunityType) | ||
|
||
bgp_asn = ObjectField(AsnType) | ||
bgp_asn_list = ObjectListField(AsnType) | ||
|
||
bgp_session = ObjectField(BgpSessionType) | ||
bgp_session_list = ObjectListField(BgpSessionType) | ||
|
||
peer_group = ObjectField(PeerGroupType) | ||
peer_group_list = ObjectListField(PeerGroupType) | ||
|
||
routing_policy = ObjectField(RoutingPolicyType) | ||
routing_policy_list = ObjectListField(RoutingPolicyType) | ||
|
||
|
||
schema = BGPQuery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.6.0" | ||
__version__ = "0.6.1" |