Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
faec59e6
Verified
Commit
faec59e6
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
add input step that prompts for Sharepoint checklist creation in iptrunk creation workflow
parent
459074de
No related branches found
No related tags found
No related merge requests found
Pipeline
#85873
passed
1 year ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/settings.py
+1
-1
1 addition, 1 deletion
gso/settings.py
gso/workflows/iptrunk/create_iptrunk.py
+27
-3
27 additions, 3 deletions
gso/workflows/iptrunk/create_iptrunk.py
test/workflows/iptrunk/test_create_iptrunk.py
+9
-0
9 additions, 0 deletions
test/workflows/iptrunk/test_create_iptrunk.py
with
37 additions
and
4 deletions
gso/settings.py
+
1
−
1
View file @
faec59e6
...
@@ -168,7 +168,7 @@ class EmailParams(BaseSettings):
...
@@ -168,7 +168,7 @@ class EmailParams(BaseSettings):
class
SharepointParams
(
BaseSettings
):
class
SharepointParams
(
BaseSettings
):
"""
Settings for different Sharepoint sites.
"""
"""
Settings for different Sharepoint sites.
"""
# TODO: Stricter typing after
p
ydantic 2.x upgrade
# TODO: Stricter typing after
P
ydantic 2.x upgrade
checklist_site_url
:
str
checklist_site_url
:
str
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/iptrunk/create_iptrunk.py
+
27
−
3
View file @
faec59e6
...
@@ -3,12 +3,13 @@
...
@@ -3,12 +3,13 @@
import
json
import
json
from
uuid
import
uuid4
from
uuid
import
uuid4
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.forms
import
FormPage
from
orchestrator.forms
import
FormPage
from
orchestrator.forms.validators
import
Choice
,
UniqueConstrainedList
from
orchestrator.forms.validators
import
Choice
,
Label
,
UniqueConstrainedList
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
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.workflow
import
StepList
,
conditional
,
done
,
init
,
step
,
workflow
from
orchestrator.workflow
import
StepList
,
conditional
,
done
,
init
,
inputstep
,
step
,
workflow
from
orchestrator.workflows.steps
import
resync
,
set_status
,
store_process_subscription
from
orchestrator.workflows.steps
import
resync
,
set_status
,
store_process_subscription
from
orchestrator.workflows.utils
import
wrap_create_initial_input_form
from
orchestrator.workflows.utils
import
wrap_create_initial_input_form
from
pydantic
import
validator
from
pydantic
import
validator
...
@@ -21,12 +22,13 @@ from gso.products.product_blocks.iptrunk import (
...
@@ -21,12 +22,13 @@ from gso.products.product_blocks.iptrunk import (
IptrunkType
,
IptrunkType
,
PhyPortCapacity
,
PhyPortCapacity
,
)
)
from
gso.products.product_types.iptrunk
import
IptrunkInactive
from
gso.products.product_types.iptrunk
import
IptrunkInactive
,
IptrunkProvisioning
from
gso.products.product_types.router
import
Router
from
gso.products.product_types.router
import
Router
from
gso.services
import
infoblox
,
subscriptions
from
gso.services
import
infoblox
,
subscriptions
from
gso.services.crm
import
get_customer_by_name
from
gso.services.crm
import
get_customer_by_name
from
gso.services.netbox_client
import
NetboxClient
from
gso.services.netbox_client
import
NetboxClient
from
gso.services.provisioning_proxy
import
execute_playbook
,
pp_interaction
from
gso.services.provisioning_proxy
import
execute_playbook
,
pp_interaction
from
gso.settings
import
load_oss_params
from
gso.utils.helpers
import
(
from
gso.utils.helpers
import
(
LAGMember
,
LAGMember
,
available_interfaces_choices
,
available_interfaces_choices
,
...
@@ -454,6 +456,27 @@ def netbox_allocate_side_b_interfaces(subscription: IptrunkInactive) -> None:
...
@@ -454,6 +456,27 @@ def netbox_allocate_side_b_interfaces(subscription: IptrunkInactive) -> None:
_allocate_interfaces_in_netbox
(
subscription
.
iptrunk
.
iptrunk_sides
[
1
])
_allocate_interfaces_in_netbox
(
subscription
.
iptrunk
.
iptrunk_sides
[
1
])
@inputstep
(
"
Prompt for new Sharepoint checklist
"
,
assignee
=
Assignee
.
SYSTEM
)
def
prompt_start_new_checklist
(
subscription
:
IptrunkProvisioning
)
->
FormGenerator
:
"""
Prompt the operator to start a new checklist in Sharepoint for approving this new IP trunk.
"""
oss_params
=
load_oss_params
()
class
SharepointPrompt
(
FormPage
):
class
Config
:
title
=
"
Start new checklist
"
info_label_1
:
Label
=
(
f
"
Visit
{
oss_params
.
SHAREPOINT
.
checklist_site_url
}
and start a new Sharepoint checklist for an IPtrunk
"
# type: ignore[assignment]
f
"
from
{
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
.
router_fqdn
}
to
"
f
"
{
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
.
"
)
info_label_2
:
Label
=
"
Once this is done, click proceed to finish the workflow.
"
# type: ignore[assignment]
yield
SharepointPrompt
return
{}
@workflow
(
@workflow
(
"
Create IP trunk
"
,
"
Create IP trunk
"
,
initial_input_form
=
wrap_create_initial_input_form
(
initial_input_form_generator
),
initial_input_form
=
wrap_create_initial_input_form
(
initial_input_form_generator
),
...
@@ -491,6 +514,7 @@ def create_iptrunk() -> StepList:
...
@@ -491,6 +514,7 @@ def create_iptrunk() -> StepList:
>>
side_a_is_nokia
(
netbox_allocate_side_a_interfaces
)
>>
side_a_is_nokia
(
netbox_allocate_side_a_interfaces
)
>>
side_b_is_nokia
(
netbox_allocate_side_b_interfaces
)
>>
side_b_is_nokia
(
netbox_allocate_side_b_interfaces
)
>>
set_status
(
SubscriptionLifecycle
.
PROVISIONING
)
>>
set_status
(
SubscriptionLifecycle
.
PROVISIONING
)
>>
prompt_start_new_checklist
>>
resync
>>
resync
>>
done
>>
done
)
)
This diff is collapsed.
Click to expand it.
test/workflows/iptrunk/test_create_iptrunk.py
+
9
−
0
View file @
faec59e6
...
@@ -8,12 +8,15 @@ from gso.products.product_blocks.iptrunk import IptrunkType, PhyPortCapacity
...
@@ -8,12 +8,15 @@ from gso.products.product_blocks.iptrunk import IptrunkType, PhyPortCapacity
from
gso.services.subscriptions
import
get_product_id_by_name
from
gso.services.subscriptions
import
get_product_id_by_name
from
gso.utils.helpers
import
LAGMember
from
gso.utils.helpers
import
LAGMember
from
gso.utils.shared_enums
import
Vendor
from
gso.utils.shared_enums
import
Vendor
from
test
import
USER_CONFIRM_EMPTY_FORM
from
test.services.conftest
import
MockedNetboxClient
from
test.services.conftest
import
MockedNetboxClient
from
test.workflows
import
(
from
test.workflows
import
(
assert_complete
,
assert_complete
,
assert_pp_interaction_failure
,
assert_pp_interaction_failure
,
assert_pp_interaction_success
,
assert_pp_interaction_success
,
assert_suspended
,
extract_state
,
extract_state
,
resume_workflow
,
run_workflow
,
run_workflow
,
)
)
...
@@ -117,6 +120,9 @@ def test_successful_iptrunk_creation_with_standard_lso_result(
...
@@ -117,6 +120,9 @@ def test_successful_iptrunk_creation_with_standard_lso_result(
for
_
in
range
(
6
):
for
_
in
range
(
6
):
result
,
step_log
=
assert_pp_interaction_success
(
result
,
process_stat
,
step_log
)
result
,
step_log
=
assert_pp_interaction_success
(
result
,
process_stat
,
step_log
)
assert_suspended
(
result
)
result
,
step_log
=
resume_workflow
(
process_stat
,
step_log
,
input_data
=
USER_CONFIRM_EMPTY_FORM
)
assert_complete
(
result
)
assert_complete
(
result
)
state
=
extract_state
(
result
)
state
=
extract_state
(
result
)
...
@@ -190,4 +196,7 @@ def test_successful_iptrunk_creation_with_juniper_interface_names(
...
@@ -190,4 +196,7 @@ def test_successful_iptrunk_creation_with_juniper_interface_names(
for
_
in
range
(
6
):
for
_
in
range
(
6
):
result
,
step_log
=
assert_pp_interaction_success
(
result
,
process_stat
,
step_log
)
result
,
step_log
=
assert_pp_interaction_success
(
result
,
process_stat
,
step_log
)
assert_suspended
(
result
)
result
,
step_log
=
resume_workflow
(
process_stat
,
step_log
,
input_data
=
USER_CONFIRM_EMPTY_FORM
)
assert_complete
(
result
)
assert_complete
(
result
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment