Skip to content
Snippets Groups Projects
Commit 94b4d98b authored by Karel van Klink's avatar Karel van Klink :smiley_cat: Committed by Mohammad Torkashvand
Browse files

Make use for submitformpage where appropriate

So that the GUI will show a "Start workflow" button instead of "Next step"
parent b225fe76
No related branches found
No related tags found
1 merge request!336Make use for submitformpage where appropriate
Pipeline #91300 passed
Showing
with 44 additions and 44 deletions
...@@ -10,7 +10,7 @@ from typing import Any, Literal, TypedDict ...@@ -10,7 +10,7 @@ from typing import Any, Literal, TypedDict
import requests import requests
from orchestrator import step from orchestrator import step
from orchestrator.config.assignee import Assignee from orchestrator.config.assignee import Assignee
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.types import State from orchestrator.types import State
from orchestrator.utils.errors import ProcessFailureError from orchestrator.utils.errors import ProcessFailureError
from orchestrator.workflow import Step, StepList, begin, callback_step, conditional, inputstep from orchestrator.workflow import Step, StepList, begin, callback_step, conditional, inputstep
...@@ -141,7 +141,7 @@ def _show_results(state: State) -> FormGenerator: ...@@ -141,7 +141,7 @@ def _show_results(state: State) -> FormGenerator:
if "callback_result" not in state: if "callback_result" not in state:
return state return state
class ConfirmRunPage(FormPage): class ConfirmRunPage(SubmitFormPage):
model_config = ConfigDict() model_config = ConfigDict()
if "lso_result_extra_label" in state: if "lso_result_extra_label" in state:
......
...@@ -5,7 +5,7 @@ from typing import Any ...@@ -5,7 +5,7 @@ from typing import Any
from orchestrator import inputstep, step from orchestrator import inputstep, step
from orchestrator.config.assignee import Assignee from orchestrator.config.assignee import Assignee
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.types import State, UUIDstr from orchestrator.types import State, UUIDstr
from orchestrator.utils.errors import ProcessFailureError from orchestrator.utils.errors import ProcessFailureError
from orchestrator.utils.json import json_dumps from orchestrator.utils.json import json_dumps
...@@ -383,7 +383,7 @@ def check_l3_services(subscription: dict[str, Any]) -> LSOState: ...@@ -383,7 +383,7 @@ def check_l3_services(subscription: dict[str, Any]) -> LSOState:
def prompt_sharepoint_checklist_url(checklist_url: str) -> FormGenerator: def prompt_sharepoint_checklist_url(checklist_url: str) -> FormGenerator:
"""Prompt the operator with the checklist in SharePoint for approving a new subscription.""" """Prompt the operator with the checklist in SharePoint for approving a new subscription."""
class SharepointPrompt(FormPage): class SharepointPrompt(SubmitFormPage):
model_config = ConfigDict(title="Complete new checklist") model_config = ConfigDict(title="Complete new checklist")
info_label_1: Label = f"A new checklist has been created at: {checklist_url}" info_label_1: Label = f"A new checklist has been created at: {checklist_url}"
...@@ -418,7 +418,7 @@ def stop_moodi() -> StepList: ...@@ -418,7 +418,7 @@ def stop_moodi() -> StepList:
@inputstep("Confirm stopping on-demand monitoring.", assignee=Assignee("SYSTEM")) @inputstep("Confirm stopping on-demand monitoring.", assignee=Assignee("SYSTEM"))
def _confirm_stopping_moodi(state: State) -> FormGenerator: def _confirm_stopping_moodi(state: State) -> FormGenerator:
class ConfirmStoppingPage(FormPage): class ConfirmStoppingPage(SubmitFormPage):
model_config = ConfigDict() model_config = ConfigDict()
run_results: Label = "Please confirm that you want to stop Moodi." run_results: Label = "Please confirm that you want to stop Moodi."
......
...@@ -4,7 +4,7 @@ from typing import Annotated, Any ...@@ -4,7 +4,7 @@ from typing import Annotated, Any
from uuid import uuid4 from uuid import uuid4
from orchestrator import workflow from orchestrator import workflow
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, SubscriptionLifecycle from orchestrator.types import FormGenerator, State, SubscriptionLifecycle
from orchestrator.workflow import StepList, begin, done, step from orchestrator.workflow import StepList, begin, done, step
...@@ -37,7 +37,7 @@ def create_subscription(partner: str) -> State: ...@@ -37,7 +37,7 @@ def create_subscription(partner: str) -> State:
def initial_input_form_generator() -> FormGenerator: def initial_input_form_generator() -> FormGenerator:
"""Generate a form that is filled in using information passed through the API endpoint.""" """Generate a form that is filled in using information passed through the API endpoint."""
class ImportEdgePort(FormPage): class ImportEdgePort(SubmitFormPage):
model_config = ConfigDict(title="Import Edge Port") model_config = ConfigDict(title="Import Edge Port")
node: active_pe_router_selector() # type: ignore[valid-type] node: active_pe_router_selector() # type: ignore[valid-type]
......
...@@ -6,7 +6,7 @@ from uuid import uuid4 ...@@ -6,7 +6,7 @@ from uuid import uuid4
from annotated_types import Len from annotated_types import Len
from orchestrator import workflow from orchestrator import workflow
from orchestrator.forms import FormPage from orchestrator.forms import FormPage, SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.workflow import StepList, begin, conditional, done, step from orchestrator.workflow import StepList, begin, conditional, done, step
from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.steps import resync, store_process_subscription, unsync
...@@ -96,7 +96,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: ...@@ -96,7 +96,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
else [] else []
) )
class ModifyEdgePortInterfaceForm(FormPage): class ModifyEdgePortInterfaceForm(SubmitFormPage):
model_config = ConfigDict(title="Modify Edge Port Interface") model_config = ConfigDict(title="Modify Edge Port Interface")
name: ReadOnlyField(subscription.edge_port.edge_port_name, default_type=str) # type: ignore[valid-type] name: ReadOnlyField(subscription.edge_port.edge_port_name, default_type=str) # type: ignore[valid-type]
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from typing import Any from typing import Any
from orchestrator import workflow from orchestrator import workflow
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import SubscriptionLifecycle from orchestrator.types import SubscriptionLifecycle
from orchestrator.workflow import StepList, begin, done, step from orchestrator.workflow import StepList, begin, done, step
...@@ -20,7 +20,7 @@ from gso.utils.types.tt_number import TTNumber ...@@ -20,7 +20,7 @@ from gso.utils.types.tt_number import TTNumber
def initial_input_form_generator() -> FormGenerator: def initial_input_form_generator() -> FormGenerator:
"""Let the operator decide whether to delete configuration on the router, and clear up IPAM resources.""" """Let the operator decide whether to delete configuration on the router, and clear up IPAM resources."""
class TerminateForm(FormPage): class TerminateForm(SubmitFormPage):
tt_number: TTNumber tt_number: TTNumber
user_input = yield TerminateForm user_input = yield TerminateForm
......
...@@ -5,7 +5,7 @@ to `ACTIVE`. The operator is asked to give a URL to the completed checklist. ...@@ -5,7 +5,7 @@ to `ACTIVE`. The operator is asked to give a URL to the completed checklist.
""" """
from orchestrator.config.assignee import Assignee from orchestrator.config.assignee import Assignee
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.forms.validators import Label from orchestrator.forms.validators import Label
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, SubscriptionLifecycle, UUIDstr from orchestrator.types import FormGenerator, SubscriptionLifecycle, UUIDstr
...@@ -19,7 +19,7 @@ from gso.products.product_types.iptrunk import Iptrunk ...@@ -19,7 +19,7 @@ from gso.products.product_types.iptrunk import Iptrunk
def _initial_input_form(subscription_id: UUIDstr) -> FormGenerator: def _initial_input_form(subscription_id: UUIDstr) -> FormGenerator:
trunk = Iptrunk.from_subscription(subscription_id) trunk = Iptrunk.from_subscription(subscription_id)
class ActivateTrunkForm(FormPage): class ActivateTrunkForm(SubmitFormPage):
info_label: Label = "Start approval process for IP trunk activation." info_label: Label = "Start approval process for IP trunk activation."
user_input = yield ActivateTrunkForm user_input = yield ActivateTrunkForm
...@@ -31,7 +31,7 @@ def _initial_input_form(subscription_id: UUIDstr) -> FormGenerator: ...@@ -31,7 +31,7 @@ def _initial_input_form(subscription_id: UUIDstr) -> FormGenerator:
def verify_complete_checklist() -> FormGenerator: def verify_complete_checklist() -> FormGenerator:
"""Show a form for the operator to input a link to the completed checklist.""" """Show a form for the operator to input a link to the completed checklist."""
class VerifyCompleteForm(FormPage): class VerifyCompleteForm(SubmitFormPage):
info_label: Label = "Verify that the checklist has been completed. Then continue this workflow." info_label: Label = "Verify that the checklist has been completed. Then continue this workflow."
checklist_url: str = "" checklist_url: str = ""
......
...@@ -5,7 +5,7 @@ from typing import Annotated ...@@ -5,7 +5,7 @@ from typing import Annotated
from uuid import uuid4 from uuid import uuid4
from orchestrator import workflow from orchestrator import workflow
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, SubscriptionLifecycle from orchestrator.types import FormGenerator, State, SubscriptionLifecycle
from orchestrator.workflow import StepList, begin, done, step from orchestrator.workflow import StepList, begin, done, step
...@@ -27,7 +27,7 @@ from gso.utils.types.interfaces import LAGMember, LAGMemberList, PhysicalPortCap ...@@ -27,7 +27,7 @@ from gso.utils.types.interfaces import LAGMember, LAGMemberList, PhysicalPortCap
def initial_input_form_generator() -> FormGenerator: def initial_input_form_generator() -> FormGenerator:
"""Take all information passed to this workflow by the API endpoint that was called.""" """Take all information passed to this workflow by the API endpoint that was called."""
class CreateIptrunkForm(FormPage): class CreateIptrunkForm(SubmitFormPage):
model_config = ConfigDict(title="Import Iptrunk") model_config = ConfigDict(title="Import Iptrunk")
partner: str partner: str
......
...@@ -6,7 +6,7 @@ state after running this workflow. ...@@ -6,7 +6,7 @@ state after running this workflow.
import json import json
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.forms.validators import Label from orchestrator.forms.validators import Label
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, UUIDstr from orchestrator.types import FormGenerator, UUIDstr
...@@ -23,7 +23,7 @@ from gso.utils.types.tt_number import TTNumber ...@@ -23,7 +23,7 @@ from gso.utils.types.tt_number import TTNumber
def _initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: def _initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
trunk = Iptrunk.from_subscription(subscription_id) trunk = Iptrunk.from_subscription(subscription_id)
class DeployTWAMPForm(FormPage): class DeployTWAMPForm(SubmitFormPage):
info_label: Label = ( info_label: Label = (
"Please confirm deployment of TWAMP on IP trunk from " "Please confirm deployment of TWAMP on IP trunk from "
f"{trunk.iptrunk.iptrunk_sides[0].iptrunk_side_node.router_fqdn} to " f"{trunk.iptrunk.iptrunk_sides[0].iptrunk_side_node.router_fqdn} to "
......
...@@ -14,7 +14,7 @@ from uuid import uuid4 ...@@ -14,7 +14,7 @@ from uuid import uuid4
from annotated_types import Len from annotated_types import Len
from orchestrator import step, workflow from orchestrator import step, workflow
from orchestrator.config.assignee import Assignee from orchestrator.config.assignee import Assignee
from orchestrator.forms import FormPage from orchestrator.forms import FormPage, SubmitFormPage
from orchestrator.forms.validators import Choice, Label from orchestrator.forms.validators import Choice, Label
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, UUIDstr from orchestrator.types import FormGenerator, State, UUIDstr
...@@ -144,7 +144,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: ...@@ -144,7 +144,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
for iface in subscription.iptrunk.iptrunk_sides[replace_index].iptrunk_side_ae_members for iface in subscription.iptrunk.iptrunk_sides[replace_index].iptrunk_side_ae_members
] ]
class NewSideIPTrunkForm(FormPage): class NewSideIPTrunkForm(SubmitFormPage):
model_config = ConfigDict(title=form_title) model_config = ConfigDict(title=form_title)
new_lag_interface: side_a_ae_iface # type: ignore[valid-type] new_lag_interface: side_a_ae_iface # type: ignore[valid-type]
...@@ -515,7 +515,7 @@ def check_ip_trunk_bfd(subscription: Iptrunk, new_node: Router, replace_index: i ...@@ -515,7 +515,7 @@ def check_ip_trunk_bfd(subscription: Iptrunk, new_node: Router, replace_index: i
def confirm_continue_move_fiber() -> FormGenerator: def confirm_continue_move_fiber() -> FormGenerator:
"""Wait for confirmation from an operator that the physical fiber has been moved.""" """Wait for confirmation from an operator that the physical fiber has been moved."""
class ProvisioningResultPage(FormPage): class ProvisioningResultPage(SubmitFormPage):
model_config = ConfigDict(title="Please confirm before continuing") model_config = ConfigDict(title="Please confirm before continuing")
info_label: Label = "New trunk interface has been deployed, wait for the physical connection to be moved." info_label: Label = "New trunk interface has been deployed, wait for the physical connection to be moved."
...@@ -604,7 +604,7 @@ def check_ip_trunk_isis(subscription: Iptrunk, replace_index: int) -> LSOState: ...@@ -604,7 +604,7 @@ def check_ip_trunk_isis(subscription: Iptrunk, replace_index: int) -> LSOState:
def confirm_continue_restore_isis() -> FormGenerator: def confirm_continue_restore_isis() -> FormGenerator:
"""Wait for an operator to confirm that the old ISIS metric should be restored.""" """Wait for an operator to confirm that the old ISIS metric should be restored."""
class ProvisioningResultPage(FormPage): class ProvisioningResultPage(SubmitFormPage):
model_config = ConfigDict(title="Please confirm before continuing") model_config = ConfigDict(title="Please confirm before continuing")
info_label: Label = "ISIS config has been deployed, confirm if you want to restore the old metric." info_label: Label = "ISIS config has been deployed, confirm if you want to restore the old metric."
......
...@@ -6,7 +6,7 @@ necessary modifications will be applied. ...@@ -6,7 +6,7 @@ necessary modifications will be applied.
import json import json
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, UUIDstr from orchestrator.types import FormGenerator, State, UUIDstr
from orchestrator.utils.json import json_dumps from orchestrator.utils.json import json_dumps
...@@ -24,7 +24,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: ...@@ -24,7 +24,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
"""Ask the operator for the new ISIS metric.""" """Ask the operator for the new ISIS metric."""
subscription = Iptrunk.from_subscription(subscription_id) subscription = Iptrunk.from_subscription(subscription_id)
class ModifyIptrunkForm(FormPage): class ModifyIptrunkForm(SubmitFormPage):
tt_number: TTNumber tt_number: TTNumber
isis_metric: int = subscription.iptrunk.iptrunk_isis_metric isis_metric: int = subscription.iptrunk.iptrunk_isis_metric
......
...@@ -12,7 +12,7 @@ from typing import Annotated ...@@ -12,7 +12,7 @@ from typing import Annotated
from uuid import UUID, uuid4 from uuid import UUID, uuid4
from annotated_types import Len from annotated_types import Len
from orchestrator.forms import FormPage from orchestrator.forms import FormPage, SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, UUIDstr from orchestrator.types import FormGenerator, State, UUIDstr
from orchestrator.utils.json import json_dumps from orchestrator.utils.json import json_dumps
...@@ -142,7 +142,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: ...@@ -142,7 +142,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
user_input_side_a = yield ModifyIptrunkSideAForm user_input_side_a = yield ModifyIptrunkSideAForm
ae_members_side_b = initialize_ae_members(subscription, initial_user_input.model_dump(), 1) ae_members_side_b = initialize_ae_members(subscription, initial_user_input.model_dump(), 1)
class ModifyIptrunkSideBForm(FormPage): class ModifyIptrunkSideBForm(SubmitFormPage):
model_config = ConfigDict(title="Provide subscription details for side B of the trunk.") model_config = ConfigDict(title="Provide subscription details for side B of the trunk.")
side_b_node: ReadOnlyField( # type: ignore[valid-type] side_b_node: ReadOnlyField( # type: ignore[valid-type]
......
...@@ -14,7 +14,7 @@ This workflow deletes all the configuration related with an IPtrunk from the net ...@@ -14,7 +14,7 @@ This workflow deletes all the configuration related with an IPtrunk from the net
import ipaddress import ipaddress
import json import json
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.forms.validators import Label from orchestrator.forms.validators import Label
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr
...@@ -43,7 +43,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: ...@@ -43,7 +43,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
"""Ask the operator to confirm whether router configuration and IPAM resources should be deleted.""" """Ask the operator to confirm whether router configuration and IPAM resources should be deleted."""
iptrunk = Iptrunk.from_subscription(subscription_id) iptrunk = Iptrunk.from_subscription(subscription_id)
class TerminateForm(FormPage): class TerminateForm(SubmitFormPage):
if iptrunk.status == SubscriptionLifecycle.INITIAL: if iptrunk.status == SubscriptionLifecycle.INITIAL:
info_label_2: Label = ( info_label_2: Label = (
"This will immediately mark the subscription as terminated, preventing any other workflows from " "This will immediately mark the subscription as terminated, preventing any other workflows from "
......
...@@ -4,7 +4,7 @@ from typing import Any, Self ...@@ -4,7 +4,7 @@ from typing import Any, Self
from uuid import uuid4 from uuid import uuid4
from orchestrator import step, workflow from orchestrator import step, workflow
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, SubscriptionLifecycle from orchestrator.types import FormGenerator, State, SubscriptionLifecycle
from orchestrator.workflow import StepList, begin, done from orchestrator.workflow import StepList, begin, done
...@@ -35,7 +35,7 @@ def initial_input_form_generator() -> FormGenerator: ...@@ -35,7 +35,7 @@ def initial_input_form_generator() -> FormGenerator:
edge_port: UUIDstr edge_port: UUIDstr
vlan_id: VLAN_ID vlan_id: VLAN_ID
class ImportLayer2CircuitForm(FormPage): class ImportLayer2CircuitForm(SubmitFormPage):
model_config = ConfigDict(title="Import Layer 2 Circuit") model_config = ConfigDict(title="Import Layer 2 Circuit")
service_type: Layer2CircuitServiceType service_type: Layer2CircuitServiceType
......
...@@ -4,7 +4,7 @@ from typing import Any, Self ...@@ -4,7 +4,7 @@ from typing import Any, Self
from uuid import uuid4 from uuid import uuid4
from orchestrator import step, workflow from orchestrator import step, workflow
from orchestrator.forms import FormPage from orchestrator.forms import FormPage, SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import SubscriptionLifecycle from orchestrator.types import SubscriptionLifecycle
from orchestrator.workflow import StepList, begin, done from orchestrator.workflow import StepList, begin, done
...@@ -58,7 +58,7 @@ def initial_input_generator(product_name: str) -> FormGenerator: ...@@ -58,7 +58,7 @@ def initial_input_generator(product_name: str) -> FormGenerator:
"""Return the appropriate field type based on whether the policer is enabled.""" """Return the appropriate field type based on whether the policer is enabled."""
return BandwidthString if policer_enabled else ReadOnlyField(None, default_type=str) return BandwidthString if policer_enabled else ReadOnlyField(None, default_type=str)
class Layer2CircuitServiceSidesPage(FormPage): class Layer2CircuitServiceSidesPage(SubmitFormPage):
model_config = ConfigDict(title=f"{product_name} - Configure Edge Ports") model_config = ConfigDict(title=f"{product_name} - Configure Edge Ports")
vlan_range_label: Label = Field("Please set a VLAN range, bounds including.", exclude=True) vlan_range_label: Label = Field("Please set a VLAN range, bounds including.", exclude=True)
......
"""A modification workflow for a Layer 2 Circuit subscription.""" """A modification workflow for a Layer 2 Circuit subscription."""
from orchestrator import begin, done, workflow from orchestrator import begin, done, workflow
from orchestrator.forms import FormPage from orchestrator.forms import FormPage, SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, UUIDstr from orchestrator.types import FormGenerator, UUIDstr
from orchestrator.workflow import StepList, step from orchestrator.workflow import StepList, step
...@@ -36,7 +36,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: ...@@ -36,7 +36,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
layer_2_circuit_input = yield ModifyL2CircuitForm layer_2_circuit_input = yield ModifyL2CircuitForm
class ModifyLayer2CircuitServiceSidesPage(FormPage): class ModifyLayer2CircuitServiceSidesPage(SubmitFormPage):
model_config = ConfigDict(title=f"{product_name} - Configure Edge Ports") model_config = ConfigDict(title=f"{product_name} - Configure Edge Ports")
vlan_range_label: Label = Field("Please set a VLAN range, bounds including.", exclude=True) vlan_range_label: Label = Field("Please set a VLAN range, bounds including.", exclude=True)
......
"""Workflow for terminating a Layer 2 Circuit.""" """Workflow for terminating a Layer 2 Circuit."""
from orchestrator import begin, workflow from orchestrator import begin, workflow
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import SubscriptionLifecycle, UUIDstr from orchestrator.types import SubscriptionLifecycle, UUIDstr
from orchestrator.workflow import StepList, done from orchestrator.workflow import StepList, done
...@@ -16,7 +16,7 @@ from gso.utils.types.tt_number import TTNumber ...@@ -16,7 +16,7 @@ from gso.utils.types.tt_number import TTNumber
def _input_form_generator(subscription_id: UUIDstr) -> FormGenerator: def _input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
layer_2_circuit = Layer2Circuit.from_subscription(subscription_id) layer_2_circuit = Layer2Circuit.from_subscription(subscription_id)
class TerminateForm(FormPage): class TerminateForm(SubmitFormPage):
tt_number: TTNumber tt_number: TTNumber
yield TerminateForm yield TerminateForm
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from uuid import uuid4 from uuid import uuid4
from orchestrator import workflow from orchestrator import workflow
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, SubscriptionLifecycle from orchestrator.types import FormGenerator, SubscriptionLifecycle
from orchestrator.utils.errors import ProcessFailureError from orchestrator.utils.errors import ProcessFailureError
...@@ -67,7 +67,7 @@ def initial_input_form_generator() -> FormGenerator: ...@@ -67,7 +67,7 @@ def initial_input_form_generator() -> FormGenerator:
v4_bfd_settings: BFDSettingsModel v4_bfd_settings: BFDSettingsModel
v6_bfd_settings: BFDSettingsModel v6_bfd_settings: BFDSettingsModel
class ImportL3CoreServiceForm(FormPage): class ImportL3CoreServiceForm(SubmitFormPage):
partner: str partner: str
service_binding_ports: list[ServiceBindingPort] service_binding_ports: list[ServiceBindingPort]
service_type: L3CoreServiceType service_type: L3CoreServiceType
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from typing import Any from typing import Any
from uuid import uuid4 from uuid import uuid4
from orchestrator.forms import FormPage from orchestrator.forms import FormPage, SubmitFormPage
from orchestrator.forms.validators import Label from orchestrator.forms.validators import Label
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr
...@@ -107,7 +107,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: ...@@ -107,7 +107,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
def ip_type(self) -> IPTypes: def ip_type(self) -> IPTypes:
return IPTypes.IPV6 return IPTypes.IPV6
class BindingPortInputForm(FormPage): class BindingPortInputForm(SubmitFormPage):
model_config = ConfigDict(title=f"{product_name} - Configure Edge Port") model_config = ConfigDict(title=f"{product_name} - Configure Edge Port")
info_label: Label = Field("Please configure the Service Binding Ports for the Edge Port.", exclude=True) info_label: Label = Field("Please configure the Service Binding Ports for the Edge Port.", exclude=True)
current_ep_label: Label = Field( current_ep_label: Label = Field(
......
...@@ -4,7 +4,7 @@ from typing import Annotated ...@@ -4,7 +4,7 @@ from typing import Annotated
from annotated_types import Len from annotated_types import Len
from orchestrator import workflow from orchestrator import workflow
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.workflow import StepList, begin, done, step from orchestrator.workflow import StepList, begin, done, step
from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.steps import resync, store_process_subscription, unsync
...@@ -52,7 +52,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: ...@@ -52,7 +52,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
raise ValueError(msg) raise ValueError(msg)
return edge_ports return edge_ports
class L3CoreServiceEdgePortSelectionForm(FormPage): class L3CoreServiceEdgePortSelectionForm(SubmitFormPage):
model_config = ConfigDict(title=f"Migrating {subscription.product.name} to a new set of Edge Ports") model_config = ConfigDict(title=f"Migrating {subscription.product.name} to a new set of Edge Ports")
tt_number: TTNumber tt_number: TTNumber
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from uuid import uuid4 from uuid import uuid4
from orchestrator import step, workflow from orchestrator import step, workflow
from orchestrator.forms import FormPage from orchestrator.forms import SubmitFormPage
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, SubscriptionLifecycle from orchestrator.types import FormGenerator, State, SubscriptionLifecycle
from orchestrator.workflow import StepList, begin, done from orchestrator.workflow import StepList, begin, done
...@@ -29,7 +29,7 @@ from gso.utils.types.virtual_identifiers import ( ...@@ -29,7 +29,7 @@ from gso.utils.types.virtual_identifiers import (
def _initial_input_form_generator() -> FormGenerator: def _initial_input_form_generator() -> FormGenerator:
class ImportLanSwitchInterconnect(FormPage): class ImportLanSwitchInterconnect(SubmitFormPage):
lan_switch_interconnect_description: str lan_switch_interconnect_description: str
minimum_links: int minimum_links: int
switch_management_vlan_id: VLAN_ID | None = DEFAULT_SWITCH_MANAGEMENT_VLAN_ID switch_management_vlan_id: VLAN_ID | None = DEFAULT_SWITCH_MANAGEMENT_VLAN_ID
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment