Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
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
geant-swd
dashboardv3
inventory-provider
Merge requests
!1
Feature/reporting 297 msr mdvpn endpoint
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feature/reporting 297 msr mdvpn endpoint
feature/REPORTING-297-msr-mdvpn-endpoint
into
develop
Overview
11
Commits
11
Pipelines
0
Changes
4
2 unresolved threads
Hide all comments
Merged
Sam Roberts
requested to merge
feature/REPORTING-297-msr-mdvpn-endpoint
into
develop
2 years ago
Overview
11
Commits
11
Pipelines
0
Changes
3
2 unresolved threads
Hide all comments
Expand
0
0
Merge request reports
Compare
version 3
version 4
04babef5
2 years ago
version 3
d258e42e
2 years ago
version 2
ed91a4dc
2 years ago
version 1
7ec48d2a
2 years ago
develop (base)
and
latest version
latest version
bfb583e3
11 commits,
2 years ago
version 4
04babef5
10 commits,
2 years ago
version 3
d258e42e
9 commits,
2 years ago
version 2
ed91a4dc
7 commits,
2 years ago
version 1
7ec48d2a
6 commits,
2 years ago
Show latest version
3 files
+
19
−
30
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
inventory_provider/routes/msr.py
+
19
−
22
Options
@@ -1000,9 +1000,7 @@ def mdvpn():
return
index
def
_bgplu_peerings
(
asn
,
bgplu_index
):
if
asn
not
in
bgplu_index
:
yield
False
for
peering
in
bgplu_index
[
asn
]:
for
peering
in
bgplu_index
.
get
(
asn
,
[]):
formatted_peering
=
{
"
name
"
:
peering
[
'
description
'
],
"
v4
"
:
peering
[
'
address
'
],
@@ -1012,29 +1010,28 @@ def mdvpn():
yield
formatted_peering
def
_vpnrr_peerings
(
asn
,
vpnrr_index
):
if
asn
not
in
vpnrr_index
:
yield
False
vrr_peering_group
=
vpnrr_index
[
asn
]
# rearrange into index using ipv4 as key
# this will collect related entries under the same ipv4
ip_index
=
_make_group_index
(
vrr_peering_group
,
'
address
'
)
for
ip
in
ip_index
:
ip_details
=
ip_index
[
ip
]
# a list of all info for given ipv4
hostnames
=
[
item
[
'
hostname
'
]
for
item
in
ip_details
]
description
=
ip_details
[
0
][
'
description
'
]
formatted_peering
=
{
"
description
"
:
_get_consistent_description
(
description
),
"
v4
"
:
ip
,
"
hostname
"
:
hostnames
}
yield
formatted_peering
if
asn
in
vpnrr_index
:
vrr_peering_group
=
vpnrr_index
[
asn
]
# rearrange into index using ipv4 as key
# this will collect related entries under the same ipv4
ip_index
=
_make_group_index
(
vrr_peering_group
,
'
address
'
)
for
ip
in
ip_index
:
ip_details
=
ip_index
[
ip
]
# a list of all info for given ipv4
hostnames
=
[
item
[
'
hostname
'
]
for
item
in
ip_details
]
description
=
ip_details
[
0
][
'
description
'
]
formatted_peering
=
{
"
description
"
:
_get_consistent_description
(
description
),
"
v4
"
:
ip
,
"
hostname
"
:
hostnames
}
yield
formatted_peering
def
_peerings_for_nren
(
asn
,
bgplu_index
,
vpnrr_index
):
return
{
"
asn
"
:
asn
,
"
AP
"
:
list
(
filter
(
None
,
_bgplu_peerings
(
asn
,
bgplu_index
))
)
,
"
VRR
"
:
list
(
filter
(
None
,
_vpnrr_peerings
(
asn
,
vpnrr_index
))
)
"
AP
"
:
list
(
_bgplu_peerings
(
asn
,
bgplu_index
)),
"
VRR
"
:
list
(
_vpnrr_peerings
(
asn
,
vpnrr_index
))
}
r
=
common
.
get_current_redis
()
Loading