Skip to content

Import geant ip

A modification workflow for migrating an ImportedGeantIP to a GeantIP subscription.

import_geant_ip_subscription(subscription_id)

Take an imported subscription, and turn it into a GÉANT IP subscription.

Source code in gso/workflows/l3_core_service/geant_ip/import_geant_ip.py
@step("Create a GÉANT IP subscription")
def import_geant_ip_subscription(subscription_id: UUIDstr) -> State:
    """Take an imported subscription, and turn it into a GÉANT IP subscription."""
    old_l3_core_service = ImportedGeantIP.from_subscription(subscription_id)
    new_product_id = get_product_id_by_name(ProductName.GEANT_IP)
    new_subscription = GeantIP.from_other_product(old_l3_core_service, new_product_id)  # type: ignore[arg-type]
    new_subscription.description = (
        f"{new_subscription.product.name} service for {get_partner_by_id(new_subscription.customer_id).name}"
    )
    return {"subscription": new_subscription}

import_geant_ip()

Modify an imported subscription into a GÉANT IP subscription to complete the import.

Source code in gso/workflows/l3_core_service/geant_ip/import_geant_ip.py
@modify_workflow("Import GÉANT IP")
def import_geant_ip() -> StepList:
    """Modify an imported subscription into a GÉANT IP subscription to complete the import."""
    return begin >> import_geant_ip_subscription