Skip to content
Snippets Groups Projects
Commit 9ebee3b3 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Exclude GWS (in)direct from appropriate orgs and show in IAS dashboard

parent c3037824
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,8 @@ DEFAULT_ORGANIZATIONS = [
"IAS PUBLIC": True,
"IAS UPSTREAM": True,
"GWS PHY Upstream": True,
"GWS Direct": True,
"GWS Indirect": True,
}
},
{
......@@ -116,7 +118,9 @@ DEFAULT_ORGANIZATIONS = [
"IAS PRIVATE": True,
"IAS PUBLIC": True,
"IAS UPSTREAM": True,
"GWS PHY Upstream": True
"GWS PHY Upstream": True,
"GWS Direct": True,
"GWS Indirect": True,
}
}
]
......
......@@ -46,7 +46,7 @@
"folderId": null,
"gridPos": {
"h": 25,
"w": 6,
"w": 4,
"x": 0,
"y": 0
},
......@@ -114,8 +114,8 @@
"folderId": null,
"gridPos": {
"h": 25,
"w": 6,
"x": 6,
"w": 4,
"x": 4,
"y": 0
},
"headings": false,
......@@ -182,8 +182,8 @@
"folderId": null,
"gridPos": {
"h": 25,
"w": 6,
"x": 12,
"w": 4,
"x": 8,
"y": 0
},
"headings": false,
......@@ -250,8 +250,8 @@
"folderId": null,
"gridPos": {
"h": 25,
"w": 6,
"x": 18,
"w": 4,
"x": 12,
"y": 0
},
"headings": false,
......@@ -306,6 +306,142 @@
"timeShift": null,
"title": "IAS PRIVATE",
"type": "dashlist"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"folderId": null,
"gridPos": {
"h": 25,
"w": 4,
"x": 16,
"y": 0
},
"headings": false,
"id": 6,
"limit": 100,
"pluginVersion": "7.1.4",
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": [
"GWS_DIRECT"
],
"targets": [
{
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": []
}
],
"timeFrom": null,
"timeShift": null,
"title": "GWS Direct",
"type": "dashlist"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"folderId": null,
"gridPos": {
"h": 25,
"w": 4,
"x": 20,
"y": 0
},
"headings": false,
"id": 7,
"limit": 100,
"pluginVersion": "7.1.4",
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": [
"GWS_INDIRECT"
],
"targets": [
{
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": []
}
],
"timeFrom": null,
"timeShift": null,
"title": "GWS Indirect",
"type": "dashlist"
}
],
"schemaVersion": 26,
......@@ -338,3 +474,4 @@
"title": "IAS",
"version": 1
}
......@@ -310,8 +310,7 @@ def provision(config):
# fetch GWS direct data and provision related dashboards
logger.info('Provisioning GWS Indirect dashboards')
folder_name = 'GWS Indirect'
exclude_indirect = excluded_folders.get(folder_name, [])
exclude_indirect = list(map(lambda f: f.lower(), exclude_indirect))
exclude_indirect = excluded_folders.get(folder_name, False)
if isinstance(exclude_indirect, bool) and exclude_indirect:
# don't provision GWS Direct folder
delete_folder(token_request, folder_name)
......@@ -321,14 +320,9 @@ def provision(config):
gws_indirect_data = get_gws_indirect(
config['inventory_provider'])
provisioned = []
dashes = generate_indirect(gws_indirect_data, datasource_name)
for dashboard in dashes:
rendered = render_dashboard(dashboard)
if rendered.get('title').lower() in exclude_indirect:
executor.submit(delete_dashboard, token_request,
rendered, folder['id'])
continue
provisioned.append(executor.submit(create_dashboard,
token_request,
rendered, folder['id']))
......@@ -338,8 +332,7 @@ def provision(config):
# fetch GWS direct data and provision related dashboards
logger.info('Provisioning GWS Direct dashboards')
folder_name = 'GWS Direct'
exclude_gws = excluded_folders.get(folder_name, [])
exclude_gws = list(map(lambda f: f.lower(), exclude_gws))
exclude_gws = excluded_folders.get(folder_name, False)
if isinstance(exclude_gws, bool) and exclude_gws:
# don't provision GWS Direct folder
delete_folder(token_request, folder_name)
......@@ -351,10 +344,6 @@ def provision(config):
for dashboard in generate_gws(gws_data, datasource_name):
rendered = render_dashboard(dashboard)
if rendered.get('title').lower() in exclude_gws:
executor.submit(delete_dashboard, token_request,
rendered, folder['id'])
continue
provisioned.append(executor.submit(create_dashboard,
token_request,
rendered, folder['id']))
......
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