diff --git a/brian_dashboard_manager/config.py b/brian_dashboard_manager/config.py index 0fc54529b201b814d5250f83f17d301fb346c9e2..c4d1dba95715e0e03f095e54843b145f35711ef5 100644 --- a/brian_dashboard_manager/config.py +++ b/brian_dashboard_manager/config.py @@ -48,7 +48,7 @@ DEFAULT_ORGANIZATIONS = [ "excluded_dashboards": [ "GÉANT Office devices", "GÉANT VM", - "GÉANT LAB devices" + "Lab Devices" ], "excluded_folders": { "Aggregates": ["CAE1"], @@ -60,22 +60,25 @@ DEFAULT_ORGANIZATIONS = [ "excluded_nrens": [ "CARNET", "PSNC", + "PIONIER", "CUSTOMER GEANT", "GEANT-IT" ], "excluded_dashboards": [ "GÉANT Office devices", "GÉANT VM", - "GÉANT LAB devices" + "Lab Devices" "IAS", - "GEANTOPEN" + "GEANTOPEN", + "IAS Peers" ], "excluded_folders": { - "Aggregates": ["CAE1", "GWS UPSTREAMS"], + "Aggregates": ["CAE1", "GWS UPSTREAMS", "IAS PEERS"], "IAS CUSTOMER": True, "IAS PRIVATE": True, "IAS PUBLIC": True, - "IAS UPSTREAM": True + "IAS UPSTREAM": True, + "GWS PHY Upstream": True } }, { @@ -87,7 +90,7 @@ DEFAULT_ORGANIZATIONS = [ "excluded_dashboards": [ "GÉANT Office devices", "GÉANT VM", - "GÉANT LAB devices", + "Lab Devices", ], "excluded_folders": {} }, @@ -96,21 +99,24 @@ DEFAULT_ORGANIZATIONS = [ "excluded_nrens": [ "CARNET", "PSNC", + "PIONIER", "CUSTOMER GEANT", "GEANT-IT" ], "excluded_dashboards": [ "GÉANT Office devices", "GÉANT VM", - "GÉANT LAB devices" - "IAS" + "Lab Devices" + "IAS", + "IAS Peers" ], "excluded_folders": { - "Aggregates": ["GWS UPSTREAMS"], + "Aggregates": ["GWS UPSTREAMS", "IAS PEERS"], "IAS CUSTOMER": True, "IAS PRIVATE": True, "IAS PUBLIC": True, - "IAS UPSTREAM": True + "IAS UPSTREAM": True, + "GWS PHY Upstream": True } } ] diff --git a/brian_dashboard_manager/dashboards/infrastructure_lab.json b/brian_dashboard_manager/dashboards/infrastructure_lab.json index d8c841f6372c9f8975ebc2a38f5dcdc11ea778b2..ba75b0c7d3998da55093ed9ac1750792ce60695e 100644 --- a/brian_dashboard_manager/dashboards/infrastructure_lab.json +++ b/brian_dashboard_manager/dashboards/infrastructure_lab.json @@ -693,7 +693,7 @@ "multi": true, "name": "interface_name", "options": [], - "query": "SHOW TAG VALUES ON test_brian WITH KEY IN (interface_name) WHERE hostname =~ /$hostname/ ", + "query": "SHOW TAG VALUES WITH KEY IN (interface_name) WHERE hostname =~ /$hostname/ ", "refresh": 1, "regex": "", "skipUrlSync": false, diff --git a/brian_dashboard_manager/grafana/dashboard.py b/brian_dashboard_manager/grafana/dashboard.py index 376031430f4b25ea7e5061b7c0f2fa3575fb238b..4b0fba74ff2529f972f67505a8471bb820c09874 100644 --- a/brian_dashboard_manager/grafana/dashboard.py +++ b/brian_dashboard_manager/grafana/dashboard.py @@ -34,7 +34,8 @@ def delete_dashboard(request: TokenRequest, dashboard, folder_id=None): dash = _search_dashboard(request, dashboard, folder_id) if dash is None: return True - r = request.delete(f'api/dashboards/uid/{dash.get("uid")}') + _delete_dashboard(request, dash.get( + 'dashboard', {}).get('uid', '')) logger.info(f'Deleted dashboard: {dashboard.get("title")}') return r is not None diff --git a/brian_dashboard_manager/grafana/provision.py b/brian_dashboard_manager/grafana/provision.py index 345317f3c0c3c6d343fb2c2b3ec463e66cd976dc..2fdca1496f6a63505ce9cb3a2a48204d6cbf4029 100644 --- a/brian_dashboard_manager/grafana/provision.py +++ b/brian_dashboard_manager/grafana/provision.py @@ -299,7 +299,7 @@ def provision(config): agg_folder = find_folder(token_request, 'Aggregates') for agg_type, dash in aggregate_dashboards.items(): if agg_type in exclude_agg: - dash_name = f'Aggregates - {agg_type}' + dash_name = {'title': f'Aggregate - {agg_type}'} executor.submit(delete_dashboard, token_request, dash_name, agg_folder['id']) diff --git a/brian_dashboard_manager/templating/templates/homedashboard.json.j2 b/brian_dashboard_manager/templating/templates/homedashboard.json.j2 index 7e2b37a51257ea8c25aa47d9b168a38b4e672cb4..3ab6d5d1aed6d900165ef4d3bc8455464e8afe77 100644 --- a/brian_dashboard_manager/templating/templates/homedashboard.json.j2 +++ b/brian_dashboard_manager/templating/templates/homedashboard.json.j2 @@ -640,88 +640,66 @@ } {% else %} { - "datasource": "PollerInfluxDB", + "datasource": null, "fieldConfig": { - "defaults": { - "custom": { - "align": null, - "filterable": false + "defaults": { + "custom": {} }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] + "overrides": [] }, - "folderId": null, "gridPos": { - "h": 24, - "w": 24, - "x": 0, - "y": 0 + "h": 11, + "w": 6, + "x": 9, + "y": 0 }, - "headings": true, - "id": 2, - "limit": 100, - "pluginVersion": "7.2.1", - "query": "", - "recent": false, - "repeat": null, - "search": true, - "starred": true, - "tags": [], + "id": 4, + "options": { + "content": "<center><img src=\"https://connect.geant.org/wp-content/uploads/2021/04/geant_logo.png\" alt=\"GEANT Logo\" height=\"308\" width=\"616\"></center>", + "mode": "html" + }, + "pluginVersion": "7.1.0", "targets": [ - { - "groupBy": [ - { - "params": [ - "$__interval" + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } ], - "type": "time" - }, - { - "params": [ - "null" + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] ], - "type": "fill" - } - ], - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - } + "tags": [] + } ], "timeFrom": null, "timeShift": null, - "title": "Dashboards", - "type": "dashlist" + "title": "BRIAN", + "type": "text" } {% endif %} ], diff --git a/changelog.md b/changelog.md index 4d8c33ee2ae625eb6f714520138ab2b1a869bfdd..c443581c36e55c1cffce4cb77d85af57190714af 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.9] - 2021-04-12 +- Show GEANT logo on home dashboards for non-staff organizations +- Remove hardcoded database name from lab dashboard +- Properly exclude a number of dashboards and folders +- Add PIONIER alias of PSNC to exclude + ## [0.8] - 2021-04-09 - Templated home dashboard to provision different one for each organization - Add interface names to aggregate graph target aliases diff --git a/setup.py b/setup.py index 5d80ee809949711ef64c637fd451722a1c9a3e75..1767e49655d3a3d0320019eea8059f4562c2f32b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='brian-dashboard-manager', - version="0.8", + version="0.9", author='GEANT', author_email='swd@geant.org', description='',