From acc19a9c7a219c09f07e05ec86ab5bdf1537b46d Mon Sep 17 00:00:00 2001
From: Bjarke Madsen <bjarke.madsen@geant.org>
Date: Tue, 23 Mar 2021 16:11:40 +0100
Subject: [PATCH] Update org config and add comments

---
 brian_dashboard_manager/config.py | 66 +++++++++++++++++++++++++++----
 1 file changed, 59 insertions(+), 7 deletions(-)

diff --git a/brian_dashboard_manager/config.py b/brian_dashboard_manager/config.py
index 83840e8..c5a828e 100644
--- a/brian_dashboard_manager/config.py
+++ b/brian_dashboard_manager/config.py
@@ -1,3 +1,32 @@
+"""
+This file loads the configuration used for the dashboard manager.
+
+The config is stored in a JSON format on the filesystem,
+with the following schema:
+
+.. asjson::
+    brian_dashboard_manager.config.CONFIG_SCHEMA
+
+
+Some config specific to each organization is hardcoded.
+This includes which organizations to provision,
+and which dashboards not to provision for each organization:
+
+`excluded_nrens` is a list of strings to search for in interface descriptions
+to exclude for that organization.
+
+`excluded_dashboards` is a list of dashboard names to exclude.
+These only cover the static dashboards loaded from the file system.
+
+`excluded_folders` covers dynamically generated folders and dashboards.
+This property is a mapping of folder name to `True` or a list of dashboards.
+A value of `True` should result in that folder being excluded.
+If the value is a list, dashboard titles within the list should be excluded.
+
+.. asjson::
+    brian_dashboard_manager.config.DEFAULT_ORGANIZATIONS
+"""
+
 import json
 import jsonschema
 
@@ -5,7 +34,8 @@ DEFAULT_ORGANIZATIONS = [
     {
         "name": "GÉANT Staff",
         "excluded_nrens": [],
-        "excluded_dashboards": []
+        "excluded_dashboards": [],
+        "excluded_folders": {}
     },
     {
         "name": "NRENs",
@@ -13,7 +43,11 @@ DEFAULT_ORGANIZATIONS = [
         "excluded_dashboards": [
             "GÉANT Office devices",
             "GÉANT VM"
-        ]
+        ],
+        "excluded_folders": {
+            "Aggregates": ["CAE1"],
+            "GEANTOPEN": True
+        }
     },
     {
         "name": "General Public",
@@ -23,8 +57,17 @@ DEFAULT_ORGANIZATIONS = [
         ],
         "excluded_dashboards": [
             "GÉANT Office devices",
-            "GÉANT VM"
-        ]
+            "GÉANT VM",
+            "IAS",
+            "GEANTOPEN"
+        ],
+        "excluded_folders": {
+            "Aggregates": ["CAE1", "GWS UPSTREAMS"],
+            "IAS CUSTOMER": True,
+            "IAS PRIVATE": True,
+            "IAS PUBLIC": True,
+            "IAS UPSTREAM": True
+        }
     },
     {
         "name": "CAE1 - Europe",
@@ -32,7 +75,8 @@ DEFAULT_ORGANIZATIONS = [
         "excluded_dashboards": [
             "GÉANT Office devices",
             "GÉANT VM"
-        ]
+        ],
+        "excluded_folders": {}
     },
     {
         "name": "CAE1 - Asia",
@@ -42,8 +86,16 @@ DEFAULT_ORGANIZATIONS = [
         ],
         "excluded_dashboards": [
             "GÉANT Office devices",
-            "GÉANT VM"
-        ]
+            "GÉANT VM",
+            "IAS"
+        ],
+        "excluded_folders": {
+            "Aggregates": ["GWS UPSTREAMS"],
+            "IAS CUSTOMER": True,
+            "IAS PRIVATE": True,
+            "IAS PUBLIC": True,
+            "IAS UPSTREAM": True
+        }
     }
 ]
 
-- 
GitLab