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
266ef7fa
Commit
266ef7fa
authored
7 months ago
by
Neda Moeini
Committed by
Karel van Klink
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a step in router validation workflow to check if Kentik entry exists if it's a PE router.
parent
9e0c9a99
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!257
Feature/add kentik workflow
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/router/validate_router.py
+17
-0
17 additions, 0 deletions
gso/workflows/router/validate_router.py
with
17 additions
and
0 deletions
gso/workflows/router/validate_router.py
+
17
−
0
View file @
266ef7fa
...
...
@@ -14,6 +14,7 @@ from pydantic_forms.types import State, UUIDstr
from
gso.products.product_blocks.router
import
RouterRole
from
gso.products.product_types.router
import
Router
from
gso.services
import
infoblox
,
lso_client
from
gso.services.kentik_client
import
KentikClient
from
gso.services.librenms_client
import
LibreNMSClient
from
gso.services.lso_client
import
anonymous_lso_interaction
,
execute_playbook
from
gso.services.netbox_client
import
NetboxClient
...
...
@@ -84,6 +85,20 @@ def check_librenms_entry_exists(subscription: Router) -> None:
raise
ProcessFailureError
(
message
=
"
LibreNMS configuration error
"
,
details
=
errors
)
@step
(
"
Verify Kentik entry for PE router
"
)
def
check_kentik_entry_exists
(
subscription
:
Router
)
->
None
:
"""
Validate the Kentik entry for a PE Router.
Raises an HTTP error 404 when the device is not present in Kentik.
"""
client
=
KentikClient
()
device
=
client
.
get_device_by_name
(
subscription
.
router
.
router_fqdn
)
if
not
device
:
raise
ProcessFailureError
(
message
=
"
Device not found in Kentik
"
,
details
=
{
"
device
"
:
subscription
.
router
.
router_fqdn
}
)
@step
(
"
Check base config for drift
"
)
def
verify_base_config
(
subscription
:
Router
,
callback_route
:
str
)
->
None
:
"""
Workflow step for running a playbook that checks whether base config has drifted.
"""
...
...
@@ -113,6 +128,7 @@ def validate_router() -> StepList:
* Validate configuration of the iBGP mesh
"""
is_juniper_router
=
conditional
(
lambda
state
:
state
[
"
subscription
"
][
"
router
"
][
"
vendor
"
]
==
Vendor
.
JUNIPER
)
is_pe_router
=
conditional
(
lambda
state
:
state
[
"
subscription
"
][
"
router
"
][
"
router_role
"
]
==
RouterRole
.
PE
)
return
(
begin
...
...
@@ -123,6 +139,7 @@ def validate_router() -> StepList:
>>
verify_ipam_loopback
>>
check_netbox_entry_exists
>>
check_librenms_entry_exists
>>
is_pe_router
(
check_kentik_entry_exists
)
>>
anonymous_lso_interaction
(
verify_base_config
)
>>
anonymous_lso_interaction
(
verify_p_ibgp
)
>>
resync
...
...
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