Skip to content
Snippets Groups Projects
Verified Commit 446e9581 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

move router vendor into product type

parent ee744a15
Branches
Tags
No related merge requests found
This commit is part of merge request !105. Comments created here will be created in the context of that merge request.
...@@ -13,13 +13,6 @@ from gso.products.product_blocks.site import ( ...@@ -13,13 +13,6 @@ from gso.products.product_blocks.site import (
) )
class RouterVendor(strEnum):
"""Enumerator for the different product vendors that are supported."""
JUNIPER = "juniper"
NOKIA = "nokia"
class RouterRole(strEnum): class RouterRole(strEnum):
"""Enumerator for the different types of routers.""" """Enumerator for the different types of routers."""
...@@ -54,7 +47,6 @@ class RouterBlockInactive( ...@@ -54,7 +47,6 @@ class RouterBlockInactive(
router_si_ipv4_network: ipaddress.IPv4Network | None = None router_si_ipv4_network: ipaddress.IPv4Network | None = None
router_ias_lt_ipv4_network: ipaddress.IPv4Network | None = None router_ias_lt_ipv4_network: ipaddress.IPv4Network | None = None
router_ias_lt_ipv6_network: ipaddress.IPv6Network | None = None router_ias_lt_ipv6_network: ipaddress.IPv6Network | None = None
router_vendor: RouterVendor | None = None
router_role: RouterRole | None = None router_role: RouterRole | None = None
router_site: SiteBlockInactive | None router_site: SiteBlockInactive | None
router_is_ias_connected: bool | None = None router_is_ias_connected: bool | None = None
...@@ -77,7 +69,6 @@ class RouterBlockProvisioning(RouterBlockInactive, lifecycle=[SubscriptionLifecy ...@@ -77,7 +69,6 @@ class RouterBlockProvisioning(RouterBlockInactive, lifecycle=[SubscriptionLifecy
router_si_ipv4_network: ipaddress.IPv4Network | None = None router_si_ipv4_network: ipaddress.IPv4Network | None = None
router_ias_lt_ipv4_network: ipaddress.IPv4Network | None = None router_ias_lt_ipv4_network: ipaddress.IPv4Network | None = None
router_ias_lt_ipv6_network: ipaddress.IPv6Network | None = None router_ias_lt_ipv6_network: ipaddress.IPv6Network | None = None
router_vendor: RouterVendor | None = None
router_role: RouterRole | None = None router_role: RouterRole | None = None
router_site: SiteBlockProvisioning | None router_site: SiteBlockProvisioning | None
router_is_ias_connected: bool | None = None router_is_ias_connected: bool | None = None
...@@ -104,8 +95,6 @@ class RouterBlock(RouterBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTI ...@@ -104,8 +95,6 @@ class RouterBlock(RouterBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTI
router_ias_lt_ipv4_network: ipaddress.IPv4Network | None router_ias_lt_ipv4_network: ipaddress.IPv4Network | None
#: The :term:`IAS` LT IPv6 network of the router. #: The :term:`IAS` LT IPv6 network of the router.
router_ias_lt_ipv6_network: ipaddress.IPv6Network | None router_ias_lt_ipv6_network: ipaddress.IPv6Network | None
#: The vendor of the router, can be any of the values defined in :class:`RouterVendor`.
router_vendor: RouterVendor
#: The role of the router, which can be any of the values defined in :class:`RouterRole`. #: The role of the router, which can be any of the values defined in :class:`RouterRole`.
router_role: RouterRole router_role: RouterRole
#: The :class:`Site` that this router resides in. Both physically and computationally. #: The :class:`Site` that this router resides in. Both physically and computationally.
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
from orchestrator.domain.base import SubscriptionModel from orchestrator.domain.base import SubscriptionModel
from orchestrator.types import SubscriptionLifecycle from orchestrator.types import SubscriptionLifecycle
from pydantic_forms.types import strEnum
from gso.products.product_blocks.router import ( from gso.products.product_blocks.router import (
RouterBlock, RouterBlock,
...@@ -10,19 +11,29 @@ from gso.products.product_blocks.router import ( ...@@ -10,19 +11,29 @@ from gso.products.product_blocks.router import (
) )
class RouterVendor(strEnum):
"""Enumerator for the different product vendors that are supported."""
JUNIPER = "juniper"
NOKIA = "nokia"
class RouterInactive(SubscriptionModel, is_base=True): class RouterInactive(SubscriptionModel, is_base=True):
"""An inactive router.""" """An inactive router."""
vendor: RouterVendor
router: RouterBlockInactive router: RouterBlockInactive
class RouterProvisioning(RouterInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]): class RouterProvisioning(RouterInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A router that is being provisioned.""" """A router that is being provisioned."""
vendor: RouterVendor
router: RouterBlockProvisioning router: RouterBlockProvisioning
class Router(RouterProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]): class Router(RouterProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""A router that is currently active.""" """A router that is currently active."""
vendor: RouterVendor
router: RouterBlock router: RouterBlock
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment