-
Mohammad Torkashvand authoredMohammad Torkashvand authored
__init__.py 10.83 KiB
"""Initialisation class that imports all workflows into GSO."""
from orchestrator.services.subscriptions import WF_USABLE_MAP, WF_USABLE_WHILE_OUT_OF_SYNC
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],
"activate_switch": [SubscriptionLifecycle.PROVISIONING],
"terminate_site": ALL_ALIVE_STATES,
"terminate_router": ALL_ALIVE_STATES,
"terminate_iptrunk": ALL_ALIVE_STATES,
"terminate_switch": ALL_ALIVE_STATES,
"terminate_lan_switch_interconnect": ALL_ALIVE_STATES,
"promote_p_to_pe": [SubscriptionLifecycle.ACTIVE],
"validate_router": [SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE],
"validate_iptrunk": [SubscriptionLifecycle.PROVISIONING, SubscriptionLifecycle.ACTIVE],
})
WF_USABLE_WHILE_OUT_OF_SYNC.extend(["validate_geant_ip_prefix_list"])
# 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")
LazyWorkflowInstance("gso.workflows.router.promote_p_to_pe", "promote_p_to_pe")
LazyWorkflowInstance("gso.workflows.router.modify_kentik_license", "modify_router_kentik_license")
LazyWorkflowInstance("gso.workflows.router.run_moodi", "run_moodi")
LazyWorkflowInstance("gso.workflows.router.terminate_moodi", "terminate_moodi")
# Switch workflows
LazyWorkflowInstance("gso.workflows.switch.create_switch", "create_switch")
LazyWorkflowInstance("gso.workflows.switch.activate_switch", "activate_switch")
LazyWorkflowInstance("gso.workflows.switch.terminate_switch", "terminate_switch")
LazyWorkflowInstance("gso.workflows.switch.validate_switch", "validate_switch")
LazyWorkflowInstance("gso.workflows.switch.create_imported_switch", "create_imported_switch")
LazyWorkflowInstance("gso.workflows.switch.import_switch", "import_switch")
# LAN Switch Interconnect workflows
LazyWorkflowInstance(
"gso.workflows.lan_switch_interconnect.create_lan_switch_interconnect", "create_lan_switch_interconnect"
)
LazyWorkflowInstance(
"gso.workflows.lan_switch_interconnect.terminate_lan_switch_interconnect", "terminate_lan_switch_interconnect"
)
LazyWorkflowInstance(
"gso.workflows.lan_switch_interconnect.validate_lan_switch_interconnect", "validate_lan_switch_interconnect"
)
LazyWorkflowInstance(
"gso.workflows.lan_switch_interconnect.create_imported_lan_switch_interconnect",
"create_imported_lan_switch_interconnect",
)
LazyWorkflowInstance(
"gso.workflows.lan_switch_interconnect.import_lan_switch_interconnect", "import_lan_switch_interconnect"
)
# 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.send_email_notifications", "task_send_email_notifications")
LazyWorkflowInstance("gso.workflows.tasks.validate_geant_products", "task_validate_geant_products")
LazyWorkflowInstance("gso.workflows.tasks.create_partners", "task_create_partners")
LazyWorkflowInstance("gso.workflows.tasks.modify_partners", "task_modify_partners")
LazyWorkflowInstance("gso.workflows.tasks.delete_partners", "task_delete_partners")
LazyWorkflowInstance("gso.workflows.tasks.clean_old_tasks", "task_clean_old_tasks")
LazyWorkflowInstance("gso.workflows.tasks.check_site_connectivity", "task_check_site_connectivity")
# Edge port workflows
LazyWorkflowInstance("gso.workflows.edge_port.create_edge_port", "create_edge_port")
LazyWorkflowInstance("gso.workflows.edge_port.modify_edge_port", "modify_edge_port")
LazyWorkflowInstance("gso.workflows.edge_port.terminate_edge_port", "terminate_edge_port")
LazyWorkflowInstance("gso.workflows.edge_port.validate_edge_port", "validate_edge_port")
LazyWorkflowInstance("gso.workflows.edge_port.create_imported_edge_port", "create_imported_edge_port")
LazyWorkflowInstance("gso.workflows.edge_port.import_edge_port", "import_edge_port")
LazyWorkflowInstance("gso.workflows.edge_port.migrate_edge_port", "migrate_edge_port")
# IAS workflows
LazyWorkflowInstance("gso.workflows.l3_core_service.ias.create_ias", "create_ias")
LazyWorkflowInstance("gso.workflows.l3_core_service.ias.modify_ias", "modify_ias")
LazyWorkflowInstance("gso.workflows.l3_core_service.ias.terminate_ias", "terminate_ias")
LazyWorkflowInstance("gso.workflows.l3_core_service.ias.migrate_ias", "migrate_ias")
LazyWorkflowInstance("gso.workflows.l3_core_service.ias.create_imported_ias", "create_imported_ias")
LazyWorkflowInstance("gso.workflows.l3_core_service.ias.import_ias", "import_ias")
LazyWorkflowInstance("gso.workflows.l3_core_service.ias.validate_ias", "validate_ias")
# Copernicus workflows
LazyWorkflowInstance("gso.workflows.l3_core_service.copernicus.create_copernicus", "create_copernicus")
LazyWorkflowInstance("gso.workflows.l3_core_service.copernicus.modify_copernicus", "modify_copernicus")
LazyWorkflowInstance("gso.workflows.l3_core_service.copernicus.terminate_copernicus", "terminate_copernicus")
LazyWorkflowInstance("gso.workflows.l3_core_service.copernicus.migrate_copernicus", "migrate_copernicus")
LazyWorkflowInstance(
"gso.workflows.l3_core_service.copernicus.create_imported_copernicus", "create_imported_copernicus"
)
LazyWorkflowInstance("gso.workflows.l3_core_service.copernicus.import_copernicus", "import_copernicus")
LazyWorkflowInstance("gso.workflows.l3_core_service.copernicus.validate_copernicus", "validate_copernicus")
# LHCOne workflows
LazyWorkflowInstance("gso.workflows.l3_core_service.lhcone.create_lhcone", "create_lhcone")
LazyWorkflowInstance("gso.workflows.l3_core_service.lhcone.modify_lhcone", "modify_lhcone")
LazyWorkflowInstance("gso.workflows.l3_core_service.lhcone.terminate_lhcone", "terminate_lhcone")
LazyWorkflowInstance("gso.workflows.l3_core_service.lhcone.migrate_lhcone", "migrate_lhcone")
LazyWorkflowInstance("gso.workflows.l3_core_service.lhcone.create_imported_lhcone", "create_imported_lhcone")
LazyWorkflowInstance("gso.workflows.l3_core_service.lhcone.import_lhcone", "import_lhcone")
LazyWorkflowInstance("gso.workflows.l3_core_service.lhcone.validate_lhcone", "validate_lhcone")
# GÉANT IP workflows
LazyWorkflowInstance("gso.workflows.l3_core_service.geant_ip.create_geant_ip", "create_geant_ip")
LazyWorkflowInstance("gso.workflows.l3_core_service.geant_ip.modify_geant_ip", "modify_geant_ip")
LazyWorkflowInstance("gso.workflows.l3_core_service.geant_ip.terminate_geant_ip", "terminate_geant_ip")
LazyWorkflowInstance("gso.workflows.l3_core_service.geant_ip.migrate_geant_ip", "migrate_geant_ip")
LazyWorkflowInstance("gso.workflows.l3_core_service.geant_ip.create_imported_geant_ip", "create_imported_geant_ip")
LazyWorkflowInstance("gso.workflows.l3_core_service.geant_ip.import_geant_ip", "import_geant_ip")
LazyWorkflowInstance("gso.workflows.l3_core_service.geant_ip.validate_geant_ip", "validate_geant_ip")
LazyWorkflowInstance("gso.workflows.l3_core_service.geant_ip.validate_prefix_list", "validate_geant_ip_prefix_list")
# Layer 2 Circuit workflows
LazyWorkflowInstance("gso.workflows.l2_circuit.create_layer_2_circuit", "create_layer_2_circuit")
LazyWorkflowInstance("gso.workflows.l2_circuit.modify_layer_2_circuit", "modify_layer_2_circuit")
LazyWorkflowInstance("gso.workflows.l2_circuit.terminate_layer_2_circuit", "terminate_layer_2_circuit")
LazyWorkflowInstance("gso.workflows.l2_circuit.migrate_layer_2_circuit", "migrate_layer_2_circuit")
LazyWorkflowInstance("gso.workflows.l2_circuit.create_imported_layer_2_circuit", "create_imported_layer_2_circuit")
LazyWorkflowInstance("gso.workflows.l2_circuit.import_layer_2_circuit", "import_layer_2_circuit")
# VRF workflows
LazyWorkflowInstance("gso.workflows.vrf.create_vrf", "create_vrf")
LazyWorkflowInstance("gso.workflows.vrf.modify_vrf_router_list", "modify_vrf_router_list")
LazyWorkflowInstance("gso.workflows.vrf.redeploy_vrf", "redeploy_vrf")
LazyWorkflowInstance("gso.workflows.vrf.terminate_vrf", "terminate_vrf")