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
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
c81382f0
Verified
Commit
c81382f0
authored
10 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Add new sharepoint interaction to iptrunk creation workflow
parent
734d5a52
No related branches found
No related tags found
1 merge request
!211
Feature/add sharepoint service
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/iptrunk/create_iptrunk.py
+12
-20
12 additions, 20 deletions
gso/workflows/iptrunk/create_iptrunk.py
with
12 additions
and
20 deletions
gso/workflows/iptrunk/create_iptrunk.py
+
12
−
20
View file @
c81382f0
...
...
@@ -5,13 +5,12 @@ from typing import Annotated
from
uuid
import
uuid4
from
annotated_types
import
Len
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.forms
import
FormPage
from
orchestrator.forms.validators
import
Choice
,
Label
from
orchestrator.targets
import
Target
from
orchestrator.types
import
FormGenerator
,
State
,
SubscriptionLifecycle
,
UUIDstr
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.workflow
import
StepList
,
conditional
,
done
,
init
,
inputstep
,
step
,
workflow
from
orchestrator.workflow
import
StepList
,
conditional
,
done
,
init
,
step
,
workflow
from
orchestrator.workflows.steps
import
resync
,
set_status
,
store_process_subscription
from
orchestrator.workflows.utils
import
wrap_create_initial_input_form
from
pydantic
import
AfterValidator
,
ConfigDict
,
field_validator
...
...
@@ -30,6 +29,7 @@ from gso.services import infoblox, subscriptions
from
gso.services.lso_client
import
execute_playbook
,
lso_interaction
from
gso.services.netbox_client
import
NetboxClient
from
gso.services.partners
import
get_partner_by_name
from
gso.services.sharepoint
import
SharePointClient
from
gso.settings
import
load_oss_params
from
gso.utils.helpers
import
(
LAGMember
,
...
...
@@ -42,6 +42,7 @@ from gso.utils.helpers import (
validate_tt_number
,
)
from
gso.utils.shared_enums
import
Vendor
from
gso.utils.workflow_steps
import
prompt_sharepoint_checklist_url
def
initial_input_form_generator
(
product_name
:
str
)
->
FormGenerator
:
...
...
@@ -492,24 +493,14 @@ def netbox_allocate_side_b_interfaces(subscription: IptrunkInactive) -> None:
_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
):
model_config
=
ConfigDict
(
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
"
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.
"
yield
SharepointPrompt
@step
(
"
Create a new SharePoint checklist item
"
)
def
create_new_sharepoint_checklist
(
subscription
:
IptrunkProvisioning
,
tt_number
:
str
)
->
State
:
"""
Create a new checklist item in SharePoint for approving this IPtrunk.
"""
new_list_item_url
=
SharePointClient
().
add_list_item
(
"
ip_trunk
"
,
{
"
Title
"
:
subscription
.
iptrunk
.
iptrunk_description
,
"
TT_NUMBER
"
:
tt_number
}
)
return
{}
return
{
"
checklist_url
"
:
new_list_item_url
}
@workflow
(
...
...
@@ -550,7 +541,8 @@ def create_iptrunk() -> StepList:
>>
side_a_is_nokia
(
netbox_allocate_side_a_interfaces
)
>>
side_b_is_nokia
(
netbox_allocate_side_b_interfaces
)
>>
set_status
(
SubscriptionLifecycle
.
PROVISIONING
)
>>
prompt_start_new_checklist
>>
create_new_sharepoint_checklist
>>
prompt_sharepoint_checklist_url
>>
resync
>>
done
)
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