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
15d8d358
Commit
15d8d358
authored
1 year ago
by
Simone Spinelli
Browse files
Options
Downloads
Patches
Plain Diff
Iptrunk form finished but fails with iptrunk_type
parent
81d9d92c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!8
Feature/iptrunks prototype
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/products/product_types/iptrunk.py
+2
-2
2 additions, 2 deletions
gso/products/product_types/iptrunk.py
gso/workflows/iptrunk/create_iptrunk.py
+34
-15
34 additions, 15 deletions
gso/workflows/iptrunk/create_iptrunk.py
with
36 additions
and
17 deletions
gso/products/product_types/iptrunk.py
+
2
−
2
View file @
15d8d358
...
...
@@ -6,8 +6,8 @@ from gso.products.product_blocks.iptrunk \
class
IptrunkType
(
strEnum
):
d
ark_fiber
=
"
d
ark_fiber
"
l
eased
=
"
l
eased
"
D
ark_fiber
=
"
D
ark_fiber
"
L
eased
=
"
L
eased
"
class
IptrunkInactive
(
SubscriptionModel
,
is_base
=
True
):
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/iptrunk/create_iptrunk.py
+
34
−
15
View file @
15d8d358
...
...
@@ -46,20 +46,24 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
title
=
product_name
geant_s_sid
:
str
iptrunk_type
:
iptrunk
.
IptrunkType
iptrunk_speed
:
str
# This should be an enum: 1/10/100/400
iptrunk_minimum_links
:
int
iptrunk_sideA_fqdn
:
device_selector
(
choice_value
=
'
DeviceEnumA
'
)
iptrunk_sideA_ae_iface
:
str
iptrunk_sideA_ae_geant_a_sid
:
str
iptrunk_sideA_ae_members
:
list
[
str
]
iptrunk_sideB_fqdn
:
device_selector
(
choice_value
=
'
DeviceEnumB
'
)
iptrunk_sideB_ae_iface
:
str
iptrunk_sideB_ae_geant_a_sid
:
str
iptrunk_sideB_ae_members
:
list
[
str
]
# TODO: we need additional validation:
# sideA fqdn must be different from sideB fqdn
# the lenght of iptrunk_sideA_ae_members should be the same as iptrunk_sideA_ae_members
# interface names must be validated
# We also need additional fields like a "name" or a description for trunk itself and for all the members
user_input
=
yield
CreateIptrunkForm
...
...
@@ -78,14 +82,9 @@ def create_subscription(product: UUIDstr) -> State:
@step
(
"
Get information from IPAM
"
)
def
get_info_from_ipam
(
subscription
:
iptrunk
.
IptrunkInactive
)
->
State
:
lo
=
ipam
.
new_iptrunk_lo_address
()
subscription
.
iptrunk
.
lo_ipv4_address
=
lo
.
v4
subscription
.
iptrunk
.
lo_ipv6_address
=
lo
.
v6
# TODO: get info about how these should be generated
subscription
.
iptrunk
.
lo_iso_address
=
"
49.51e5.0001.0620.4009.6047.00
"
subscription
.
iptrunk
.
si_ipv4_network
=
"
192.168.0.0/31
"
subscription
.
iptrunk
.
ias_lt_ipv4_network
=
"
192.168.1.0/31
"
subscription
.
iptrunk
.
ias_lt_ipv6_network
=
"
fc00:798:1::150/126
"
subscription
.
iptrunk
.
iptrunk_ipv4_network
=
"
192.168.1.0/31
"
subscription
.
iptrunk
.
iptrunk_ipv6_network
=
"
fc00:798:1::150/126
"
return
{
"
subscription
"
:
subscription
}
...
...
@@ -94,15 +93,35 @@ def get_info_from_ipam(subscription: iptrunk.IptrunkInactive) -> State:
@step
(
"
Initialize subscription
"
)
def
initialize_subscription
(
subscription
:
iptrunk
.
IptrunkInactive
,
fqdn
:
str
,
ts_address
:
ipaddress
.
IPv4Address
,
ts_port
:
str
geant_s_sid
:
str
,
iptrunk_type
:
iptrunk
.
IptrunkType
,
iptrunk_speed
:
str
,
iptrunk_minimum_links
:
int
,
iptrunk_sideA_fqdn
:
str
,
iptrunk_sideA_ae_iface
:
str
,
iptrunk_sideA_ae_geant_a_sid
:
str
,
iptrunk_sideA_ae_members
:
list
[
str
],
iptrunk_sideB_fqdn
:
str
,
iptrunk_sideB_ae_iface
:
str
,
iptrunk_sideB_ae_geant_a_sid
:
str
,
iptrunk_sideB_ae_members
:
list
[
str
]
)
->
State
:
subscription
.
iptrunk
.
fqdn
=
fqdn
subscription
.
iptrunk
.
ts_address
=
str
(
ts_address
)
subscription
.
iptrunk
.
ts_port
=
str
(
ts_port
)
subscription
.
iptrunk_vendor
=
iptrunk_vendor
subscription
.
description
=
f
"
Iptrunk
{
fqdn
}
type
\
subscription
.
iptrunk_type
=
iptrunk_type
subscription
.
iptrunk
.
geant_s_sid
=
geant_s_sid
subscription
.
iptrunk
.
iptrunk_speed
=
iptrunk_speed
subscription
.
iptrunk
.
iptrunk_minimum_links
=
iptrunk_minimum_links
subscription
.
iptrunk
.
iptrunk_sideA_fqdn
=
iptrunk_sideA_fqdn
subscription
.
iptrunk
.
iptrunk_sideA_ae_iface
=
iptrunk_sideA_ae_iface
subscription
.
iptrunk
.
iptrunk_sideA_ae_geant_a_sid
=
iptrunk_sideA_ae_geant_a_sid
subscription
.
iptrunk
.
iptrunk_sideA_ae_members
=
iptrunk_sideA_ae_members
subscription
.
iptrunk
.
iptrunk_sideB_fqdn
=
iptrunk_sideB_fqdn
subscription
.
iptrunk
.
iptrunk_sideB_ae_iface
=
iptrunk_sideB_ae_iface
subscription
.
iptrunk
.
iptrunk_sideB_ae_geant_a_sid
=
iptrunk_sideB_ae_geant_a_sid
subscription
.
iptrunk
.
iptrunk_sideB_ae_members
=
iptrunk_sideB_ae_members
subscription
.
description
=
f
"
Iptrunk
{
geant_s_sid
}
:
\
(
{
subscription
.
iptrunk_type
}
)
"
subscription
=
iptrunk
.
IptrunkProvisioning
.
from_other_lifecycle
(
subscription
,
SubscriptionLifecycle
.
PROVISIONING
...
...
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