Skip to content
Snippets Groups Projects
Commit 31ca85e7 authored by geant-release-service's avatar geant-release-service
Browse files

Finished release 2.23.

parents 51a8a2f6 5a1f270d
Branches
Tags 2.23
No related merge requests found
Pipeline #90136 passed
Showing
with 460 additions and 57 deletions
# Changelog
## [2.23] - 2024-11-05
- Added new workflows and updated the products of Swich and LAN Swith Interconnect
- Upgraded orchestrator-core to 2.8.0
## [2.22] - 2024-10-31
- Added EdgePort, IAS and GEANT IP products and required workflows
- Refactored pydantic models for maintainability
......
``gso.workflows.lan_switch_interconnect.create_imported_lan_switch_interconnect``
=================================================================================
.. automodule:: gso.workflows.lan_switch_interconnect.create_imported_lan_switch_interconnect
:members:
:show-inheritance:
``gso.workflows.lan_switch_interconnect.create_lan_switch_interconnect``
========================================================================
.. automodule:: gso.workflows.lan_switch_interconnect.create_lan_switch_interconnect
:members:
:show-inheritance:
``gso.workflows.lan_switch_interconnect.import_lan_switch_interconnect``
========================================================================
.. automodule:: gso.workflows.lan_switch_interconnect.import_lan_switch_interconnect
:members:
:show-inheritance:
``gso.workflows.lan_switch_interconnect``
=========================================
.. automodule:: gso.workflows.lan_switch_interconnect
:members:
:show-inheritance:
Submodules
----------
.. toctree::
:maxdepth: 2
:titlesonly:
create_imported_lan_switch_interconnect
create_lan_switch_interconnect
import_lan_switch_interconnect
terminate_lan_switch_interconnect
validate_lan_switch_interconnect
``gso.workflows.lan_switch_interconnect.terminate_lan_switch_interconnect``
===========================================================================
.. automodule:: gso.workflows.lan_switch_interconnect.terminate_lan_switch_interconnect
:members:
:show-inheritance:
``gso.workflows.lan_switch_interconnect.validate_lan_switch_interconnect``
==========================================================================
.. automodule:: gso.workflows.lan_switch_interconnect.validate_lan_switch_interconnect
:members:
:show-inheritance:
``gso.workflows.switch.activate_switch``
========================================
.. automodule:: gso.workflows.switch.activate_switch
:members:
:show-inheritance:
``gso.workflows.switch.create_imported_switch``
===============================================
.. automodule:: gso.workflows.switch.create_imported_switch
:members:
:show-inheritance:
``gso.workflows.switch.create_switch``
======================================
.. automodule:: gso.workflows.switch.create_switch
:members:
:show-inheritance:
``gso.workflows.switch.import_switch``
======================================
.. automodule:: gso.workflows.switch.import_switch
:members:
:show-inheritance:
``gso.workflows.switch``
========================
.. automodule:: gso.workflows.switch
:members:
:show-inheritance:
Submodules
----------
.. toctree::
:maxdepth: 2
:titlesonly:
activate_switch
create_imported_switch
create_switch
import_switch
terminate_switch
validate_switch
``gso.workflows.switch.terminate_switch``
=========================================
.. automodule:: gso.workflows.switch.terminate_switch
:members:
:show-inheritance:
``gso.workflows.switch.validate_switch``
========================================
.. automodule:: gso.workflows.switch.validate_switch
:members:
:show-inheritance:
......@@ -12,7 +12,7 @@ import typer
import yaml
from orchestrator.db import db
from orchestrator.services.processes import start_process
from orchestrator.types import SubscriptionLifecycle
from orchestrator.types import SubscriptionLifecycle, UUIDstr
from pydantic import BaseModel, ValidationError, field_validator, model_validator
from sqlalchemy.exc import SQLAlchemyError
......@@ -23,6 +23,7 @@ from gso.products.product_blocks.edge_port import EdgePortType, EncapsulationTyp
from gso.products.product_blocks.iptrunk import IptrunkType
from gso.products.product_blocks.router import RouterRole
from gso.products.product_blocks.service_binding_port import VLAN_ID
from gso.products.product_blocks.switch import SwitchModel
from gso.products.product_types.nren_l3_core_service import NRENL3CoreServiceType
from gso.services.partners import (
PartnerEmail,
......@@ -39,7 +40,16 @@ from gso.services.subscriptions import (
from gso.utils.shared_enums import SBPType, Vendor
from gso.utils.types.base_site import BaseSiteValidatorModel
from gso.utils.types.interfaces import LAGMember, LAGMemberList, PhysicalPortCapacity
from gso.utils.types.ip_address import IPAddress, IPv4AddressType, IPV4Netmask, IPv6AddressType, IPV6Netmask, PortNumber
from gso.utils.types.ip_address import (
AddressSpace,
IPAddress,
IPv4AddressType,
IPV4Netmask,
IPv4NetworkType,
IPv6AddressType,
IPV6Netmask,
PortNumber,
)
app: typer.Typer = typer.Typer()
......@@ -69,6 +79,16 @@ class RouterImportModel(BaseModel):
router_lo_iso_address: str
class SwitchImportModel(BaseModel):
"""Required fields for importing an existing :class:`gso.product.product_types.switch`."""
fqdn: str
ts_port: PortNumber
site: UUIDstr
switch_vendor: Vendor
switch_model: SwitchModel
class SuperPopSwitchImportModel(BaseModel):
"""Required fields for importing an existing :class:`gso.product.product_types.super_pop_switch`."""
......@@ -278,16 +298,47 @@ class NRENL3CoreServiceImportModel(BaseModel):
return value
class LanSwitchInterconnectRouterSideImportModel(BaseModel):
"""Import LAN Switch Interconnect Router side model."""
node: UUIDstr
ae_iface: str
ae_members: LAGMemberList[LAGMember]
ipv4_address: IPv4AddressType
class LanSwitchInterconnectSwitchSideImportModel(BaseModel):
"""Import LAN Switch Interconnect Switch side model."""
switch: UUIDstr
ae_iface: str
ae_members: LAGMemberList[LAGMember]
ipv4_address: IPv4AddressType
class LanSwitchInterconnectImportModel(BaseModel):
"""Import LAN Switch Interconnect model."""
lan_switch_interconnect_description: str
lan_switch_interconnect_ip_network: IPv4NetworkType | None
address_space: AddressSpace
minimum_links: int
router_side: LanSwitchInterconnectRouterSideImportModel
switch_side: LanSwitchInterconnectSwitchSideImportModel
T = TypeVar(
"T",
SiteImportModel,
RouterImportModel,
SwitchImportModel,
IptrunkImportModel,
SuperPopSwitchImportModel,
OfficeRouterImportModel,
OpenGearImportModel,
EdgePortImportModel,
NRENL3CoreServiceImportModel,
LanSwitchInterconnectImportModel,
)
common_filepath_option = typer.Option(
......@@ -380,6 +431,12 @@ def import_routers(filepath: str = common_filepath_option) -> None:
_generic_import_product(Path(filepath), ProductType.IMPORTED_ROUTER, "router", "hostname", RouterImportModel)
@app.command()
def import_switches(filepath: str = common_filepath_option) -> None:
"""Import switches into GSO."""
_generic_import_product(Path(filepath), ProductType.IMPORTED_SWITCH, "switch", "fqdn", SwitchImportModel)
@app.command()
def import_super_pop_switches(filepath: str = common_filepath_option) -> None:
"""Import Super PoP Switches into GSO."""
......@@ -581,3 +638,15 @@ def import_nren_l3_core_service(filepath: str = common_filepath_option) -> None:
typer.echo("Successfully created imported NREN L3 Core Services:")
for item in successfully_imported_data:
typer.echo(f"- {item}")
@app.command()
def import_lan_switch_interconnect(filepath: str = common_filepath_option) -> None:
"""Import :term:`LAN` Switch Interconnect services into :term:`GSO`."""
_generic_import_product(
Path(filepath),
ProductType.IMPORTED_LAN_SWITCH_INTERCONNECT,
"lan_switch_interconnect",
"lan_switch_interconnect_description",
LanSwitchInterconnectImportModel,
)
"""Add switch workflows.
Revision ID: 0e7e7d749617
Revises: 94d9de9246fe
Create Date: 2024-08-29 15:45:57.581710
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '0e7e7d749617'
down_revision = '94d9de9246fe'
branch_labels = None
depends_on = None
from orchestrator.migrations.helpers import create_workflow, delete_workflow
new_workflows = [
{
"name": "create_switch",
"target": "CREATE",
"description": "Create Switch",
"product_type": "Switch"
},
{
"name": "activate_switch",
"target": "MODIFY",
"description": "Activate switch",
"product_type": "Switch"
},
{
"name": "terminate_switch",
"target": "TERMINATE",
"description": "Terminate switch",
"product_type": "Switch"
},
{
"name": "validate_switch",
"target": "SYSTEM",
"description": "Validate switch subscription",
"product_type": "Switch"
},
{
"name": "create_imported_switch",
"target": "CREATE",
"description": "Create Imported Switch",
"product_type": "ImportedSwitch"
},
{
"name": "import_switch",
"target": "MODIFY",
"description": "Import Switch",
"product_type": "ImportedSwitch"
},
{
"name": "create_lan_switch_interconnect",
"target": "CREATE",
"description": "Create LAN Switch Interconnect",
"product_type": "LanSwitchInterconnect"
},
{
"name": "terminate_lan_switch_interconnect",
"target": "TERMINATE",
"description": "Terminate LAN Switch Interconnect",
"product_type": "LanSwitchInterconnect"
},
{
"name": "validate_lan_switch_interconnect",
"target": "SYSTEM",
"description": "Validate LAN Switch Interconnect",
"product_type": "LanSwitchInterconnect"
},
{
"name": "validate_lan_switch_interconnect",
"target": "SYSTEM",
"description": "Validate LAN Switch Interconnect",
"product_type": "LanSwitchInterconnect"
},
{
"name": "create_imported_lan_switch_interconnect",
"target": "CREATE",
"description": "Create Imported LAN Switch Interconnect",
"product_type": "ImportedLanSwitchInterconnect"
},
{
"name": "import_lan_switch_interconnect",
"target": "MODIFY",
"description": "Import LAN Switch Interconnect",
"product_type": "ImportedLanSwitchInterconnect"
}
]
def upgrade() -> None:
conn = op.get_bind()
for workflow in new_workflows:
create_workflow(conn, workflow)
def downgrade() -> None:
conn = op.get_bind()
for workflow in new_workflows:
delete_workflow(conn, workflow["name"])
"""Add Imported Switches, update domain models.
Revision ID: 94d9de9246fe
Revises: 7412c5b7ebe4
Create Date: 2024-10-29 15:45:28.294699
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '94d9de9246fe'
down_revision = '7412c5b7ebe4'
branch_labels = None
depends_on = None
def upgrade() -> None:
conn = op.get_bind()
conn.execute(sa.text("""
UPDATE resource_types SET resource_type='ts_port' WHERE resource_types.resource_type = 'switch_ts_port'
"""))
conn.execute(sa.text("""
UPDATE resource_types SET resource_type='fqdn' WHERE resource_types.resource_type = 'switch_hostname'
"""))
conn.execute(sa.text("""
INSERT INTO products (name, description, product_type, tag, status) VALUES ('Imported Switch', 'An existing Switch that is imported into the subscription database', 'ImportedSwitch', 'IMP_SWITCH', 'active') RETURNING products.product_id
"""))
conn.execute(sa.text("""
INSERT INTO resource_types (resource_type, description) VALUES ('lan_switch_interconnect_ip_network', 'IP resources for a LAN Switch interconnect') RETURNING resource_types.resource_type_id
"""))
conn.execute(sa.text("""
INSERT INTO product_product_blocks (product_id, product_block_id) VALUES ((SELECT products.product_id FROM products WHERE products.name IN ('Imported Switch')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('SwitchBlock')))
"""))
conn.execute(sa.text("""
INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('lan_switch_interconnect_ip_network')))
"""))
conn.execute(sa.text("""
INSERT INTO products (name, description, product_type, tag, status) VALUES ('Imported LAN Switch Interconnect', 'An existing LAN Switch Interconnect that is imported into the subscription database', 'ImportedLanSwitchInterconnect', 'IMP_LSI', 'active') RETURNING products.product_id
"""))
conn.execute(sa.text("""
INSERT INTO product_product_blocks (product_id, product_block_id) VALUES ((SELECT products.product_id FROM products WHERE products.name IN ('Imported LAN Switch Interconnect')), (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectBlock')))
"""))
conn.execute(sa.text("""
INSERT INTO product_block_resource_types (product_block_id, resource_type_id) VALUES ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectSwitchSideBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_address'))), ((SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectRouterSideBlock')), (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_address')))
"""))
def downgrade() -> None:
conn = op.get_bind()
conn.execute(sa.text("""
DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectSwitchSideBlock', 'LanSwitchInterconnectRouterSideBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_address'))
"""))
conn.execute(sa.text("""
DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectSwitchSideBlock', 'LanSwitchInterconnectRouterSideBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('ipv4_address'))
"""))
conn.execute(sa.text("""
DELETE FROM product_product_blocks WHERE product_product_blocks.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported LAN Switch Interconnect')) AND product_product_blocks.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectBlock'))
"""))
conn.execute(sa.text("""
DELETE FROM processes WHERE processes.pid IN (SELECT processes_subscriptions.pid FROM processes_subscriptions WHERE processes_subscriptions.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported LAN Switch Interconnect'))))
"""))
conn.execute(sa.text("""
DELETE FROM processes_subscriptions WHERE processes_subscriptions.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported LAN Switch Interconnect')))
"""))
conn.execute(sa.text("""
DELETE FROM subscription_instances WHERE subscription_instances.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported LAN Switch Interconnect')))
"""))
conn.execute(sa.text("""
DELETE FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported LAN Switch Interconnect'))
"""))
conn.execute(sa.text("""
DELETE FROM products WHERE products.name IN ('Imported LAN Switch Interconnect')
"""))
conn.execute(sa.text("""
DELETE FROM product_block_resource_types WHERE product_block_resource_types.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectBlock')) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('lan_switch_interconnect_ip_network'))
"""))
conn.execute(sa.text("""
DELETE FROM subscription_instance_values USING product_block_resource_types WHERE subscription_instance_values.subscription_instance_id IN (SELECT subscription_instances.subscription_instance_id FROM subscription_instances WHERE subscription_instances.subscription_instance_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('LanSwitchInterconnectBlock'))) AND product_block_resource_types.resource_type_id = (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('lan_switch_interconnect_ip_network'))
"""))
conn.execute(sa.text("""
DELETE FROM subscription_instance_values WHERE subscription_instance_values.resource_type_id IN (SELECT resource_types.resource_type_id FROM resource_types WHERE resource_types.resource_type IN ('lan_switch_interconnect_ip_network'))
"""))
conn.execute(sa.text("""
DELETE FROM resource_types WHERE resource_types.resource_type IN ('lan_switch_interconnect_ip_network')
"""))
conn.execute(sa.text("""
DELETE FROM product_product_blocks WHERE product_product_blocks.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported Switch')) AND product_product_blocks.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('SwitchBlock'))
"""))
conn.execute(sa.text("""
DELETE FROM processes WHERE processes.pid IN (SELECT processes_subscriptions.pid FROM processes_subscriptions WHERE processes_subscriptions.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported Switch'))))
"""))
conn.execute(sa.text("""
DELETE FROM processes_subscriptions WHERE processes_subscriptions.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported Switch')))
"""))
conn.execute(sa.text("""
DELETE FROM subscription_instances WHERE subscription_instances.subscription_id IN (SELECT subscriptions.subscription_id FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported Switch')))
"""))
conn.execute(sa.text("""
DELETE FROM subscriptions WHERE subscriptions.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('Imported Switch'))
"""))
conn.execute(sa.text("""
DELETE FROM products WHERE products.name IN ('Imported Switch')
"""))
conn.execute(sa.text("""
UPDATE resource_types SET resource_type='switch_ts_port' WHERE resource_types.resource_type = 'ts_port'
"""))
conn.execute(sa.text("""
UPDATE resource_types SET resource_type='switch_hostname' WHERE resource_types.resource_type = 'fqdn'
"""))
......@@ -10,7 +10,7 @@ from pydantic_forms.types import strEnum
from gso.products.product_types.edge_port import EdgePort, ImportedEdgePort
from gso.products.product_types.iptrunk import ImportedIptrunk, Iptrunk
from gso.products.product_types.lan_switch_interconnect import LanSwitchInterconnect
from gso.products.product_types.lan_switch_interconnect import ImportedLanSwitchInterconnect, 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
......@@ -18,7 +18,7 @@ from gso.products.product_types.pop_vlan import PopVlan
from gso.products.product_types.router import ImportedRouter, Router
from gso.products.product_types.site import ImportedSite, Site
from gso.products.product_types.super_pop_switch import ImportedSuperPopSwitch, SuperPopSwitch
from gso.products.product_types.switch import Switch
from gso.products.product_types.switch import ImportedSwitch, Switch
class ProductName(strEnum):
......@@ -30,7 +30,9 @@ class ProductName(strEnum):
SUPER_POP_SWITCH = "Super PoP switch"
OFFICE_ROUTER = "Office router"
SWITCH = "Switch"
IMPORTED_SWITCH = "Imported Switch"
LAN_SWITCH_INTERCONNECT = "LAN Switch Interconnect"
IMPORTED_LAN_SWITCH_INTERCONNECT = "Imported LAN Switch Interconnect"
POP_VLAN = "Pop VLAN"
IMPORTED_IP_TRUNK = "Imported IP trunk"
IMPORTED_ROUTER = "Imported router"
......@@ -56,7 +58,9 @@ class ProductType(strEnum):
SUPER_POP_SWITCH = SuperPopSwitch.__name__
OFFICE_ROUTER = OfficeRouter.__name__
SWITCH = Switch.__name__
IMPORTED_SWITCH = ImportedSwitch.__name__
LAN_SWITCH_INTERCONNECT = LanSwitchInterconnect.__name__
IMPORTED_LAN_SWITCH_INTERCONNECT = ImportedLanSwitchInterconnect.__name__
POP_VLAN = PopVlan.__name__
IMPORTED_IP_TRUNK = ImportedIptrunk.__name__
IMPORTED_ROUTER = ImportedRouter.__name__
......@@ -81,7 +85,9 @@ SUBSCRIPTION_MODEL_REGISTRY.update(
ProductName.SUPER_POP_SWITCH.value: SuperPopSwitch,
ProductName.OFFICE_ROUTER.value: OfficeRouter,
ProductName.SWITCH.value: Switch,
ProductName.IMPORTED_SWITCH.value: ImportedSwitch,
ProductName.LAN_SWITCH_INTERCONNECT.value: LanSwitchInterconnect,
ProductName.IMPORTED_LAN_SWITCH_INTERCONNECT.value: ImportedLanSwitchInterconnect,
ProductName.POP_VLAN.value: PopVlan,
ProductName.IMPORTED_IP_TRUNK.value: ImportedIptrunk,
ProductName.IMPORTED_ROUTER.value: ImportedRouter,
......
"""LAN Switch Interconnect product block that has all parameters of a subscription throughout its lifecycle."""
from orchestrator.domain.base import ProductBlockModel
from orchestrator.types import SubscriptionLifecycle, strEnum
from orchestrator.types import SubscriptionLifecycle
from gso.products.product_blocks.router import RouterBlock, RouterBlockInactive, RouterBlockProvisioning
from gso.products.product_blocks.switch import SwitchBlock, SwitchBlockInactive, SwitchBlockProvisioning
from gso.utils.types.interfaces import LAGMemberList
class LanSwitchInterconnectAddressSpace(strEnum):
"""Types of LAN Switch Interconnect. Can be private or public."""
PRIVATE = "Private"
PUBLIC = "Public"
from gso.utils.types.ip_address import AddressSpace, IPv4AddressType, IPv4NetworkType
class LanSwitchInterconnectInterfaceBlockInactive(
......@@ -20,7 +14,7 @@ class LanSwitchInterconnectInterfaceBlockInactive(
lifecycle=[SubscriptionLifecycle.INITIAL],
product_block_name="LanSwitchInterconnectInterfaceBlock",
):
"""An inactive LAN Switch Interconnect interface."""
"""An inactive :term:`LAN` Switch Interconnect interface."""
interface_name: str | None = None
interface_description: str | None = None
......@@ -29,7 +23,7 @@ class LanSwitchInterconnectInterfaceBlockInactive(
class LanSwitchInterconnectInterfaceBlockProvisioning(
LanSwitchInterconnectInterfaceBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]
):
"""A LAN Switch Interconnect interface that is being provisioned."""
"""A :term:`LAN` Switch Interconnect interface that is being provisioned."""
interface_name: str
interface_description: str
......@@ -49,31 +43,34 @@ class LanSwitchInterconnectRouterSideBlockInactive(
lifecycle=[SubscriptionLifecycle.INITIAL],
product_block_name="LanSwitchInterconnectRouterSideBlock",
):
"""An inactive LAN Switch Interconnect router side."""
"""An inactive :term:`LAN` Switch Interconnect router side."""
node: RouterBlockInactive
ae_iface: str | None = None
ae_members: LAGMemberList[LanSwitchInterconnectInterfaceBlockInactive]
ipv4_address: IPv4AddressType | None = None
class LanSwitchInterconnectRouterSideBlockProvisioning(
LanSwitchInterconnectRouterSideBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]
):
"""An LAN Switch Interconnect router side that is being provisioned."""
"""A :term:`LAN` Switch Interconnect router side that is being provisioned."""
node: RouterBlockProvisioning
ae_iface: str | None = None
ae_members: LAGMemberList[LanSwitchInterconnectInterfaceBlockProvisioning] # type: ignore[assignment]
ipv4_address: IPv4AddressType | None
class LanSwitchInterconnectRouterSideBlock(
LanSwitchInterconnectRouterSideBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]
):
"""An active LAN Switch Interconnect router side."""
"""An active :term:`LAN` Switch Interconnect router side."""
node: RouterBlock
ae_iface: str
ae_members: LAGMemberList[LanSwitchInterconnectInterfaceBlock] # type: ignore[assignment]
ipv4_address: IPv4AddressType | None
class LanSwitchInterconnectSwitchSideBlockInactive(
......@@ -81,31 +78,34 @@ class LanSwitchInterconnectSwitchSideBlockInactive(
lifecycle=[SubscriptionLifecycle.INITIAL],
product_block_name="LanSwitchInterconnectSwitchSideBlock",
):
"""An inactive LAN Switch Interconnect switch side."""
"""An inactive :term:`LAN` Switch Interconnect switch side."""
node: SwitchBlockInactive
switch: SwitchBlockInactive
ae_iface: str | None = None
ae_members: LAGMemberList[LanSwitchInterconnectInterfaceBlockInactive]
ipv4_address: IPv4AddressType | None = None
class LanSwitchInterconnectSwitchSideBlockProvisioning(
LanSwitchInterconnectSwitchSideBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]
):
"""An LAN Switch Interconnect switch side that is being provisioned."""
"""A :term:`LAN` Switch Interconnect switch side that is being provisioned."""
node: SwitchBlockProvisioning
switch: SwitchBlockProvisioning
ae_iface: str | None = None
ae_members: LAGMemberList[LanSwitchInterconnectInterfaceBlockProvisioning] # type: ignore[assignment]
ipv4_address: IPv4AddressType | None
class LanSwitchInterconnectSwitchSideBlock(
LanSwitchInterconnectSwitchSideBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]
):
"""An active LAN Switch Interconnect switch side."""
"""An active :term:`LAN` Switch Interconnect switch side."""
node: SwitchBlock
switch: SwitchBlock
ae_iface: str
ae_members: LAGMemberList[LanSwitchInterconnectInterfaceBlock] # type: ignore[assignment]
ipv4_address: IPv4AddressType | None
class LanSwitchInterconnectBlockInactive(
......@@ -113,10 +113,11 @@ class LanSwitchInterconnectBlockInactive(
lifecycle=[SubscriptionLifecycle.INITIAL],
product_block_name="LanSwitchInterconnectBlock",
):
"""A LAN Switch Interconnect that's currently inactive, see :class:`LanSwitchInterconnectBlock`."""
"""A :term:`LAN` Switch Interconnect that's currently inactive, see :class:`LanSwitchInterconnectBlock`."""
lan_switch_interconnect_description: str | None = None
address_space: LanSwitchInterconnectAddressSpace | None = None
lan_switch_interconnect_ip_network: IPv4NetworkType | None = None
address_space: AddressSpace | None = None
minimum_links: int | None = None
router_side: LanSwitchInterconnectRouterSideBlockInactive
switch_side: LanSwitchInterconnectSwitchSideBlockInactive
......@@ -125,25 +126,28 @@ class LanSwitchInterconnectBlockInactive(
class LanSwitchInterconnectBlockProvisioning(
LanSwitchInterconnectBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]
):
"""A LAN Switch Interconnect that's currently being provisioned, see :class:`LanSwitchInterconnectBlock`."""
"""A :term:`LAN` Switch Interconnect that's currently being provisioned, see :class:`LanSwitchInterconnectBlock`."""
lan_switch_interconnect_description: str | None = None
address_space: LanSwitchInterconnectAddressSpace | None = None
lan_switch_interconnect_ip_network: IPv4NetworkType | None
address_space: AddressSpace | None = None
minimum_links: int | None = None
router_side: LanSwitchInterconnectRouterSideBlockProvisioning
switch_side: LanSwitchInterconnectSwitchSideBlockProvisioning
class LanSwitchInterconnectBlock(LanSwitchInterconnectBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""A LAN Switch Interconnect that's currently deployed in the network."""
"""A :term:`LAN` Switch Interconnect that's currently deployed in the network."""
#: A human-readable description of this LAN Switch Interconnect.
#: A human-readable description of this :term:`LAN` Switch Interconnect.
lan_switch_interconnect_description: str
#: The address space of the VLAN Switch Interconnect. It can be private or public.
address_space: LanSwitchInterconnectAddressSpace
#: The minimum amount of links the LAN Switch Interconnect should consist of.
#: The :term:`IP` resources for this :term:`VLAN` Switch Interconnect.
lan_switch_interconnect_ip_network: IPv4NetworkType | None
#: The address space of the :term:`VLAN` Switch Interconnect. It can be private or public.
address_space: AddressSpace
#: The minimum amount of links the :term:`LAN` Switch Interconnect should consist of.
minimum_links: int
#: The router side of the LAN Switch Interconnect.
#: The router side of the :term:`LAN` Switch Interconnect.
router_side: LanSwitchInterconnectRouterSideBlock
#: The switch side of the LAN Switch Interconnect.
#: The switch side of the :term:`LAN` Switch Interconnect.
switch_side: LanSwitchInterconnectSwitchSideBlock
"""Pop VLAN product block that has all parameters of a subscription throughout its lifecycle."""
"""Pop :term:`VLAN` product block that has all parameters of a subscription throughout its lifecycle."""
from ipaddress import IPv4Network, IPv6Network
from typing import Annotated, TypeVar
......@@ -32,7 +32,7 @@ PortList = Annotated[list[T], AfterValidator(validate_unique_list), Doc("A list
class PopVlanPortBlockInactive(
ProductBlockModel, lifecycle=[SubscriptionLifecycle.INITIAL], product_block_name="PopVlanPortBlock"
):
"""An inactive Pop VLAN port."""
"""An inactive Pop :term:`VLAN` port."""
port_name: str | None = None
port_description: str | None = None
......@@ -40,15 +40,15 @@ class PopVlanPortBlockInactive(
class PopVlanPortBlockProvisioning(PopVlanPortBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A Pop VLAN port that is being provisioned."""
"""A Pop :term:`VLAN` port that is being provisioned."""
port_name: str | None = None
port_description: str | None = None
tagged: bool | None = None
port_name: str | None
port_description: str | None
tagged: bool | None
class PopVlanPortBlock(PopVlanPortBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""An active Pop VLAN port."""
"""An active Pop :term:`VLAN` port."""
port_name: str
port_description: str
......@@ -60,10 +60,10 @@ class PopVlanBlockInactive(
lifecycle=[SubscriptionLifecycle.INITIAL],
product_block_name="PopVlanBlock",
):
"""A Pop VLAN that's currently inactive, see :class:`PopVlanBlock`."""
"""A Pop :term:`VLAN` that's currently inactive, see :class:`PopVlanBlock`."""
vlan_id: int
pop_vlan_description: str | None
pop_vlan_description: str | None = None
lan_switch_interconnect: LanSwitchInterconnectBlockInactive
ports: PortList[PopVlanPortBlockProvisioning]
layer_preference: LayerPreference
......@@ -72,31 +72,31 @@ class PopVlanBlockInactive(
class PopVlanBlockProvisioning(PopVlanBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
"""A Pop VLAN that's currently being provisioned, see :class:`PopVlanBlock`."""
"""A Pop :term:`VLAN` that's currently being provisioned, see :class:`PopVlanBlock`."""
vlan_id: int
pop_vlan_description: str | None = None
pop_vlan_description: str | None
lan_switch_interconnect: LanSwitchInterconnectBlockProvisioning
ports: PortList[PopVlanPortBlockProvisioning]
layer_preference: LayerPreference
ipv4_network: IPv4Network | None = None
ipv6_network: IPv6Network | None = None
ipv4_network: IPv4Network | None
ipv6_network: IPv6Network | None
class PopVlanBlock(PopVlanBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
"""A Pop VLAN that's currently deployed in the network."""
"""A Pop :term:`VLAN` that's currently deployed in the network."""
#: The VLAN ID of the Pop VLAN.
#: The :term:`VLAN` ID of the Pop :term:`VLAN`.
vlan_id: int
#: The description of the Pop VLAN.
#: The description of the Pop :term:`VLAN`.
pop_vlan_description: str
#: The LAN Switch Interconnect that this Pop VLAN is connected to.
#: The :term:`LAN` Switch Interconnect that this Pop :term:`VLAN` is connected to.
lan_switch_interconnect: LanSwitchInterconnectBlock
#: The ports of the Pop VLAN.
#: The ports of the Pop :term:`VLAN`.
ports: PortList[PopVlanPortBlock] # type: ignore[assignment]
#: The level of the layer preference for the Pop VLAN (L2 or L3).
#: The level of the layer preference for the Pop :term:`VLAN` (L2 or L3).
layer_preference: LayerPreference
#: IPv4 network for the Pop VLAN if layer preference is L3.
ipv4_network: IPv4Network | None = None
#: IPv6 network for the Pop VLAN if layer preference is L3.
ipv6_network: IPv6Network | None = None
#: IPv4 network for the Pop :term:`VLAN` if layer preference is L3.
ipv4_network: IPv4Network | None
#: IPv6 network for the Pop :term:`VLAN` if layer preference is L3.
ipv6_network: IPv6Network | None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment