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
d9ec5c09
Verified
Commit
d9ec5c09
authored
7 months ago
by
Neda Moeini
Committed by
Karel van Klink
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add GEANT sites to extra_vars in in P to PE promotion deploy base config steps.
parent
2ea0f7b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/services/subscriptions.py
+15
-0
15 additions, 0 deletions
gso/services/subscriptions.py
gso/workflows/router/promote_p_to_pe.py
+5
-0
5 additions, 0 deletions
gso/workflows/router/promote_p_to_pe.py
with
20 additions
and
0 deletions
gso/services/subscriptions.py
+
15
−
0
View file @
d9ec5c09
...
...
@@ -253,3 +253,18 @@ def get_site_by_name(site_name: str) -> Site:
raise
ValueError
(
msg
)
return
Site
.
from_subscription
(
subscription
[
0
].
subscription_id
)
def
get_all_active_sites
()
->
list
[
dict
[
str
,
Any
]]:
"""
Retrieve all active sites subscription together with instance values.
:return: A list of active sites with their subscription IDs and site instances.
:rtype: list[dict[str, Any]]
"""
return
[
{
"
subscription_id
"
:
subscription
[
"
subscription_id
"
],
"
site
"
:
Site
.
from_subscription
(
subscription
[
"
subscription_id
"
]).
site
,
}
for
subscription
in
get_active_site_subscriptions
(
includes
=
[
"
subscription_id
"
])
]
This diff is collapsed.
Click to expand it.
gso/workflows/router/promote_p_to_pe.py
+
5
−
0
View file @
d9ec5c09
"""
Promote a P router to a PE router.
"""
import
json
from
typing
import
Any
from
orchestrator.config.assignee
import
Assignee
...
...
@@ -8,6 +9,7 @@ from orchestrator.forms.validators import Label
from
orchestrator.targets
import
Target
from
orchestrator.types
import
FormGenerator
,
State
,
UUIDstr
from
orchestrator.utils.errors
import
ProcessFailureError
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.workflow
import
StepList
,
begin
,
conditional
,
done
,
inputstep
,
step
,
workflow
from
orchestrator.workflows.steps
import
resync
,
store_process_subscription
,
unsync
from
orchestrator.workflows.utils
import
wrap_modify_initial_input_form
...
...
@@ -18,6 +20,7 @@ from gso.products.product_types.router import Router
from
gso.services
import
lso_client
from
gso.services.kentik_client
import
KentikClient
,
NewKentikDevice
from
gso.services.lso_client
import
lso_interaction
from
gso.services.subscriptions
import
get_all_active_sites
from
gso.utils.helpers
import
generate_inventory_for_active_routers
from
gso.utils.shared_enums
import
Vendor
from
gso.utils.types
import
TTNumber
...
...
@@ -66,6 +69,7 @@ def deploy_pe_base_config_dry(
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- deploy PE base config
"
,
"
verb
"
:
"
deploy_pe_base_config
"
,
"
pe_router_list
"
:
generate_inventory_for_active_routers
(
RouterRole
.
PE
)[
"
all
"
][
"
hosts
"
],
"
geant_sites
"
:
json
.
loads
(
json_dumps
(
get_all_active_sites
())),
}
lso_client
.
execute_playbook
(
...
...
@@ -87,6 +91,7 @@ def deploy_pe_base_config_real(
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- deploy PE base config
"
,
"
verb
"
:
"
deploy_pe_base_config
"
,
"
pe_router_list
"
:
generate_inventory_for_active_routers
(
RouterRole
.
PE
)[
"
all
"
][
"
hosts
"
],
"
geant_sites
"
:
json
.
loads
(
json_dumps
(
get_all_active_sites
())),
}
lso_client
.
execute_playbook
(
...
...
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