-
Notifications
You must be signed in to change notification settings - Fork 26
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 #199 from cruse1977/dev
Netbox 4.0 Compatibility
- Loading branch information
Showing
13 changed files
with
147 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG NETBOX_VARIANT=v3.7 | ||
ARG NETBOX_VARIANT=v4.0 | ||
|
||
FROM netboxcommunity/netbox:${NETBOX_VARIANT} | ||
|
||
|
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
Validating CODEOWNERS rules …
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 @@ | ||
* @ryanmerolle @abhi1693 @cruse1977 @natm |
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
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,2 +1,9 @@ | ||
from .schema import * | ||
from .types import * | ||
|
||
schema = [ | ||
schema.NetBoxACLSAccessListQuery, | ||
schema.NetBoxACLSStandardRuleQuery, | ||
schema.NetBoxACLSACLExtendedRuleQuery | ||
] | ||
|
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,30 @@ | ||
import strawberry_django | ||
from .. import filtersets, models | ||
from netbox.graphql.filter_mixins import autotype_decorator, BaseFilterMixin | ||
|
||
__all__ = ( | ||
'AccessListFilter', | ||
'ACLInterfaceAssignmentFilter', | ||
'ACLExtendedRuleFilter', | ||
'ACLStandardRuleFilter', | ||
) | ||
|
||
@strawberry_django.filter(models.AccessList, lookups=True) | ||
@autotype_decorator(filtersets.AccessListFilterSet) | ||
class AccessListFilter(BaseFilterMixin): | ||
pass | ||
|
||
@strawberry_django.filter(models.ACLStandardRule, lookups=True) | ||
@autotype_decorator(filtersets.ACLStandardRuleFilterSet) | ||
class ACLStandardRuleFilter(BaseFilterMixin): | ||
pass | ||
|
||
@strawberry_django.filter(models.ACLExtendedRule, lookups=True) | ||
@autotype_decorator(filtersets.ACLExtendedRuleFilterSet) | ||
class ACLExtendedRuleFilter(BaseFilterMixin): | ||
pass | ||
|
||
@strawberry_django.filter(models.ACLInterfaceAssignment, lookups=True) | ||
@autotype_decorator(filtersets.ACLInterfaceAssignmentFilterSet) | ||
class ACLInterfaceAssignmentFilter(BaseFilterMixin): | ||
pass |
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,22 +1,32 @@ | ||
from graphene import ObjectType | ||
from netbox.graphql.fields import ObjectField, ObjectListField | ||
|
||
import strawberry | ||
import strawberry_django | ||
from .types import * | ||
from ..models import * | ||
|
||
|
||
class Query(ObjectType): | ||
@strawberry.type | ||
class NetBoxACLSAccessListQuery: | ||
""" | ||
Defines the queries available to this plugin via the graphql api. | ||
""" | ||
@strawberry.field | ||
def access_list(self, id: int) -> AccessListType: | ||
return AccessList.objects.get(pk=id) | ||
access_list_list: list[AccessListType] = strawberry_django.field() | ||
|
||
@strawberry.type | ||
class NetBoxACLSACLExtendedRuleQuery: | ||
@strawberry.field | ||
def acl_extended_rule(self, id: int) -> ACLExtendedRuleType: | ||
return ACLExtendedRule.objects.get(pk=id) | ||
acl_extended_rule_list: list[ACLExtendedRuleType] = strawberry_django.field() | ||
|
||
access_list = ObjectField(AccessListType) | ||
access_list_list = ObjectListField(AccessListType) | ||
|
||
acl_extended_rule = ObjectField(ACLExtendedRuleType) | ||
acl_extended_rule_list = ObjectListField(ACLExtendedRuleType) | ||
|
||
acl_standard_rule = ObjectField(ACLStandardRuleType) | ||
acl_standard_rule_list = ObjectListField(ACLStandardRuleType) | ||
@strawberry.type | ||
class NetBoxACLSStandardRuleQuery: | ||
@strawberry.field | ||
def acl_standard_rule(self, id: int) -> ACLStandardRuleType: | ||
return ACLStandardRule.objects.get(pk=id) | ||
acl_standard_rule_list: list[ACLStandardRuleType] = strawberry_django.field() | ||
|
||
|
||
schema = Query |
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
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__ = "1.5.0" | ||
__version__ = "1.6.0" |
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