Skip to content

Modify re to ias interconnect

A workflow that modifies the RE to IAS interconnect setting of a router.

update_re_to_ias_interconnect(subscription, re_to_ias_interconnect)

Update the R&E to IAS interconnect setting of a router.

Source code in gso/workflows/router/modify_re_to_ias_interconnect.py
@step("Update R&E to IAS interconnect setting")
def update_re_to_ias_interconnect(subscription: Router, re_to_ias_interconnect: bool) -> State:  # noqa: FBT001
    """Update the R&E to IAS interconnect setting of a router."""
    subscription.router.router_re_to_ias_interconnect = re_to_ias_interconnect

    return {"subscription": subscription}

update_re_to_ias_interconnect_dry(subscription, tt_number, process_id)

Dry run of updating the R&E to IAS interconnect setting of a router.

Source code in gso/workflows/router/modify_re_to_ias_interconnect.py
@step("[DRY RUN] Update R&E to IAS interconnect setting")
def update_re_to_ias_interconnect_dry(
    subscription: dict[str, Any],
    tt_number: str,
    process_id: UUIDstr,
) -> LSOState:
    """Dry run of updating the R&E to IAS interconnect setting of a router."""
    vrf_list = get_active_vrfs_linked_to_router(UUID(subscription["subscription_id"]))
    extra_vars = {
        "wfo_router_json": subscription,
        "vrf_list": vrf_list,
        "dry_run": True,
        "verb": "deploy",
        "commit_comment": (
            f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Adding GEANT_GLOBAL to IAS interconnect."
        ),
        "advertises_amt_routes": router_site_has_another_amt_router(subscription["subscription_id"]),
    }

    return {
        "playbook_name": "gap_ansible/playbooks/manage_re_to_ias_interconnect.yaml",
        "inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
        "extra_vars": extra_vars,
    }

update_re_to_ias_interconnect_real(subscription, tt_number, process_id)

Real run of updating the R&E to IAS interconnect setting of a router.

Source code in gso/workflows/router/modify_re_to_ias_interconnect.py
@step("[FOR REAL] Update R&E to IAS interconnect setting")
def update_re_to_ias_interconnect_real(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> State:
    """Real run of updating the R&E to IAS interconnect setting of a router."""
    vrf_list = get_active_vrfs_linked_to_router(UUID(subscription["subscription_id"]))
    extra_vars = {
        "wfo_router_json": subscription,
        "vrf_list": vrf_list,
        "dry_run": False,
        "verb": "deploy",
        "commit_comment": (
            f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Adding GEANT_GLOBAL to IAS interconnect."
        ),
        "advertises_amt_routes": router_site_has_another_amt_router(subscription["subscription_id"]),
    }

    return {
        "playbook_name": "gap_ansible/playbooks/manage_re_to_ias_interconnect.yaml",
        "inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
        "extra_vars": extra_vars,
    }

modify_re_to_ias_interconnect()

A workflow that modifies the R&E to IAS interconnect setting of a router.

Source code in gso/workflows/router/modify_re_to_ias_interconnect.py
@modify_workflow(
    "Modify R&E to IAS interconnect.",
    initial_input_form=_initial_input_form,
)
def modify_re_to_ias_interconnect() -> StepList:
    """A workflow that modifies the R&E to IAS interconnect setting of a router."""
    return (
        begin
        >> update_re_to_ias_interconnect
        >> run_ansible_steps(lso_interaction(update_re_to_ias_interconnect_dry))
        >> run_ansible_steps(lso_interaction(update_re_to_ias_interconnect_real))
    )