- What Grafana version and what operating system are you using?
v9.5 -
What are you trying to achieve?
We have upgraded our Grafana to 9.5 and have multiple dashboards, located in different folders, with the same name. I am working to update all of these dashboard names and add tags using a script. -
How are you trying to achieve it?
Using a POST method to update the dashboards. - What happened?
POST works but it overwrites the dashboard and the panels that were on the dashboard are removed. - What did you expect to happen?
Only the name and tags would be edited. Panels remain on the dashboard as is. - Can you copy/paste the configuration(s) that you are having problems with?
I have added panels in the payload below but I am having issues populating dashboard_panels.
I use the GET method to populate dashboard_data. Then try to get the panel data into dashboard_panels. It works for dashboard_uid and dashbaord_id, but not for dashboard_panels.
dashboard_data = get_dashboardid(base_url, grafana_token, folder_id, page)
dashboard_uid = dashboard_data[0][‘uid’]
dashboard_id = dashboard_data[0][‘id’]
ISSUE IS HERE I BELIEVE
dashboard_panels = dashboard_data[0][‘panels’]
payload = json.dumps({
“dashboard”: {
“id”: dashboard_id,
“uid”: dashboard_uid,
“panels”: dashboard_panels,
“title”: f"{page} {app_name}“,
“tags”: [ f”{page}“,
f”{app_name}" ],
“timezone”: “”,
“schemaVersion”: 38,
“version”: 2,
“refresh”: “”
},
“folderId”: folder_id,
“folderUid”: “”,
“message”: “Updated name and tags”,
“overwrite”: True
})
-
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
-
Did you follow any online instructions? If so, what is the URL?