Skip to content

Activate switch

Workflow for activating a switch, making it available to other subscriptions.

verify_complete_checklist()

Ask the operator to provide a link to the completed checklist in SharePoint.

Source code in gso/workflows/switch/activate_switch.py
@inputstep("Verify checklist completion", assignee=Assignee.SYSTEM)
def verify_complete_checklist() -> FormGenerator:
    """Ask the operator to provide a link to the completed checklist in SharePoint."""

    class VerifyCompleteForm(SubmitFormPage):
        info_label: Label = "Please enter URL to the completed checklist in SharePoint. Then continue this workflow."
        checklist_url: str = ""

    user_input = yield VerifyCompleteForm
    return {"checklist_url": user_input.model_dump()["checklist_url"]}

activate_switch()

Take a switch and move it from a PROVISIONING to an ACTIVE state.

Source code in gso/workflows/switch/activate_switch.py
@workflow(
    "Activate switch", initial_input_form=(wrap_modify_initial_input_form(_initial_input_form)), target=Target.MODIFY
)
def activate_switch() -> StepList:
    """Take a switch and move it from a `PROVISIONING` to an `ACTIVE` state."""
    return (
        begin
        >> store_process_subscription(Target.MODIFY)
        >> unsync
        >> verify_complete_checklist
        >> set_status(SubscriptionLifecycle.ACTIVE)
        >> resync
        >> done
    )