Skip to content
Snippets Groups Projects
__init__.py 3.81 KiB
"""Initialisation class that imports all workflows into :term:`GSO`."""

from orchestrator.services.subscriptions import WF_USABLE_MAP
from orchestrator.types import SubscriptionLifecycle
from orchestrator.workflows import LazyWorkflowInstance

ALL_ALIVE_STATES: list[str] = [
    SubscriptionLifecycle.INITIAL,
    SubscriptionLifecycle.PROVISIONING,
    SubscriptionLifecycle.ACTIVE,
]

WF_USABLE_MAP.update({
    "redeploy_base_config": [SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE],
    "update_ibgp_mesh": [SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE],
    "activate_router": [SubscriptionLifecycle.PROVISIONING],
    "deploy_twamp": [SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE],
    "modify_trunk_interface": [SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE],
    "activate_iptrunk": [SubscriptionLifecycle.PROVISIONING],
    "terminate_site": ALL_ALIVE_STATES,
    "terminate_router": ALL_ALIVE_STATES,
    "terminate_iptrunk": ALL_ALIVE_STATES,
})

#  IP trunk workflows
LazyWorkflowInstance("gso.workflows.iptrunk.activate_iptrunk", "activate_iptrunk")
LazyWorkflowInstance("gso.workflows.iptrunk.create_iptrunk", "create_iptrunk")
LazyWorkflowInstance("gso.workflows.iptrunk.deploy_twamp", "deploy_twamp")
LazyWorkflowInstance("gso.workflows.iptrunk.modify_isis_metric", "modify_isis_metric")
LazyWorkflowInstance("gso.workflows.iptrunk.modify_trunk_interface", "modify_trunk_interface")
LazyWorkflowInstance("gso.workflows.iptrunk.migrate_iptrunk", "migrate_iptrunk")
LazyWorkflowInstance("gso.workflows.iptrunk.terminate_iptrunk", "terminate_iptrunk")
LazyWorkflowInstance("gso.workflows.iptrunk.create_imported_iptrunk", "create_imported_iptrunk")
LazyWorkflowInstance("gso.workflows.iptrunk.import_iptrunk", "import_iptrunk")
LazyWorkflowInstance("gso.workflows.iptrunk.validate_iptrunk", "validate_iptrunk")

#  Router workflows
LazyWorkflowInstance("gso.workflows.router.activate_router", "activate_router")
LazyWorkflowInstance("gso.workflows.router.create_router", "create_router")
LazyWorkflowInstance("gso.workflows.router.redeploy_base_config", "redeploy_base_config")
LazyWorkflowInstance("gso.workflows.router.terminate_router", "terminate_router")
LazyWorkflowInstance("gso.workflows.router.update_ibgp_mesh", "update_ibgp_mesh")
LazyWorkflowInstance("gso.workflows.router.modify_connection_strategy", "modify_connection_strategy")
LazyWorkflowInstance("gso.workflows.router.import_router", "import_router")
LazyWorkflowInstance("gso.workflows.router.create_imported_router", "create_imported_router")
LazyWorkflowInstance("gso.workflows.router.validate_router", "validate_router")

#  Site workflows
LazyWorkflowInstance("gso.workflows.site.create_site", "create_site")
LazyWorkflowInstance("gso.workflows.site.modify_site", "modify_site")
LazyWorkflowInstance("gso.workflows.site.terminate_site", "terminate_site")
LazyWorkflowInstance("gso.workflows.site.create_imported_site", "create_imported_site")
LazyWorkflowInstance("gso.workflows.site.import_site", "import_site")

#  Super PoP switch workflows
LazyWorkflowInstance("gso.workflows.super_pop_switch.import_super_pop_switch", "import_super_pop_switch")
LazyWorkflowInstance(
    "gso.workflows.super_pop_switch.create_imported_super_pop_switch", "create_imported_super_pop_switch"
)

#  Office router workflows
LazyWorkflowInstance("gso.workflows.office_router.import_office_router", "import_office_router")
LazyWorkflowInstance("gso.workflows.office_router.create_imported_office_router", "create_imported_office_router")

#  Opengear workflows
LazyWorkflowInstance("gso.workflows.opengear.create_imported_opengear", "create_imported_opengear")
LazyWorkflowInstance("gso.workflows.opengear.import_opengear", "import_opengear")

#  Tasks
LazyWorkflowInstance("gso.workflows.tasks.validate_geant_products", "task_validate_geant_products")