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
d323e78d
Commit
d323e78d
authored
5 months ago
by
Mohammad Torkashvand
Browse files
Options
Downloads
Patches
Plain Diff
added moodi telemetry to create EdgePort wf
parent
09e63ab9
No related branches found
No related tags found
1 merge request
!303
added moodi telemetry to create EdgePort wf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/settings.py
+1
-0
1 addition, 0 deletions
gso/settings.py
gso/utils/workflow_steps.py
+28
-18
28 additions, 18 deletions
gso/utils/workflow_steps.py
gso/workflows/edge_port/create_edge_port.py
+3
-0
3 additions, 0 deletions
gso/workflows/edge_port/create_edge_port.py
with
32 additions
and
18 deletions
gso/settings.py
+
1
−
0
View file @
d323e78d
...
...
@@ -209,6 +209,7 @@ class MoodiParams(BaseSettings):
"""
Settings for Moodi.
"""
host
:
str
moodi_enabled
:
bool
=
False
class
OSSParams
(
BaseSettings
):
...
...
This diff is collapsed.
Click to expand it.
gso/utils/workflow_steps.py
+
28
−
18
View file @
d323e78d
...
...
@@ -7,6 +7,7 @@ from orchestrator import inputstep, step
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.types
import
State
,
UUIDstr
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.workflow
import
StepList
,
begin
,
conditional
from
pydantic
import
ConfigDict
from
pydantic_forms.core
import
FormPage
from
pydantic_forms.types
import
FormGenerator
...
...
@@ -14,7 +15,7 @@ from pydantic_forms.validators import Label
from
gso.products.product_blocks.router
import
RouterRole
from
gso.products.product_types.iptrunk
import
Iptrunk
from
gso.services.lso_client
import
LSOState
from
gso.services.lso_client
import
LSOState
,
lso_interaction
from
gso.settings
import
load_oss_params
from
gso.utils.helpers
import
generate_inventory_for_active_routers
from
gso.utils.shared_enums
import
Vendor
...
...
@@ -391,25 +392,34 @@ def prompt_sharepoint_checklist_url(checklist_url: str) -> FormGenerator:
return
{}
@step
(
"
Start Moodi
"
)
def
start_moodi
(
subscription
:
dict
[
str
,
Any
])
->
LSOState
:
_is_moodi_enabled
=
conditional
(
lambda
_
:
load_oss_params
().
MOODI
.
moodi_enabled
)
def
start_moodi
()
->
StepList
:
"""
Start monitoring on demand using Moodi Telemetry stack.
"""
params
=
load_oss_params
()
host
=
load_oss_params
()
.
MOODI
.
host
return
{
"
playbook_name
"
:
"
moodi_telemetry/playbooks/start_moodi.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
{
params
.
MOODI
.
host
:
None
}}},
"
extra_vars
"
:
{
"
subscription
"
:
subscription
},
}
@step
(
"
Start Moodi
"
)
def
_start_moodi
(
subscription
:
dict
[
str
,
Any
])
->
LSOState
:
return
{
"
playbook_name
"
:
"
moodi_telemetry/playbooks/start_moodi.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
{
host
:
None
}}},
"
extra_vars
"
:
{
"
subscription
"
:
subscription
},
}
return
begin
>>
_is_moodi_enabled
(
begin
>>
lso_interaction
(
_start_moodi
))
@step
(
"
Stop Moodi
"
)
def
stop_moodi
()
->
LSOState
:
"""
Stop monitoring on demand.
"""
params
=
load_oss_params
()
return
{
"
playbook_name
"
:
"
moodi_telemetry/playbooks/stop_moodi.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
{
params
.
MOODI
.
host
:
None
}}},
"
extra_vars
"
:
None
,
}
def
stop_moodi
()
->
StepList
:
"""
Stop Moodi Telemetry monitoring on demand.
"""
host
=
load_oss_params
().
MOODI
.
host
@step
(
"
Stop Moodi
"
)
def
_stop_moodi
()
->
LSOState
:
return
{
"
playbook_name
"
:
"
moodi_telemetry/playbooks/stop_moodi.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
{
host
:
None
}}},
"
extra_vars
"
:
None
,
}
return
begin
>>
_is_moodi_enabled
(
begin
>>
lso_interaction
(
_stop_moodi
))
This diff is collapsed.
Click to expand it.
gso/workflows/edge_port/create_edge_port.py
+
3
−
0
View file @
d323e78d
...
...
@@ -31,6 +31,7 @@ from gso.utils.helpers import (
)
from
gso.utils.types.interfaces
import
LAGMember
,
PhysicalPortCapacity
from
gso.utils.types.tt_number
import
TTNumber
from
gso.utils.workflow_steps
import
start_moodi
,
stop_moodi
from
gso.workflows.shared
import
create_summary_form
...
...
@@ -267,11 +268,13 @@ def create_edge_port() -> StepList:
>>
create_subscription
>>
store_process_subscription
(
Target
.
CREATE
)
>>
initialize_subscription
>>
start_moodi
()
>>
reserve_interfaces_in_netbox
>>
lso_interaction
(
create_edge_port_dry
)
>>
lso_interaction
(
create_edge_port_real
)
>>
allocate_interfaces_in_netbox
>>
set_status
(
SubscriptionLifecycle
.
ACTIVE
)
>>
resync
>>
stop_moodi
()
>>
done
)
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