Skip to content
Snippets Groups Projects
Commit 847537b2 authored by Erik Reid's avatar Erik Reid
Browse files

added poller emumetsat-multicast inventory wrapper

parent 112a625e
No related branches found
No related tags found
No related merge requests found
......@@ -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()
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment