-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #7598: GraphQL Filter Redesign
- Loading branch information
Showing
34 changed files
with
4,501 additions
and
634 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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
from enum import Enum | ||
import strawberry | ||
|
||
__all__ = [ | ||
'CircuitStatusEnum', | ||
'CircuitCommitRateEnum', | ||
'CircuitTerminationSideEnum', | ||
'CircuitTerminationPortSpeedEnum', | ||
'CircuitPriorityEnum', | ||
'VirtualCircuitTerminationRoleEnum', | ||
] | ||
|
||
# | ||
# Circuits | ||
# | ||
|
||
|
||
@strawberry.enum | ||
class CircuitStatusEnum(Enum): | ||
STATUS_DEPROVISIONING = 'deprovisioning' | ||
STATUS_ACTIVE = 'active' | ||
STATUS_PLANNED = 'planned' | ||
STATUS_PROVISIONING = 'provisioning' | ||
STATUS_OFFLINE = 'offline' | ||
STATUS_DECOMMISSIONED = 'decommissioned' | ||
|
||
|
||
@strawberry.enum | ||
class CircuitCommitRateEnum(Enum): | ||
TEN_MBPS = 10000 | ||
HUNDRED_MBPS = 100000 | ||
ONE_GBPS = 1000000 | ||
TEN_GBPS = 10000000 | ||
TWENTY_FIVE_GBPS = 25000000 | ||
FORTY_GBPS = 40000000 | ||
HUNDRED_GBPS = 100000000 | ||
TWO_HUNDRED_GBPS = 200000000 | ||
FOUR_HUNDRED_GBPS = 400000000 | ||
T1 = 1544 | ||
E1 = 2048 | ||
|
||
|
||
# | ||
# CircuitTerminations | ||
# | ||
|
||
|
||
@strawberry.enum | ||
class CircuitTerminationSideEnum(Enum): | ||
SIDE_A = 'A' | ||
SIDE_Z = 'Z' | ||
|
||
|
||
@strawberry.enum | ||
class CircuitTerminationPortSpeedEnum(Enum): | ||
TEN_MBPS = 10000 | ||
HUNDRED_MBPS = 100000 | ||
ONE_GBPS = 1000000 | ||
TEN_GBPS = 10000000 | ||
TWENTY_FIVE_GBPS = 25000000 | ||
FORTY_GBPS = 40000000 | ||
HUNDRED_GBPS = 100000000 | ||
TWO_HUNDRED_GBPS = 200000000 | ||
FOUR_HUNDRED_GBPS = 400000000 | ||
T1 = 1544 | ||
E1 = 2048 | ||
|
||
|
||
@strawberry.enum | ||
class CircuitPriorityEnum(Enum): | ||
PRIORITY_PRIMARY = 'primary' | ||
PRIORITY_SECONDARY = 'secondary' | ||
PRIORITY_TERTIARY = 'tertiary' | ||
PRIORITY_INACTIVE = 'inactive' | ||
|
||
|
||
# | ||
# Virtual circuits | ||
# | ||
|
||
|
||
@strawberry.enum | ||
class VirtualCircuitTerminationRoleEnum(Enum): | ||
ROLE_PEER = 'peer' | ||
ROLE_HUB = 'hub' | ||
ROLE_SPOKE = 'spoke' |
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,17 @@ | ||
from dataclasses import dataclass | ||
from typing import Annotated, TYPE_CHECKING | ||
import strawberry | ||
import strawberry_django | ||
from netbox.graphql.filter_mixins import OrganizationalModelFilterMixin | ||
|
||
if TYPE_CHECKING: | ||
from .filters import * | ||
from core.graphql.filter_lookups import * | ||
from netbox.graphql.enums import * | ||
|
||
__all__ = ['BaseCircuitTypeFilterMixin'] | ||
|
||
|
||
@dataclass | ||
class BaseCircuitTypeFilterMixin(OrganizationalModelFilterMixin): | ||
color: Annotated['ColorEnum', strawberry.lazy('netbox.graphql.enums')] | None = strawberry_django.filter_field() |
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
Oops, something went wrong.