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
647f0753
Verified
Commit
647f0753
authored
11 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
separate imported router initialisation step
parent
6dd2b5e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!201
Add imported products
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/site/create_imported_site.py
+32
-2
32 additions, 2 deletions
gso/workflows/site/create_imported_site.py
with
32 additions
and
2 deletions
gso/workflows/site/create_imported_site.py
+
32
−
2
View file @
647f0753
...
...
@@ -9,11 +9,10 @@ from orchestrator.workflow import StepList, done, init, step, workflow
from
orchestrator.workflows.steps
import
resync
,
set_status
,
store_process_subscription
from
gso.products
import
ProductName
from
gso.products.product_blocks.site
import
SiteTier
from
gso.products.product_blocks.site
import
LatitudeCoordinate
,
LongitudeCoordinate
,
SiteTier
from
gso.products.product_types.site
import
ImportedSiteInactive
from
gso.services
import
subscriptions
from
gso.services.partners
import
get_partner_by_name
from
gso.workflows.site.create_site
import
initialize_subscription
@step
(
"
Create subscription
"
)
...
...
@@ -52,6 +51,37 @@ def generate_initial_input_form() -> FormGenerator:
return
user_input
.
dict
()
@step
(
"
Initialize subscription
"
)
def
initialize_subscription
(
subscription
:
ImportedSiteInactive
,
site_name
:
str
,
site_city
:
str
,
site_country
:
str
,
site_country_code
:
str
,
site_latitude
:
LatitudeCoordinate
,
site_longitude
:
LongitudeCoordinate
,
site_bgp_community_id
:
int
,
site_internal_id
:
int
,
site_ts_address
:
str
,
site_tier
:
SiteTier
,
)
->
State
:
"""
Initialise the subscription object with all input.
"""
subscription
.
site
.
site_name
=
site_name
subscription
.
site
.
site_city
=
site_city
subscription
.
site
.
site_country
=
site_country
subscription
.
site
.
site_country_code
=
site_country_code
subscription
.
site
.
site_latitude
=
site_latitude
subscription
.
site
.
site_longitude
=
site_longitude
subscription
.
site
.
site_bgp_community_id
=
site_bgp_community_id
subscription
.
site
.
site_internal_id
=
site_internal_id
subscription
.
site
.
site_tier
=
site_tier
subscription
.
site
.
site_ts_address
=
site_ts_address
subscription
.
description
=
f
"
Site in
{
site_city
}
,
{
site_country
}
"
return
{
"
subscription
"
:
subscription
}
@workflow
(
"
Import Site
"
,
target
=
Target
.
CREATE
,
...
...
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