Adds osm_automated tag to automated dashboards
[osm/MON.git] / osm_mon / dashboarder / backends / grafana.py
index 123f9e9..4f1fe52 100644 (file)
@@ -25,7 +25,7 @@ import requests
 
 log = logging.getLogger(__name__)
 
-# TODO (lavado): migrate to Class, import config variables
+# TODO (lavado): migrate to Class, import config variables to get token
 url = "http://grafana:3000/api/"
 headers = {
     'content-type': "application/json",
@@ -34,11 +34,11 @@ headers = {
 
 
 def get_all_dashboard_uids():
-    response = requests.request("GET", url + "search?query=%", headers=headers)
+    # Gets only dashboards that were automated by OSM (with tag 'osm_automated')
+    response = requests.request("GET", url + "search?tag=osm_automated", headers=headers)
     dashboards = response.json()
     dashboard_uids = []
     for dashboard in dashboards:
-        print(dashboard['uid'])
         dashboard_uids.append(dashboard['uid'])
     log.debug("Searching for all dashboard uids: %s", dashboard_uids)
     return dashboard_uids