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
Jira
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
1362114b
Verified
Commit
1362114b
authored
1 month ago
by
Saket Agrahari
Committed by
Karel van Klink
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
adding config change and modify iptrunk
parent
e686ef94
No related branches found
No related tags found
1 merge request
!424
Resolve NAT-1048 "Service version"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/gso-services-config.json
+16
-0
16 additions, 0 deletions
gso/gso-services-config.json
gso/settings.py
+21
-0
21 additions, 0 deletions
gso/settings.py
gso/workflows/iptrunk/modify_trunk_interface.py
+14
-9
14 additions, 9 deletions
gso/workflows/iptrunk/modify_trunk_interface.py
with
51 additions
and
9 deletions
gso/gso-services-config.json
0 → 100644
+
16
−
0
View file @
1362114b
{
"IP_TRUNK"
:
{
"VERSION"
:
{
"1.0"
:
"Base Version"
,
"1.1"
:
" Minor Upgrade"
},
"default_version"
:
"1.0"
},
"GEANT_IP"
:
{
"VERSION"
:
{
"1.0"
:
"Base Version"
,
"2.0"
:
"Major Upgrade"
},
"default_version"
:
"1.0"
}
}
This diff is collapsed.
Click to expand it.
gso/settings.py
+
21
−
0
View file @
1362114b
...
@@ -250,7 +250,28 @@ def load_oss_params() -> OSSParams:
...
@@ -250,7 +250,28 @@ def load_oss_params() -> OSSParams:
return
OSSParams
(
**
json
.
loads
(
file
.
read
()))
return
OSSParams
(
**
json
.
loads
(
file
.
read
()))
class
ServiceConfig
(
BaseSettings
):
"""
Configurations for base gso service.
"""
version
:
dict
[
str
,
str
]
default_version
:
str
class
GSOServiceConfig
(
BaseSettings
):
"""
Configuration for the GSO service.
"""
IP_TRUNK
:
ServiceConfig
GEANT_IP
:
ServiceConfig
def
load_gso_service_config
()
->
GSOServiceConfig
:
"""
Load the GSO service configuration from the environment variable.
"""
"""
Look for ``GSO_SERVICE_CONFIG`` in the environment and load the parameters from that file.
"""
with
Path
(
os
.
environ
[
"
GSO_SERVICE_CONFIG
"
]).
open
(
encoding
=
"
utf-8
"
)
as
file
:
return
GSOServiceConfig
(
**
json
.
loads
(
file
.
read
()))
celery_settings
=
CelerySettings
()
celery_settings
=
CelerySettings
()
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
logger
.
debug
(
load_oss_params
())
logger
.
debug
(
load_oss_params
())
logger
.
debug
(
load_gso_service_config
())
This diff is collapsed.
Click to expand it.
gso/workflows/iptrunk/modify_trunk_interface.py
+
14
−
9
View file @
1362114b
...
@@ -12,12 +12,6 @@ from typing import Annotated
...
@@ -12,12 +12,6 @@ from typing import Annotated
from
uuid
import
UUID
,
uuid4
from
uuid
import
UUID
,
uuid4
from
annotated_types
import
Len
from
annotated_types
import
Len
from
orchestrator.forms
import
FormPage
,
SubmitFormPage
from
orchestrator.targets
import
Target
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.workflow
import
StepList
,
begin
,
conditional
,
done
,
step
,
workflow
from
orchestrator.workflows.steps
import
resync
,
store_process_subscription
,
unsync
from
orchestrator.workflows.utils
import
wrap_modify_initial_input_form
from
pydantic
import
AfterValidator
,
ConfigDict
,
Field
from
pydantic
import
AfterValidator
,
ConfigDict
,
Field
from
pydantic_forms.types
import
FormGenerator
,
State
,
UUIDstr
from
pydantic_forms.types
import
FormGenerator
,
State
,
UUIDstr
from
pydantic_forms.validators
import
Label
,
ReadOnlyField
from
pydantic_forms.validators
import
Label
,
ReadOnlyField
...
@@ -30,6 +24,7 @@ from gso.products.product_blocks.iptrunk import (
...
@@ -30,6 +24,7 @@ from gso.products.product_blocks.iptrunk import (
from
gso.products.product_types.iptrunk
import
Iptrunk
from
gso.products.product_types.iptrunk
import
Iptrunk
from
gso.services.lso_client
import
LSOState
,
lso_interaction
from
gso.services.lso_client
import
LSOState
,
lso_interaction
from
gso.services.netbox_client
import
NetboxClient
from
gso.services.netbox_client
import
NetboxClient
from
gso.settings
import
ServiceConfig
,
load_gso_service_config
from
gso.utils.helpers
import
(
from
gso.utils.helpers
import
(
available_interfaces_choices
,
available_interfaces_choices
,
available_interfaces_choices_including_current_members
,
available_interfaces_choices_including_current_members
,
...
@@ -43,6 +38,12 @@ from gso.utils.types.tt_number import TTNumber
...
@@ -43,6 +38,12 @@ from gso.utils.types.tt_number import TTNumber
from
gso.utils.types.unique_field
import
validate_field_is_unique
from
gso.utils.types.unique_field
import
validate_field_is_unique
from
gso.workflows.iptrunk.migrate_iptrunk
import
check_ip_trunk_optical_levels_pre
from
gso.workflows.iptrunk.migrate_iptrunk
import
check_ip_trunk_optical_levels_pre
from
gso.workflows.iptrunk.validate_iptrunk
import
check_ip_trunk_isis
from
gso.workflows.iptrunk.validate_iptrunk
import
check_ip_trunk_isis
from
orchestrator.forms
import
FormPage
,
SubmitFormPage
from
orchestrator.targets
import
Target
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.workflow
import
StepList
,
begin
,
conditional
,
done
,
step
,
workflow
from
orchestrator.workflows.steps
import
resync
,
store_process_subscription
,
unsync
from
orchestrator.workflows.utils
import
wrap_modify_initial_input_form
def
initialize_ae_members
(
def
initialize_ae_members
(
...
@@ -94,7 +95,10 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
...
@@ -94,7 +95,10 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
]
]
|
None
|
None
)
=
subscription
.
iptrunk
.
gs_id
)
=
subscription
.
iptrunk
.
gs_id
iptrunk_description
:
str
|
None
=
subscription
.
iptrunk
.
iptrunk_description
iptrunk_description
:
str
|
None
=
subscription
.
iptrunk
.
iptrunk_description
iptrunk_config_version
:
load_gso_service_config
().
IP_TRUNK
.
version
|
str
\
=
subscription
.
iptrunk
.
iptrunk_config_version
iptrunk_type
:
IptrunkType
|
str
=
subscription
.
iptrunk
.
iptrunk_type
# FIXME: remove str workaround
iptrunk_type
:
IptrunkType
|
str
=
subscription
.
iptrunk
.
iptrunk_type
# FIXME: remove str workaround
warning_label
:
Label
=
(
warning_label
:
Label
=
(
"
Changing the PhyPortCapacity will result in the deletion of all AE members.
"
"
Changing the PhyPortCapacity will result in the deletion of all AE members.
"
...
@@ -268,6 +272,7 @@ def modify_iptrunk_subscription(
...
@@ -268,6 +272,7 @@ def modify_iptrunk_subscription(
iptrunk_speed
:
PhysicalPortCapacity
,
iptrunk_speed
:
PhysicalPortCapacity
,
iptrunk_minimum_links
:
int
,
iptrunk_minimum_links
:
int
,
iptrunk_description_suffix
:
str
|
None
,
iptrunk_description_suffix
:
str
|
None
,
iptrunk_config_version
:
ServiceConfig
.
version
,
side_a_ga_id
:
str
|
None
,
side_a_ga_id
:
str
|
None
,
side_a_ae_members
:
list
[
dict
],
side_a_ae_members
:
list
[
dict
],
side_b_ga_id
:
str
|
None
,
side_b_ga_id
:
str
|
None
,
...
@@ -302,7 +307,7 @@ def modify_iptrunk_subscription(
...
@@ -302,7 +307,7 @@ def modify_iptrunk_subscription(
subscription
.
iptrunk
.
iptrunk_speed
=
iptrunk_speed
subscription
.
iptrunk
.
iptrunk_speed
=
iptrunk_speed
subscription
.
iptrunk
.
iptrunk_minimum_links
=
iptrunk_minimum_links
subscription
.
iptrunk
.
iptrunk_minimum_links
=
iptrunk_minimum_links
subscription
.
iptrunk
.
iptrunk_description_suffix
=
iptrunk_description_suffix
subscription
.
iptrunk
.
iptrunk_description_suffix
=
iptrunk_description_suffix
subscription
.
iptrunk
.
iptrunk_config_version
=
iptrunk_config_version
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
ga_id
=
side_a_ga_id
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
ga_id
=
side_a_ga_id
update_side_members
(
subscription
,
0
,
side_a_ae_members
)
update_side_members
(
subscription
,
0
,
side_a_ae_members
)
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
ga_id
=
side_b_ga_id
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
ga_id
=
side_b_ga_id
...
@@ -534,8 +539,8 @@ def modify_trunk_interface() -> StepList:
...
@@ -534,8 +539,8 @@ def modify_trunk_interface() -> StepList:
>>
capacity_has_changed
(
lso_interaction
(
check_ip_trunk_connectivity
))
>>
capacity_has_changed
(
lso_interaction
(
check_ip_trunk_connectivity
))
>>
capacity_has_changed
(
lso_interaction
(
check_ip_trunk_isis
))
>>
capacity_has_changed
(
lso_interaction
(
check_ip_trunk_isis
))
>>
modify_iptrunk_subscription
>>
modify_iptrunk_subscription
>>
side_a_is_nokia
(
netbox_update_interfaces_side_a
)
#
>> side_a_is_nokia(netbox_update_interfaces_side_a)
>>
side_b_is_nokia
(
netbox_update_interfaces_side_b
)
#
>> side_b_is_nokia(netbox_update_interfaces_side_b)
>>
lso_interaction
(
provision_ip_trunk_iface_dry
)
>>
lso_interaction
(
provision_ip_trunk_iface_dry
)
>>
lso_interaction
(
provision_ip_trunk_iface_real
)
>>
lso_interaction
(
provision_ip_trunk_iface_real
)
>>
side_a_is_nokia
(
allocate_interfaces_in_netbox_side_a
)
>>
side_a_is_nokia
(
allocate_interfaces_in_netbox_side_a
)
...
...
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