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
Commits
c10d6382
Commit
c10d6382
authored
1 year ago
by
Pelle Koster
Browse files
Options
Downloads
Patches
Plain Diff
Feature/POL1-803 add ANA dashboard tag for GA/ANA interfaces
parent
3d835737
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!33
Feature/POL1-803 add ANA dashboard tag for GA/ANA interfaces
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inventory_provider/routes/poller.py
+3
-0
3 additions, 0 deletions
inventory_provider/routes/poller.py
test/test_general_poller_routes.py
+20
-0
20 additions, 0 deletions
test/test_general_poller_routes.py
with
23 additions
and
0 deletions
inventory_provider/routes/poller.py
+
3
−
0
View file @
c10d6382
...
@@ -126,6 +126,7 @@ class BRIAN_DASHBOARDS(Enum):
...
@@ -126,6 +126,7 @@ class BRIAN_DASHBOARDS(Enum):
CAE1
=
auto
()
CAE1
=
auto
()
IC1
=
auto
()
IC1
=
auto
()
COPERNICUS
=
auto
()
COPERNICUS
=
auto
()
ANA
=
auto
()
# NREN customer
# NREN customer
NREN
=
auto
()
NREN
=
auto
()
...
@@ -514,6 +515,8 @@ def _get_dashboards(interface):
...
@@ -514,6 +515,8 @@ def _get_dashboards(interface):
regex
=
r
'
(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s
'
regex
=
r
'
(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s
'
if
re
.
match
(
regex
,
description
):
if
re
.
match
(
regex
,
description
):
yield
BRIAN_DASHBOARDS
.
NREN
yield
BRIAN_DASHBOARDS
.
NREN
if
"
GA-
"
in
description
and
"
ANA-
"
in
description
:
yield
BRIAN_DASHBOARDS
.
ANA
def
_get_dashboard_data
(
ifc
,
customers
):
def
_get_dashboard_data
(
ifc
,
customers
):
...
...
This diff is collapsed.
Click to expand it.
test/test_general_poller_routes.py
+
20
−
0
View file @
c10d6382
...
@@ -333,6 +333,26 @@ def test_ae12_aggregate_dashboards(router, interface, exp_dashboards):
...
@@ -333,6 +333,26 @@ def test_ae12_aggregate_dashboards(router, interface, exp_dashboards):
assert
[
d
.
name
for
d
in
dashboards
]
==
exp_dashboards
assert
[
d
.
name
for
d
in
dashboards
]
==
exp_dashboards
@pytest.mark.parametrize
(
"
description, has_ana
"
,
[
(
"
PHY GA-1 ANA-100
"
,
True
),
(
"
PHY ANA-100
"
,
False
),
(
"
PHY GA-1
"
,
False
),
(
"
PHY
"
,
False
),
],
)
def
test_ana_aggregate_dashboard
(
description
,
has_ana
):
interface
=
{
"
router
"
:
"
some.router
"
,
"
name
"
:
"
ifc-1
"
,
"
description
"
:
description
,
}
dashboards
=
poller
.
_get_dashboards
(
interface
)
expected
=
[
"
ANA
"
]
if
has_ana
else
[]
assert
[
d
.
name
for
d
in
dashboards
]
==
expected
@pytest.mark.parametrize
(
'
interface,customers,dashboard_info
'
,
[
@pytest.mark.parametrize
(
'
interface,customers,dashboard_info
'
,
[
({
({
'
description
'
:
'
SRV_IAS CUSTOMER JISC #JISC-AP1-IAS IASPS | ASN786
'
,
'
description
'
:
'
SRV_IAS CUSTOMER JISC #JISC-AP1-IAS IASPS | ASN786
'
,
...
...
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