Skip to content

Import super pop switch

A modification workflow for migrating an ImportedSuperPoPSwitch to a SuperPopSwitch subscription.

import_super_pop_switch_subscription(subscription_id)

Take an ImportedSuperPopSwitch subscription, and turn it into a SuperPopSwitch subscription.

Source code in gso/workflows/super_pop_switch/import_super_pop_switch.py
@step("Create new super_pop_switch subscription")
def import_super_pop_switch_subscription(subscription_id: UUIDstr) -> State:
    """Take an ImportedSuperPopSwitch subscription, and turn it into a SuperPopSwitch subscription."""
    old_super_pop_switch = ImportedSuperPopSwitch.from_subscription(subscription_id)
    new_subscription_id = get_product_id_by_name(ProductName.SUPER_POP_SWITCH)
    new_subscription = SuperPopSwitch.from_other_product(old_super_pop_switch, new_subscription_id)  # type: ignore[arg-type]

    return {"subscription": new_subscription}

import_super_pop_switch()

Modify an ImportedSuperPopSwitch subscription into a SuperPopSwitch subscription to complete the import.

Source code in gso/workflows/super_pop_switch/import_super_pop_switch.py
@workflow("Import SuperPopSwitch", target=Target.MODIFY, initial_input_form=wrap_modify_initial_input_form(None))
def import_super_pop_switch() -> StepList:
    """Modify an ImportedSuperPopSwitch subscription into a SuperPopSwitch subscription to complete the import."""
    return (
        init
        >> store_process_subscription(Target.MODIFY)
        >> unsync
        >> import_super_pop_switch_subscription
        >> resync
        >> done
    )