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
c34c6d0e
Commit
c34c6d0e
authored
11 months ago
by
Aleksandr Kurbatov
Browse files
Options
Downloads
Patches
Plain Diff
deploy_twamp: subscription -> json
parent
95fe9e40
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!194
deploy_twamp: subscription -> json
Pipeline
#86143
failed
11 months ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/iptrunk/deploy_twamp.py
+11
-5
11 additions, 5 deletions
gso/workflows/iptrunk/deploy_twamp.py
with
11 additions
and
5 deletions
gso/workflows/iptrunk/deploy_twamp.py
+
11
−
5
View file @
c34c6d0e
"""
Workflow for adding TWAMP to an existing IP trunk.
"""
import
json
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.forms
import
FormPage
from
orchestrator.forms.validators
import
Label
from
orchestrator.targets
import
Target
...
...
@@ -38,7 +41,7 @@ def _initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
def
deploy_twamp_dry
(
subscription
:
Iptrunk
,
process_id
:
UUIDstr
,
callback_route
:
str
,
tt_number
:
str
)
->
State
:
"""
Perform a dry run of deploying the TWAMP session.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
subscription
"
:
json
.
loads
(
json_dumps
(
subscription
))
,
"
process_id
"
:
process_id
,
"
dry_run
"
:
True
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Deploy TWAMP
"
,
...
...
@@ -49,7 +52,8 @@ def deploy_twamp_dry(subscription: Iptrunk, process_id: UUIDstr, callback_route:
f
"
\n
{
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
"
)
execute_playbook
(
"
deploy_twamp.yaml
"
,
callback_route
,
inventory
,
extra_vars
)
execute_playbook
(
"
deploy_twamp.yaml
"
,
callback_route
,
inventory
,
extra_vars
)
return
{
"
subscription
"
:
subscription
}
...
...
@@ -58,7 +62,7 @@ def deploy_twamp_dry(subscription: Iptrunk, process_id: UUIDstr, callback_route:
def
deploy_twamp_real
(
subscription
:
Iptrunk
,
process_id
:
UUIDstr
,
callback_route
:
str
,
tt_number
:
str
)
->
State
:
"""
Deploy the TWAMP session.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
subscription
"
:
json
.
loads
(
json_dumps
(
subscription
))
,
"
process_id
"
:
process_id
,
"
dry_run
"
:
False
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Deploy TWAMP
"
,
...
...
@@ -69,14 +73,16 @@ def deploy_twamp_real(subscription: Iptrunk, process_id: UUIDstr, callback_route
f
"
\n
{
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
"
)
execute_playbook
(
"
deploy_twamp.yaml
"
,
callback_route
,
inventory
,
extra_vars
)
execute_playbook
(
"
deploy_twamp.yaml
"
,
callback_route
,
inventory
,
extra_vars
)
return
{
"
subscription
"
:
subscription
}
@workflow
(
"
Deploy TWAMP
"
,
initial_input_form
=
wrap_modify_initial_input_form
(
_initial_input_form_generator
),
initial_input_form
=
wrap_modify_initial_input_form
(
_initial_input_form_generator
),
target
=
Target
.
MODIFY
,
)
def
deploy_twamp
()
->
StepList
:
...
...
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