Make use of new callback step for external provisioning
All threads resolved!
All threads resolved!
Compare changes
+ 82
− 149
@@ -4,25 +4,24 @@
@@ -4,25 +4,24 @@
"""The default label displayed when the provisioning proxy is running, in case no custom label is provided."""
@@ -36,20 +35,19 @@ class CUDOperation(strEnum):
@@ -36,20 +35,19 @@ class CUDOperation(strEnum):
def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, operation: CUDOperation) -> None:
:param endpoint: The :term:`LSO`-specific endpoint to call, depending on the type of service object that's acted
:param parameters: JSON body for the request, which will almost always at least consist of a subscription object,
:param process_id: The process ID that this request is a part of, used to call back to when the execution of the
@@ -57,8 +55,7 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, operatio
@@ -57,8 +55,7 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, operatio
callback_url = f"{settings.load_oss_params().GENERAL.public_hostname}" f"/api/processes/{process_id}/resume"
@@ -79,8 +76,13 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, operatio
@@ -79,8 +76,13 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, operatio
@@ -88,6 +90,10 @@ def provision_router(
@@ -88,6 +90,10 @@ def provision_router(
@@ -99,12 +105,13 @@ def provision_router(
@@ -99,12 +105,13 @@ def provision_router(
@@ -116,6 +123,10 @@ def provision_ip_trunk(
@@ -116,6 +123,10 @@ def provision_ip_trunk(
@@ -134,16 +145,22 @@ def provision_ip_trunk(
@@ -134,16 +145,22 @@ def provision_ip_trunk(
def check_ip_trunk(subscription: IptrunkProvisioning, process_id: UUIDstr, tt_number: str, check_name: str) -> None:
@@ -154,16 +171,22 @@ def check_ip_trunk(subscription: IptrunkProvisioning, process_id: UUIDstr, tt_nu
@@ -154,16 +171,22 @@ def check_ip_trunk(subscription: IptrunkProvisioning, process_id: UUIDstr, tt_nu
def deprovision_ip_trunk(subscription: Iptrunk, process_id: UUIDstr, tt_number: str, dry_run: bool = True) -> None:
@@ -176,7 +199,7 @@ def deprovision_ip_trunk(subscription: Iptrunk, process_id: UUIDstr, tt_number:
@@ -176,7 +199,7 @@ def deprovision_ip_trunk(subscription: Iptrunk, process_id: UUIDstr, tt_number:
@@ -186,6 +209,7 @@ def migrate_ip_trunk(
@@ -186,6 +209,7 @@ def migrate_ip_trunk(
@@ -206,8 +230,14 @@ def migrate_ip_trunk(
@@ -206,8 +230,14 @@ def migrate_ip_trunk(
@@ -227,144 +257,47 @@ def migrate_ip_trunk(
@@ -227,144 +257,47 @@ def migrate_ip_trunk(
def _await_pp_results(subscription: SubscriptionModel, label_text: str = DEFAULT_LABEL) -> FormGenerator:
When the workflow is `SUSPENDED`, it will wait for user input to be presented before it continues running the next
steps of the workflow. User input is mimicked by the provisioning proxy, as it makes a `PUT` request to the callback
URL that it was given in `_send_request()`. This input is fabricated in such a way that it will advance the workflow
to the next step. This next step should always be `confirm_pp_results()`, where the operator is presented with the
:param label_text: A label that's displayed to the operator when the provisioning proxy has not returned its
:return: The input that's given by the provisioning proxy, that should contain run results, and a `confirm`
"""Reset the boolean that indicates a successful provisioning proxy result in the state of a running workflow.
The results of a call to the provisioning proxy are displayed, together with the fact whether this execution was
a success or not. If unsuccessful, an extra label is displayed that warns the user about the fact that this
f"Execution for {state['subscription']['product']['name']} completed, please confirm the results below."
"Click submit to retry. Otherwise, abort the workflow from the process tab." # type: ignore[assignment]
def pp_interaction(provisioning_step: Step, attempts: int, abort_on_failure: bool = True) -> StepList:
All these steps are wrapped in a :class:`orchestrator.workflow.conditional`. This ensures that when provisioning was
already successful, these steps are skipped. This mechanism is quite a dirty hack, and it's planned to be addressed
The parameter `attempts` indicates how many times a provisioning may be attempted. When this amount is exceeded, and
it's still not successful, the workflow will be aborted if so indicated with the `abort_on_failure` boolean.
:param abort_on_failure: A boolean value that indicates whether a workflow should abort if the provisioning has