Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brian-dashboard-manager
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
brian
brian-dashboard-manager
Commits
847537b2
Commit
847537b2
authored
3 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
added poller emumetsat-multicast inventory wrapper
parent
112a625e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
brian_dashboard_manager/inventory_provider/interfaces.py
+6
-0
6 additions, 0 deletions
brian_dashboard_manager/inventory_provider/interfaces.py
test/test_eumetsat_multicast.py
+75
-0
75 additions, 0 deletions
test/test_eumetsat_multicast.py
with
81 additions
and
0 deletions
brian_dashboard_manager/inventory_provider/interfaces.py
+
6
−
0
View file @
847537b2
...
...
@@ -64,3 +64,9 @@ def get_gws_indirect(host):
r
.
raise_for_status
()
interfaces
=
r
.
json
()
return
interfaces
def
get_eumetsat_multicast_subscriptions
(
host
):
r
=
requests
.
get
(
f
'
{
host
}
/poller/eumetsat-multicast
'
)
r
.
raise_for_status
()
return
r
.
json
()
This diff is collapsed.
Click to expand it.
test/test_eumetsat_multicast.py
0 → 100644
+
75
−
0
View file @
847537b2
import
responses
import
json
from
brian_dashboard_manager.templating.gws
import
generate_gws
from
brian_dashboard_manager.inventory_provider.interfaces
import
\
get_eumetsat_multicast_subscriptions
TEST_DATA
=
[
{
'
router
'
:
'
mx1.ams.nl.geant.net
'
,
'
oid
'
:
'
1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255
'
,
'
community
'
:
'
0pBiFbD
'
,
'
subscription
'
:
'
232.223.222.1
'
,
'
endpoint
'
:
'
193.17.9.3
'
},
{
'
router
'
:
'
mx1.ams.nl.geant.net
'
,
'
oid
'
:
'
1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255
'
,
'
community
'
:
'
0pBiFbD
'
,
'
subscription
'
:
'
232.223.222.2
'
,
'
endpoint
'
:
'
193.17.9.3
'
},
{
'
router
'
:
'
mx1.lon.uk.geant.net
'
,
'
oid
'
:
'
1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255
'
,
'
community
'
:
'
0pBiFbD
'
,
'
subscription
'
:
'
232.223.222.1
'
,
'
endpoint
'
:
'
193.17.9.3
'
},
{
'
router
'
:
'
mx1.lon.uk.geant.net
'
,
'
oid
'
:
'
1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255
'
,
'
community
'
:
'
0pBiFbD
'
,
'
subscription
'
:
'
232.223.222.2
'
,
'
endpoint
'
:
'
193.17.9.3
'
},
{
'
router
'
:
'
mx1.fra.de.geant.net
'
,
'
oid
'
:
'
1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.1.193.17.9.3.255.255.255.255
'
,
'
community
'
:
'
0pBiFbD
'
,
'
subscription
'
:
'
232.223.222.1
'
,
'
endpoint
'
:
'
193.17.9.3
'
},
{
'
router
'
:
'
mx1.fra.de.geant.net
'
,
'
oid
'
:
'
1.3.6.1.2.1.83.1.1.2.1.16.232.223.222.2.193.17.9.3.255.255.255.255
'
,
'
community
'
:
'
0pBiFbD
'
,
'
subscription
'
:
'
232.223.222.2
'
,
'
endpoint
'
:
'
193.17.9.3
'
}
]
@responses.activate
def
test_eumetsat_subscriptions
(
data_config
,
client
):
def
get_callback
(
request
):
return
200
,
{},
json
.
dumps
(
TEST_DATA
)
responses
.
add_callback
(
method
=
responses
.
GET
,
url
=
f
'
{
data_config
[
"
inventory_provider
"
]
}
/poller/eumetsat-multicast
'
,
callback
=
get_callback
)
subscriptions
=
get_eumetsat_multicast_subscriptions
(
data_config
[
'
inventory_provider
'
])
print
(
subscriptions
)
# dashboards = list(generate_gws(gws_data, 'testdatasource'))
#
# assert len(dashboards) == 2
#
# assert dashboards[0]['title'] == 'GWS Direct - Cogent'
# assert len(dashboards[0]['panels']) == 3
#
# assert dashboards[1]['title'] == 'GWS Direct - Telia'
# assert len(dashboards[1]['panels']) == 1
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