Skip to content
Snippets Groups Projects

router creation flow update

Merged Karel van Klink requested to merge feature/update-lifecycle-states into develop
2 files
+ 23
4
Compare changes
  • Side-by-side
  • Inline
Files
2
"""Activate router takes a provisioning router to the active lifecycle state."""
from orchestrator.config.assignee import Assignee
from orchestrator.forms import FormPage
from orchestrator.forms.validators import Label
from orchestrator.targets import Target
from orchestrator.types import FormGenerator, SubscriptionLifecycle, UUIDstr
from orchestrator.workflow import StepList, done, init, workflow
from orchestrator.workflow import StepList, done, init, inputstep, workflow
from orchestrator.workflows.steps import resync, set_status, store_process_subscription, unsync
from orchestrator.workflows.utils import wrap_modify_initial_input_form
@@ -16,13 +17,25 @@ def _initial_input_form(subscription_id: UUIDstr) -> FormGenerator:
class ActivateRouterForm(FormPage):
info_label: Label = "Start approval process for router activation." # type:ignore[assignment]
tt_number: str
user_input = yield ActivateRouterForm
return user_input.dict() | {"subscription": router}
@inputstep("Verify checklist completion", assignee=Assignee.SYSTEM)
def verify_complete_checklist() -> FormGenerator:
"""Show a form for the operator to input a link to the completed checklist."""
class VerifyCompleteForm(FormPage):
info_label: Label = "Verify that the checklist has been completed. Then continue this workflow." # type: ignore[assignment]
checklist_url: str = ""
user_input = yield VerifyCompleteForm
return {"checklist_url": user_input.dict()["checklist_url"]}
@workflow(
"Activate a router",
initial_input_form=wrap_modify_initial_input_form(_initial_input_form),
@@ -39,6 +52,7 @@ def activate_router() -> StepList:
init
>> store_process_subscription(Target.MODIFY)
>> unsync
>> verify_complete_checklist
>> set_status(SubscriptionLifecycle.ACTIVE)
>> resync
>> done
Loading