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
!309
Add a router to Kentik when creating with a PE role
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add a router to Kentik when creating with a PE role
feature/create-kentik-for-pe-router
into
develop
Overview
0
Commits
1
Pipelines
1
Changes
5
Merged
Karel van Klink
requested to merge
feature/create-kentik-for-pe-router
into
develop
7 months ago
Overview
0
Commits
1
Pipelines
1
Changes
5
Expand
0
0
Merge request reports
Compare
develop
develop (base)
and
latest version
latest version
e8b37d37
1 commit,
7 months ago
5 files
+
45
−
42
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
gso/utils/workflow_steps.py
+
27
−
0
Options
@@ -6,6 +6,7 @@ from typing import Any
from
orchestrator
import
inputstep
,
step
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.types
import
State
,
UUIDstr
from
orchestrator.utils.errors
import
ProcessFailureError
from
orchestrator.utils.json
import
json_dumps
from
orchestrator.workflow
import
StepList
,
conditional
from
pydantic
import
ConfigDict
@@ -15,6 +16,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.kentik_client
import
KentikClient
,
NewKentikDevice
from
gso.services.lso_client
import
LSOState
,
indifferent_lso_interaction
from
gso.settings
import
load_oss_params
from
gso.utils.helpers
import
generate_inventory_for_active_routers
@@ -423,3 +425,28 @@ def stop_moodi() -> StepList:
}
return
_is_moodi_enabled
(
indifferent_lso_interaction
(
_stop_moodi
))
@step
(
"
Create Kentik device
"
)
def
create_kentik_device
(
state
:
State
)
->
State
:
"""
Create a new device in Kentik.
"""
kentik_client
=
KentikClient
()
kentik_site
=
kentik_client
.
get_site_by_name
(
state
[
"
subscription
"
][
"
router
"
][
"
router_site
"
][
"
site_name
"
])
if
not
kentik_site
:
msg
=
"
Site could not be found in Kentik.
"
raise
ProcessFailureError
(
msg
,
details
=
state
[
"
subscription
"
][
"
router
"
][
"
router_site
"
][
"
site_name
"
])
new_device
=
NewKentikDevice
(
device_name
=
state
[
"
subscription
"
][
"
router
"
][
"
router_fqdn
"
],
device_description
=
str
(
state
[
"
subscription
"
][
"
subscription_id
"
]),
sending_ips
=
[
str
(
state
[
"
subscription
"
][
"
router
"
][
"
router_lo_ipv4_address
"
])],
site_id
=
kentik_site
[
"
id
"
],
device_snmp_ip
=
str
(
state
[
"
subscription
"
][
"
router
"
][
"
router_lo_ipv4_address
"
]),
device_bgp_flowspec
=
False
,
device_bgp_neighbor_ip
=
str
(
state
[
"
subscription
"
][
"
router
"
][
"
router_lo_ipv4_address
"
]),
device_bgp_neighbor_ip6
=
str
(
state
[
"
subscription
"
][
"
router
"
][
"
router_lo_ipv6_address
"
]),
)
kentik_device
=
kentik_client
.
create_device
(
new_device
)
return
{
"
kentik_device
"
:
kentik_device
}
Loading