Skip to content

Import lhcone

A modification workflow for migrating an ImportedLHCOne to an LHCOne subscription.

import_lhcone_subscription(subscription_id)

Take an imported subscription, and turn it into a LHCOne subscription.

Source code in gso/workflows/l3_core_service/lhcone/import_lhcone.py
@step("Create a LHCOne subscription")
def import_lhcone_subscription(subscription_id: UUIDstr) -> State:
    """Take an imported subscription, and turn it into a LHCOne subscription."""
    old_l3_core_service = ImportedLHCOne.from_subscription(subscription_id)
    new_product_id = get_product_id_by_name(ProductName.LHCONE)
    new_subscription = LHCOne.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_lhcone()

Modify an imported subscription into a LHCOne subscription to complete the import.

Source code in gso/workflows/l3_core_service/lhcone/import_lhcone.py
@workflow("Import LHCOne", target=Target.MODIFY, initial_input_form=wrap_modify_initial_input_form(None))
def import_lhcone() -> StepList:
    """Modify an imported subscription into a LHCOne subscription to complete the import."""
    return init >> store_process_subscription(Target.MODIFY) >> unsync >> import_lhcone_subscription >> resync >> done