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
2c2d7723
Verified
Commit
2c2d7723
authored
5 months ago
by
Aleksandr Kurbatov
Committed by
Karel van Klink
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
add partner name into edge port wfs
parent
3bbc81a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!286
Add Edge Port, GÉANT IP and IAS products
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/workflows/edge_port/create_edge_port.py
+6
-3
6 additions, 3 deletions
gso/workflows/edge_port/create_edge_port.py
gso/workflows/edge_port/modify_edge_port.py
+8
-4
8 additions, 4 deletions
gso/workflows/edge_port/modify_edge_port.py
with
14 additions
and
7 deletions
gso/workflows/edge_port/create_edge_port.py
+
6
−
3
View file @
2c2d7723
...
...
@@ -29,6 +29,7 @@ from gso.utils.helpers import (
partner_choice
,
validate_edge_port_number_of_members_based_on_lacp
,
)
from
gso.services.partners
import
get_partner_by_id
from
gso.utils.types.interfaces
import
LAGMember
,
PhysicalPortCapacity
from
gso.utils.types.tt_number
import
TTNumber
...
...
@@ -135,7 +136,7 @@ def initialize_subscription(
)
subscription
=
EdgePortProvisioning
.
from_other_lifecycle
(
subscription
,
SubscriptionLifecycle
.
PROVISIONING
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
}
@step
(
"
Reserve interfaces in NetBox
"
)
...
...
@@ -184,11 +185,12 @@ def allocate_interfaces_in_netbox(subscription: EdgePortProvisioning) -> None:
@step
(
"
[DRY RUN] Create edge port
"
)
def
create_edge_port_dry
(
subscription
:
dict
[
str
,
Any
],
tt_number
:
str
,
process_id
:
UUIDstr
)
->
LSOState
:
def
create_edge_port_dry
(
subscription
:
dict
[
str
,
Any
],
tt_number
:
str
,
process_id
:
UUIDstr
,
partner_name
:
str
)
->
LSOState
:
"""
Create a new edge port in the network as a dry run.
"""
extra_vars
=
{
"
dry_run
"
:
True
,
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Create Edge Port
"
,
"
verb
"
:
"
create
"
,
}
...
...
@@ -201,11 +203,12 @@ def create_edge_port_dry(subscription: dict[str, Any], tt_number: str, process_i
@step
(
"
[FOR REAL] Create edge port
"
)
def
create_edge_port_real
(
subscription
:
dict
[
str
,
Any
],
tt_number
:
str
,
process_id
:
UUIDstr
)
->
LSOState
:
def
create_edge_port_real
(
subscription
:
dict
[
str
,
Any
],
tt_number
:
str
,
process_id
:
UUIDstr
,
partner_name
:
str
)
->
LSOState
:
"""
Create a new edge port in the network for real.
"""
extra_vars
=
{
"
dry_run
"
:
False
,
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Create Edge Port
"
,
"
verb
"
:
"
create
"
,
}
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/edge_port/modify_edge_port.py
+
8
−
4
View file @
2c2d7723
...
...
@@ -146,11 +146,13 @@ def modify_edge_port_subscription(
f
"
{
get_partner_by_id
(
subscription
.
customer_id
).
name
}
,
{
geant_ga_id
or
""
}
"
)
subscription
.
edge_port
.
edge_port_ae_members
.
clear
()
partner_name
=
get_partner_by_id
(
subscription
.
customer_id
).
name
for
member
in
ae_members
:
subscription
.
edge_port
.
edge_port_ae_members
.
append
(
EdgePortAEMemberBlock
.
new
(
subscription_id
=
uuid4
(),
**
member
))
return
{
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
removed_ae_members
"
:
removed_ae_members
,
"
previous_ae_members
"
:
previous_ae_members
,
}
...
...
@@ -184,11 +186,12 @@ def update_interfaces_in_netbox(
@step
(
"
[DRY RUN] Update edge port configuration.
"
)
def
update_edge_port_dry
(
subscription
:
dict
[
str
,
Any
],
process_id
:
UUIDstr
,
tt_number
:
str
,
removed_ae_members
:
list
[
dict
]
subscription
:
dict
[
str
,
Any
],
process_id
:
UUIDstr
,
tt_number
:
str
,
removed_ae_members
:
list
[
dict
]
,
partner_name
:
str
)
->
LSOState
:
"""
Perform a dry run of updating the edge port configuration.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
dry_run
"
:
True
,
"
verb
"
:
"
update
"
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
"
...
...
@@ -198,7 +201,7 @@ def update_edge_port_dry(
}
return
{
"
playbook_name
"
:
"
edge_port
s
.yaml
"
,
"
playbook_name
"
:
"
edge_port.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
{
subscription
[
"
edge_port
"
][
"
node
"
][
"
router_fqdn
"
]}}},
"
extra_vars
"
:
extra_vars
,
"
subscription
"
:
subscription
,
...
...
@@ -207,11 +210,12 @@ def update_edge_port_dry(
@step
(
"
[FOR REAL] Update edge port configuration.
"
)
def
update_edge_port_real
(
subscription
:
dict
[
str
,
Any
],
process_id
:
UUIDstr
,
tt_number
:
str
,
removed_ae_members
:
list
[
str
]
subscription
:
dict
[
str
,
Any
],
process_id
:
UUIDstr
,
tt_number
:
str
,
removed_ae_members
:
list
[
str
]
,
partner_name
:
str
)
->
LSOState
:
"""
Update the edge port configuration.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
dry_run
"
:
False
,
"
verb
"
:
"
update
"
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
"
...
...
@@ -222,7 +226,7 @@ def update_edge_port_real(
return
{
"
subscription
"
:
subscription
,
"
playbook_name
"
:
"
edge_port
s
.yaml
"
,
"
playbook_name
"
:
"
edge_port.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
{
subscription
[
"
edge_port
"
][
"
node
"
][
"
router_fqdn
"
]:
None
}}},
"
extra_vars
"
:
extra_vars
,
}
...
...
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