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
10b134d2
Verified
Commit
10b134d2
authored
6 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Implement feedback for GÉANT IP input form
parent
d4056c6a
No related branches found
Branches containing commit
Tags
2.27
Tags containing commit
1 merge request
!286
Add Edge Port, GÉANT IP and IAS products
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/geant_ip/create_geant_ip.py
+20
-12
20 additions, 12 deletions
gso/workflows/geant_ip/create_geant_ip.py
with
20 additions
and
12 deletions
gso/workflows/geant_ip/create_geant_ip.py
+
20
−
12
View file @
10b134d2
...
...
@@ -25,7 +25,7 @@ from gso.utils.helpers import (
partner_choice
,
)
from
gso.utils.shared_enums
import
APType
,
SBPType
from
gso.utils.types.ip_address
import
IPv4AddressType
,
IPv6AddressType
from
gso.utils.types.ip_address
import
IPAddress
,
IPv4AddressType
,
IPv6AddressType
from
gso.utils.types.tt_number
import
TTNumber
...
...
@@ -44,14 +44,19 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
edge_port
:
active_edge_port_selector
(
partner_id
=
initial_user_input
.
partner
)
# type: ignore[valid-type]
ap_type
:
APType
def
__hash__
(
self
)
->
int
:
return
self
.
edge_port
.
__hash__
()
def
validate_edge_ports_are_unique
(
edge_ports
:
list
[
EdgePortSelection
])
->
list
[
EdgePortSelection
]:
"""
Verify if interfaces are unique.
"""
port_names
=
[
port
.
edge_port
for
port
in
edge_ports
]
if
len
(
port_names
)
!=
len
(
set
(
port_names
)):
msg
=
"
Edge Ports must be unique.
"
raise
ValueError
(
msg
)
return
edge_ports
class
EdgePortSelectionForm
(
FormPage
):
model_config
=
ConfigDict
(
title
=
f
"
{
product_name
}
- Select Edge Ports
"
)
info_label
:
Label
=
"
Please select the Edge Ports where this GÉANT IP service will terminate
"
edge_ports
:
Annotated
[
list
[
EdgePortSelection
],
AfterValidator
(
validate_unique
_list
)]
edge_ports
:
Annotated
[
list
[
EdgePortSelection
],
AfterValidator
(
validate_
edge_ports_are_
unique
)]
selected_edge_ports
=
yield
EdgePortSelectionForm
ep_list
=
selected_edge_ports
.
edge_ports
...
...
@@ -60,21 +65,23 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
binding_port_inputs
=
[]
while
current_ep_index
<
total_ep_count
:
current_edge_port
_description
=
EdgePort
.
from_subscription
(
ep_list
[
current_ep_index
].
edge_port
)
.
description
current_edge_port
=
EdgePort
.
from_subscription
(
ep_list
[
current_ep_index
].
edge_port
)
class
BindingPortsInputForm
(
FormPage
):
model_config
=
ConfigDict
(
title
=
f
"
{
product_name
}
- Configure Service Binding Ports (
{
current_ep_index
+
1
}
/
{
total_ep_count
}
)
"
)
info_label
:
Label
=
"
Please configure the Service Binding Ports for each Edge Port.
"
current_ep_label
:
Label
=
f
"
Currently configuring on
{
current_edge_port_description
}
"
current_ep_label
:
Label
=
(
f
"
Currently configuring on
{
current_edge_port
.
description
}
"
f
"
(Access Port type:
{
ep_list
[
current_ep_index
].
ap_type
}
)
"
)
geant_sid
:
str
is_tagged
:
bool
=
False
sbp_type
:
SBPType
vlan_id
:
VLAN_ID
|
None
ipv4_address
:
IPv4AddressType
|
None
=
None
ipv6_address
:
IPv6AddressType
|
None
=
None
vlan_id
:
VLAN_ID
ipv4_address
:
IPv4AddressType
ipv6_address
:
IPv6AddressType
custom_firewall_filters
:
bool
=
False
divider
:
Divider
bgp_peer_count
:
PositiveInt
=
1
...
...
@@ -90,11 +97,11 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
class
BGPPeerForm
(
FormPage
):
model_config
=
ConfigDict
(
title
=
(
f
"
Configure BGP peers for
{
current_edge_port
_
description
}
-
"
f
"
Configure BGP peers for
{
current_edge_port
.
description
}
-
"
f
"
(
{
bgp_peer_index
+
1
}
/
{
binding_port_input_form
.
bgp_peer_count
}
)
"
)
)
peer_address
:
IP
v4
Address
Type
|
IPv6AddressType
peer_address
:
IPAddress
bfd_enabled
:
bool
=
False
bfd_interval
:
int
|
None
=
None
bfd_multiplier
:
int
|
None
=
None
...
...
@@ -109,6 +116,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
bgp_peers
.
append
(
bgp_peer_input_form
.
model_dump
())
binding_port_input
[
"
bgp_peers
"
]
=
bgp_peers
binding_port_input
[
"
sbp_type
"
]
=
SBPType
.
L3
binding_port_inputs
.
append
(
binding_port_input
)
current_ep_index
+=
1
...
...
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