diff --git a/brian_dashboard_manager/config.py b/brian_dashboard_manager/config.py index ef05a1a99a8c7d046bf1d80114575fc17c406c4a..e97ce1194e058cd6fc6c5fac1641f0e207e4e2a2 100644 --- a/brian_dashboard_manager/config.py +++ b/brian_dashboard_manager/config.py @@ -29,6 +29,19 @@ CONFIG_SCHEMA = { "isDefault", "readOnly" ] + }, + "organization": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "excluded_nrens": {"type": "array", "items": {"type": "string"}}, + "excluded_dashboards": {"type": "array", "items": {"type": "string"}}, + }, + "required": [ + "name", + "excluded_nrens", + "excluded_dashboards" + ] } }, @@ -38,7 +51,8 @@ CONFIG_SCHEMA = { "admin_password": {"type": "string"}, "hostname": {"type": "string"}, "listen_port": {"type": "integer"}, - "organizations": {"type": "array", "items": {"type": "string"}}, + "inventory_provider": {"type": "string"}, + "organizations": {"type": "array", "items": {"$ref": "#definitions/organization"}}, "datasources": { "type": "object", "properties": { @@ -51,6 +65,7 @@ CONFIG_SCHEMA = { "admin_username", "admin_password", "hostname", + "inventory_provider", "organizations", "datasources" ], diff --git a/test/conftest.py b/test/conftest.py index 39e0477f6ee2cc706c37609b4975837fea6acad2..09de236391600e07f080295c84fbcf3fdee897e1 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -11,11 +11,28 @@ def data_config(): "admin_username": "fakeadmin", "admin_password": "fakeadmin", "hostname": "myfakehostname.org", + "inventory_provider": "inventory-provider01.geant.org:8080", "organizations": [ - 'Testorg1', - 'GÉANT Testorg2', - 'NRENsTestorg3', - 'General Public' + { + "name": "Testorg1", + "excluded_nrens": [], + "excluded_dashboards": [] + }, + { + "name": "GÉANT Testorg2", + "excluded_nrens": [], + "excluded_dashboards": [] + }, + { + "name": "NRENsTestorg3", + "excluded_nrens": [], + "excluded_dashboards": [] + }, + { + "name": "General Public", + "excluded_nrens": ["JISC", "PSNC"], + "excluded_dashboards": [] + } ], "datasources": { "influxdb": {