diff --git a/gso/products/product_blocks/router.py b/gso/products/product_blocks/router.py index a8a820448a1b7388b903b0be69b7da9d4c17d660..c4f7cdd5e559219bfa76954c35cca11a01c0dedd 100644 --- a/gso/products/product_blocks/router.py +++ b/gso/products/product_blocks/router.py @@ -8,13 +8,6 @@ from pydantic import ConstrainedInt from gso.products.product_blocks.site import SiteBlock, SiteBlockInactive, SiteBlockProvisioning -class RouterVendor(strEnum): - """Enumerator for the different product vendors that are supported.""" - - JUNIPER = "juniper" - NOKIA = "nokia" - - class RouterRole(strEnum): """Enumerator for the different types of routers.""" @@ -47,7 +40,6 @@ class RouterBlockInactive( router_si_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_vendor: RouterVendor | None = None router_role: RouterRole | None = None router_site: SiteBlockInactive | None router_is_ias_connected: bool | None = None @@ -69,7 +61,6 @@ class RouterBlockProvisioning(RouterBlockInactive, lifecycle=[SubscriptionLifecy router_si_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_vendor: RouterVendor | None = None router_role: RouterRole | None = None router_site: SiteBlockProvisioning | None router_is_ias_connected: bool | None = None @@ -96,8 +87,6 @@ class RouterBlock(RouterBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTI router_ias_lt_ipv4_network: ipaddress.IPv4Network | None #: The IAS LT IPv6 network of the router. 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`. router_role: RouterRole #: The :class:`Site` that this router resides in. Both physically and computationally. diff --git a/gso/products/product_types/router.py b/gso/products/product_types/router.py index 370c066524640792ca4c72fe46c03be704b16144..aa8264923409a2b5b784ba4d2c8c97bffa64bef2 100644 --- a/gso/products/product_types/router.py +++ b/gso/products/product_types/router.py @@ -1,16 +1,27 @@ from orchestrator.domain.base import SubscriptionModel from orchestrator.types import SubscriptionLifecycle +from pydantic_forms.types import strEnum from gso.products.product_blocks.router import RouterBlock, RouterBlockInactive, RouterBlockProvisioning +class RouterVendor(strEnum): + """Enumerator for the different product vendors that are supported.""" + + JUNIPER = "juniper" + NOKIA = "nokia" + + class RouterInactive(SubscriptionModel, is_base=True): + vendor: RouterVendor router: RouterBlockInactive class RouterProvisioning(RouterInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]): + vendor: RouterVendor router: RouterBlockProvisioning class Router(RouterProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]): + vendor: RouterVendor router: RouterBlock