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
Merge requests
!193
Enhancement/nat 515
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Enhancement/nat 515
enhancement/NAT-515
into
develop
Overview
0
Commits
3
Pipelines
2
Changes
1
Merged
Neda Moeini
requested to merge
enhancement/NAT-515
into
develop
1 year ago
Overview
0
Commits
3
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Viewing commit
4501d400
Prev
Next
Show latest version
1 file
+
15
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
4501d400
Improved adding device into LibreNMS functionality.
· 4501d400
Neda Moeini
authored
1 year ago
gso/workflows/router/update_ibgp_mesh.py
+
15
−
10
Options
@@ -186,10 +186,15 @@ def check_ibgp_session(subscription: Router, callback_route: str) -> None:
@step
(
"
Add the router to LibreNMS
"
)
def
add_device_to_librenms
(
subscription
:
Router
)
->
State
:
"""
Add the router as a device to LibreNMS.
"""
client
=
librenms_client
.
LibreNMSClient
()
librenms_result
=
client
.
add_device
(
subscription
.
router
.
router_fqdn
,
SNMPVersion
.
V2C
)
"""
Add the router as a device to LibreNMS.
If the device already exists, retrieve the device information instead of adding it again
"""
client
=
librenms_client
.
LibreNMSClient
()
if
not
client
.
device_exists
(
subscription
.
router
.
router_fqdn
):
librenms_result
=
client
.
add_device
(
subscription
.
router
.
router_fqdn
,
SNMPVersion
.
V2C
)
else
:
librenms_result
=
client
.
get_device
(
subscription
.
router
.
router_fqdn
)
return
{
"
librenms_device
"
:
librenms_result
}
@@ -250,14 +255,14 @@ def update_ibgp_mesh() -> StepList:
>>
store_process_subscription
(
Target
.
MODIFY
)
>>
unsync
>>
calculate_pe_router_list
>>
lso_interaction
(
add_p_to_mesh_dry
)
>>
lso_interaction
(
add_p_to_mesh_real
)
>>
lso_interaction
(
add_all_pe_to_p_dry
)
>>
lso_interaction
(
add_all_pe_to_p_real
)
>>
lso_interaction
(
check_ibgp_session
)
#
>> lso_interaction(add_p_to_mesh_dry)
#
>> lso_interaction(add_p_to_mesh_real)
#
>> lso_interaction(add_all_pe_to_p_dry)
#
>> lso_interaction(add_all_pe_to_p_real)
#
>> lso_interaction(check_ibgp_session)
>>
add_device_to_librenms
>>
prompt_insert_in_radius
>>
prompt_radius_login
#
>> prompt_insert_in_radius
#
>> prompt_radius_login
>>
update_subscription_model
>>
resync
>>
done
Loading