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

Refactor GÉANT IP service to NREN L3 Core Service and begin adding IAS service as a product type

parent fb2d8193
No related branches found
No related tags found
No related merge requests found
Showing
with 115 additions and 85 deletions
......@@ -9,9 +9,9 @@ from orchestrator.domain import SUBSCRIPTION_MODEL_REGISTRY
from pydantic_forms.types import strEnum
from gso.products.product_types.edge_port import EdgePort, ImportedEdgePort
from gso.products.product_types.geant_ip import GeantIP, ImportedGeantIP
from gso.products.product_types.iptrunk import ImportedIptrunk, Iptrunk
from gso.products.product_types.lan_switch_interconnect import LanSwitchInterconnect
from gso.products.product_types.nren_l3_core_service import ImportedNRENL3CoreService, NRENL3CoreService
from gso.products.product_types.office_router import ImportedOfficeRouter, OfficeRouter
from gso.products.product_types.opengear import ImportedOpengear, Opengear
from gso.products.product_types.pop_vlan import PopVlan
......@@ -43,6 +43,8 @@ class ProductName(strEnum):
IMPORTED_EDGE_PORT = "Imported Edge Port"
GEANT_IP = "GÉANT IP"
IMPORTED_GEANT_IP = "Imported GÉANT IP"
IAS = "IAS"
IMPORTED_IAS = "Imported IAS"
class ProductType(strEnum):
......@@ -65,8 +67,10 @@ class ProductType(strEnum):
IMPORTED_OPENGEAR = Opengear.__name__
EDGE_PORT = EdgePort.__name__
IMPORTED_EDGE_PORT = ImportedEdgePort.__name__
GEANT_IP = GeantIP.__name__
IMPORTED_GEANT_IP = ImportedGeantIP.__name__
GEANT_IP = NRENL3CoreService.__name__
IMPORTED_GEANT_IP = ImportedNRENL3CoreService.__name__
IAS = NRENL3CoreService.__name__
IMPORTED_IAS = ImportedNRENL3CoreService.__name__
SUBSCRIPTION_MODEL_REGISTRY.update(
......@@ -88,7 +92,9 @@ SUBSCRIPTION_MODEL_REGISTRY.update(
ProductName.IMPORTED_OPENGEAR.value: ImportedOpengear,
ProductName.EDGE_PORT.value: EdgePort,
ProductName.IMPORTED_EDGE_PORT.value: ImportedEdgePort,
ProductName.GEANT_IP.value: GeantIP,
ProductName.IMPORTED_GEANT_IP.value: ImportedGeantIP,
ProductName.GEANT_IP.value: NRENL3CoreService,
ProductName.IMPORTED_GEANT_IP.value: ImportedNRENL3CoreService,
ProductName.IAS.value: NRENL3CoreService,
ProductName.IMPORTED_IAS.value: ImportedNRENL3CoreService,
},
)
"""Product blocks for :class:`GeantIP` products."""
"""Product blocks for :class:`NREN` Layer 3 Core Service products."""
from orchestrator.domain.base import ProductBlockModel
from orchestrator.types import SubscriptionLifecycle
......@@ -17,42 +17,44 @@ class NRENAccessPortInactive(
):
"""An access port for an R&E :term:`NREN` service that is inactive."""
nren_ap_type: APType | None = None
geant_ip_sbp: ServiceBindingPortInactive
ap_type: APType | None = None
sbp: ServiceBindingPortInactive
class NRENAccessPortProvisioning(NRENAccessPortInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""An access port for an R&E :term:`NREN` service that is being provisioned."""
nren_ap_type: APType
geant_ip_sbp: ServiceBindingPortProvisioning
ap_type: APType
sbp: ServiceBindingPortProvisioning
class NRENAccessPort(NRENAccessPortProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""An access port for an R&E :term:`NREN` service."""
#: The type of Access Port
nren_ap_type: APType
ap_type: APType
#: The corresponding :term:`SBP` of this Access Port.
geant_ip_sbp: ServiceBindingPort
sbp: ServiceBindingPort
class GeantIPBlockInactive(
ProductBlockModel, lifecycle=[SubscriptionLifecycle.INITIAL], product_block_name="GeantIPBlock"
class NRENL3CoreServiceBlockInactive(
ProductBlockModel, lifecycle=[SubscriptionLifecycle.INITIAL], product_block_name="NRENL3CoreServiceBlock"
):
"""A GÉANT IP subscription that is currently inactive. See :class:`GeantIPBlock`."""
"""An inactive :term:`NREN` L3 Core service subscription. See :class:`NRENL3CoreServiceBlock`."""
geant_ip_ap_list: list[NRENAccessPortInactive] = Field(default_factory=list)
nren_ap_list: list[NRENAccessPortInactive] = Field(default_factory=list)
class GeantIPBlockProvisioning(GeantIPBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A GÉANT IP subscription that is currently being provisioned. See :class:`GeantIPBlock`."""
class NRENL3CoreServiceBlockProvisioning(
NRENL3CoreServiceBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]
):
"""A provisioning :term:`NREN` L3 Core Service subscription. See :class:`NRENL3CoreServiceBlock`."""
geant_ip_ap_list: list[NRENAccessPortProvisioning] # type: ignore[assignment]
nren_ap_list: list[NRENAccessPortProvisioning] # type: ignore[assignment]
class GeantIPBlock(GeantIPBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""A GÉANT IP subscription block."""
class NRENL3CoreServiceBlock(NRENL3CoreServiceBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""An active :term:`NREN` L3 Core Service subscription block."""
#: The list of Access Points where this service is present.
geant_ip_ap_list: list[NRENAccessPort] # type: ignore[assignment]
nren_ap_list: list[NRENAccessPort] # type: ignore[assignment]
"""GÉANT IP product type."""
from orchestrator.domain import SubscriptionModel
from orchestrator.types import SubscriptionLifecycle
from gso.products.product_blocks.geant_ip import GeantIPBlock, GeantIPBlockInactive, GeantIPBlockProvisioning
class GeantIPInactive(SubscriptionModel, is_base=True):
"""An inactive GÉANT IP subscription."""
geant_ip: GeantIPBlockInactive
class GeantIPProvisioning(GeantIPInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A GÉANT IP subscription that's being provisioned."""
geant_ip: GeantIPBlockProvisioning
class GeantIP(GeantIPProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""An active GÉANT IP subscription."""
geant_ip: GeantIPBlock
class ImportedGeantIPInactive(SubscriptionModel, is_base=True):
"""An imported, inactive GÉANT IP subscription."""
geant_ip: GeantIPBlockInactive
class ImportedGeantIP(
ImportedGeantIPInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE]
):
"""An imported GÉANT IP subscription."""
geant_ip: GeantIPBlock
""":term:`NREN` L3 Core Service product type."""
from orchestrator.domain import SubscriptionModel
from orchestrator.types import SubscriptionLifecycle
from pydantic_forms.types import strEnum
from gso.products.product_blocks.nren_l3_core_service import (
NRENL3CoreServiceBlock,
NRENL3CoreServiceBlockInactive,
NRENL3CoreServiceBlockProvisioning,
)
class NRENL3CoreServiceType(strEnum):
"""Available types of :term:`NREN` Layer 3 Core Services.
The core services offered include GÉANT IP for R&E access, and the Internet Access Service.
"""
GEANT_IP = "GÉANT IP"
IAS = "IAS"
class NRENL3CoreServiceInactive(SubscriptionModel, is_base=True):
"""An inactive :term:`NREN` L3 Core Service subscription."""
nren_l3_core_service_type: NRENL3CoreServiceType
nren_l3_core_service: NRENL3CoreServiceBlockInactive
class NRENL3CoreServiceProvisioning(NRENL3CoreServiceInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A :term:`NREN` L3 Core Service subscription that's being provisioned."""
nren_l3_core_service_type: NRENL3CoreServiceType
nren_l3_core_service: NRENL3CoreServiceBlockProvisioning
class NRENL3CoreService(NRENL3CoreServiceProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""An active :term:`NREN` L3 Core Service subscription."""
nren_l3_core_service_type: NRENL3CoreServiceType
nren_l3_core_service: NRENL3CoreServiceBlock
class ImportedNRENL3CoreServiceInactive(SubscriptionModel, is_base=True):
"""An imported, inactive :term:`NREN` L3 Core Service subscription."""
nren_l3_core_service_type: NRENL3CoreServiceType
nren_l3_core_service: NRENL3CoreServiceBlockInactive
class ImportedNRENL3CoreService(
ImportedNRENL3CoreServiceInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE]
):
"""An imported :term:`NREN` L3 Core Service subscription."""
nren_l3_core_service_type: NRENL3CoreServiceType
nren_l3_core_service: NRENL3CoreServiceBlock
......@@ -45,17 +45,17 @@
"create_site": "Create Site",
"create_switch": "Create Switch",
"create_edge_port": "Create Edge Port",
"create_geant_ip": "Create GÉANT IP",
"create_nren_l3_core_service": "Create NREN L3 Core Service",
"deploy_twamp": "Deploy TWAMP",
"migrate_iptrunk": "Migrate IP Trunk",
"migrate_geant_ip": "Migrate GÉANT IP",
"migrate_nren_l3_core_service": "Migrate NREN L3 Core Service",
"modify_isis_metric": "Modify the ISIS metric",
"modify_site": "Modify Site",
"modify_trunk_interface": "Modify IP Trunk interface",
"modify_connection_strategy": "Modify connection strategy",
"modify_router_kentik_license": "Modify device license in Kentik",
"modify_edge_port": "Modify Edge Port",
"modify_geant_ip": "Modify GÉANT IP",
"modify_nren_l3_core_service": "Modify NREN L3 Core Service",
"terminate_iptrunk": "Terminate IP Trunk",
"terminate_router": "Terminate Router",
"terminate_site": "Terminate Site",
......@@ -70,7 +70,7 @@
"create_imported_office_router": "NOT FOR HUMANS -- Import existing office router",
"create_imported_opengear": "NOT FOR HUMANS -- Import existing OpenGear",
"create_imported_edge_port": "NOT FOR HUMANS -- Import existing Edge Port",
"create_imported_geant_ip": "NOT FOR HUMANS -- Import existing GÉANT IP",
"create_imported_nren_l3_core_service": "NOT FOR HUMANS -- Import existing NREN L3 Core Service",
"import_site": "NOT FOR HUMANS -- Finalize import into a Site product",
"import_router": "NOT FOR HUMANS -- Finalize import into a Router product",
"import_iptrunk": "NOT FOR HUMANS -- Finalize import into an IP trunk product",
......@@ -78,7 +78,7 @@
"import_super_pop_switch": "NOT FOR HUMANS -- Finalize import into a Super PoP switch",
"import_opengear": "NOT FOR HUMANS -- Finalize import into an OpenGear",
"import_edge_port": "NOT FOR HUMANS -- Finalize import into an Edge Port",
"import_geant_ip": "NOT FOR HUMANS -- Finalize import into a GÉANT IP",
"import_nren_l3_core_service": "NOT FOR HUMANS -- Finalize import into a NREN L3 Core Service",
"validate_iptrunk": "Validate IP Trunk configuration",
"validate_router": "Validate Router configuration",
"validate_switch": "Validate Switch configuration",
......
......@@ -85,9 +85,11 @@ LazyWorkflowInstance("gso.workflows.edge_port.validate_edge_port", "validate_edg
LazyWorkflowInstance("gso.workflows.edge_port.create_imported_edge_port", "create_imported_edge_port")
LazyWorkflowInstance("gso.workflows.edge_port.import_edge_port", "import_edge_port")
# GÉANT IP workflows
LazyWorkflowInstance("gso.workflows.geant_ip.create_geant_ip", "create_geant_ip")
LazyWorkflowInstance("gso.workflows.geant_ip.modify_geant_ip", "modify_geant_ip")
LazyWorkflowInstance("gso.workflows.geant_ip.create_imported_geant_ip", "create_imported_geant_ip")
LazyWorkflowInstance("gso.workflows.geant_ip.import_geant_ip", "import_geant_ip")
LazyWorkflowInstance("gso.workflows.geant_ip.migrate_geant_ip", "migrate_geant_ip")
# NREN L3 Core Service workflows
LazyWorkflowInstance("gso.workflows.nren_l3_core_service.create_nren_l3_core_service", "create_nren_l3_core_service")
LazyWorkflowInstance("gso.workflows.nren_l3_core_service.modify_nren_l3_core_service", "modify_nren_l3_core_service")
LazyWorkflowInstance(
"gso.workflows.nren_l3_core_service.create_imported_nren_l3_core_service", "create_imported_nren_l3_core_service"
)
LazyWorkflowInstance("gso.workflows.nren_l3_core_service.import_nren_l3_core_service", "import_nren_l3_core_service")
LazyWorkflowInstance("gso.workflows.nren_l3_core_service.migrate_nren_l3_core_service", "migrate_nren_l3_core_service")
"""GÉANT IP workflows."""
""":term:`NREN` layer 3 core service workflows."""
......@@ -13,10 +13,10 @@ from pydantic_forms.types import UUIDstr
from gso.products import ProductName
from gso.products.product_blocks.bgp_session import BGPSession, IPFamily
from gso.products.product_blocks.geant_ip import NRENAccessPortInactive
from gso.products.product_blocks.nren_l3_core_service import NRENAccessPortInactive
from gso.products.product_blocks.service_binding_port import VLAN_ID, ServiceBindingPortInactive
from gso.products.product_types.edge_port import EdgePort
from gso.products.product_types.geant_ip import ImportedGeantIPInactive
from gso.products.product_types.nren_l3_core_service import ImportedGeantIPInactive
from gso.services.partners import get_partner_by_name
from gso.services.subscriptions import get_product_id_by_name
from gso.utils.shared_enums import SBPType
......
......@@ -14,10 +14,10 @@ from pydantic import AfterValidator, BaseModel, ConfigDict, Field, computed_fiel
from pydantic_forms.validators import Divider
from gso.products.product_blocks.bgp_session import BGPSession, IPFamily
from gso.products.product_blocks.geant_ip import NRENAccessPortInactive
from gso.products.product_blocks.nren_l3_core_service import NRENAccessPortInactive
from gso.products.product_blocks.service_binding_port import VLAN_ID, ServiceBindingPortInactive
from gso.products.product_types.edge_port import EdgePort
from gso.products.product_types.geant_ip import GeantIPInactive
from gso.products.product_types.nren_l3_core_service import GeantIPInactive
from gso.services.lso_client import LSOState, lso_interaction
from gso.utils.helpers import (
active_edge_port_selector,
......
......@@ -7,7 +7,7 @@ from orchestrator.workflows.steps import resync, store_process_subscription, uns
from orchestrator.workflows.utils import wrap_modify_initial_input_form
from gso.products import ProductName
from gso.products.product_types.geant_ip import GeantIP, ImportedGeantIP
from gso.products.product_types.nren_l3_core_service import GeantIP, ImportedGeantIP
from gso.services.subscriptions import get_product_id_by_name
......
......@@ -14,7 +14,7 @@ from pydantic_forms.types import FormGenerator, State, UUIDstr
from pydantic_forms.validators import Choice, Divider
from gso.products.product_types.edge_port import EdgePort
from gso.products.product_types.geant_ip import GeantIP
from gso.products.product_types.nren_l3_core_service import GeantIP
from gso.services.subscriptions import get_active_edge_port_subscriptions
from gso.utils.types.tt_number import TTNumber
......
......@@ -15,10 +15,10 @@ from pydantic_forms.types import State
from pydantic_forms.validators import Divider, Label
from gso.products.product_blocks.bgp_session import BGPSession, IPFamily
from gso.products.product_blocks.geant_ip import NRENAccessPort
from gso.products.product_blocks.nren_l3_core_service import NRENAccessPort
from gso.products.product_blocks.service_binding_port import VLAN_ID, ServiceBindingPort
from gso.products.product_types.edge_port import EdgePort
from gso.products.product_types.geant_ip import GeantIP
from gso.products.product_types.nren_l3_core_service import GeantIP
from gso.utils.helpers import active_edge_port_selector
from gso.utils.shared_enums import APType, SBPType
from gso.utils.types.ip_address import IPv4AddressType, IPV4Netmask, IPv6AddressType, IPV6Netmask
......
......@@ -8,9 +8,9 @@ from orchestrator.types import SubscriptionLifecycle, UUIDstr
from gso.products import EdgePort, ProductName
from gso.products.product_blocks.bgp_session import BGPSession, IPFamily
from gso.products.product_blocks.geant_ip import NRENAccessPort
from gso.products.product_blocks.nren_l3_core_service import NRENAccessPort
from gso.products.product_blocks.service_binding_port import ServiceBindingPort
from gso.products.product_types.geant_ip import GeantIPInactive, ImportedGeantIP
from gso.products.product_types.nren_l3_core_service import GeantIPInactive, ImportedGeantIP
from gso.services import subscriptions
from gso.utils.shared_enums import APType, SBPType
from gso.utils.types.ip_address import IPAddress
......
......@@ -4,7 +4,7 @@ import pytest
from orchestrator.types import SubscriptionLifecycle
from gso.products import ProductName
from gso.products.product_types.geant_ip import GeantIP
from gso.products.product_types.nren_l3_core_service import GeantIP
from gso.services.subscriptions import get_product_id_by_name
from gso.utils.shared_enums import APType
from test.workflows import assert_complete, assert_lso_interaction_success, extract_state, run_workflow
......
import pytest
from gso.products.product_types.geant_ip import GeantIP
from gso.products.product_types.nren_l3_core_service import GeantIP
from test.workflows import assert_complete, extract_state, run_workflow
......
import pytest
from gso.products.product_blocks.bgp_session import IPFamily
from gso.products.product_types.geant_ip import GeantIP
from gso.products.product_types.nren_l3_core_service import GeantIP
from gso.utils.shared_enums import APType
from test.workflows import extract_state, run_workflow
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment