Skip to content
Snippets Groups Projects
Commit 432a89fc authored by Neda Moeini's avatar Neda Moeini
Browse files

Initial modeling of core layer 3 VRF product modeling.

parent 19f6db02
No related branches found
No related tags found
1 merge request!314Feature/vrf
This commit is part of merge request !314. Comments created here will be created in the context of that merge request.
"""Product blocks for Layer 3 Core VRF products."""
from orchestrator.domain.base import ProductBlockModel
from orchestrator.types import SubscriptionLifecycle
from pydantic import Field
from gso.products.product_blocks.nren_l3_core_service import (
NRENAccessPort,
NRENAccessPortInactive,
NRENAccessPortProvisioning,
)
class L3CoreVRFBlockInactive(
ProductBlockModel, lifecycle=[SubscriptionLifecycle.INITIAL], product_block_name="L3CoreVRFBlock"
):
"""An inactive Layer 3 Core VRF service subscription. See :class:`L3CoreVRFBlock`."""
vrf_ap_list: list[NRENAccessPortInactive] = Field(default_factory=list)
vrf_name: str
route_distinguisher: str
route_target: str
class L3CoreVRFBlockProvisioning(
L3CoreVRFBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]
):
"""A provisioning Layer 3 Core VRF service subscription. See :class:`L3CoreVRFBlock`."""
vrf_ap_list: list[NRENAccessPortProvisioning] # type: ignore[assignment]
vrf_name: str
route_distinguisher: str
route_target: str
class L3CoreVRFBlock(L3CoreVRFBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""Represents an active Layer 3 Core VRF service subscription block."""
#: List of Access Points associated with this VRF.
nren_ap_list: list[NRENAccessPort] # type: ignore[assignment]
#: Unique name identifying this VRF.
vrf_name: str
#: Route Distinguisher (RD) ensuring unique route identification within this VRF.
route_distinguisher: str
#: Route Target (RT) defining routing policies for importing/exporting routes.
route_target: str
"""L3 Core VRF product types."""
from orchestrator.domain import SubscriptionModel
from orchestrator.types import SubscriptionLifecycle
from pydantic_forms.types import strEnum
from gso.products.product_blocks.l3_core_vrf import L3CoreVRFBlock, L3CoreVRFBlockInactive, L3CoreVRFBlockProvisioning
class L3CoreVRFType(strEnum):
"""Available types of L3 Core VRFs."""
GEANT_IP_VRF = "GÉANT IP VRF"
IMPORTED_GEANT_IP_VRF = "IMPORTED GÉANT IP VRF"
IAS_VRF = "IAS VRF"
IMPORTED_IAS_VRF = "IMPORTED IAS VRF"
LHCONE_VRF = "LHCONE VRF"
IMPORTED_LHCONE_VRF = "IMPORTED LHCONE VRF"
COPERNICUS_VRF = "COPERNICUS VRF"
IMPORTED_COPERNICUS_VRF = "IMPORTED COPERNICUS VRF"
class L3CoreVRFInactive(SubscriptionModel, is_base=True):
"""An inactive L3 Core VRF subscription."""
l3_core_vrf_type: L3CoreVRFType
l3_core_vrf: L3CoreVRFBlockInactive
class L3CoreVRFProvisioning(L3CoreVRFInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A l3 Core VRF subscription that's being provisioned."""
l3_core_vrf_type: L3CoreVRFType
l3_core_vrf: L3CoreVRFBlockProvisioning
class L3CoreVRF(L3CoreVRFProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""An active L3 Core VRF subscription."""
l3_core_vrf_type: L3CoreVRFType
l3_core_vrf: L3CoreVRFBlock
class ImportedL3CoreVRFInactive(SubscriptionModel, is_base=True):
"""An imported, inactive L3 Core VRF subscription."""
l3_core_vrf_type: L3CoreVRFType
l3_core_vrf: L3CoreVRFBlockInactive
class ImportedL3CoreVRF(
ImportedL3CoreVRFInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE]
):
"""An imported L3 Core VRF subscription."""
l3_core_vrf_type: L3CoreVRFType
l3_core_vrf: L3CoreVRFBlock
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment