I want to update the grafana dashboard through its API but i have found out 2 problems:
- i got an 412 HTTP error
{'message': 'A dashboard with the same name in the folder already exists', 'status': 'name-exists'}
- when i change the name of the dash board it is getting moved to general folder
i got the json for updating the dashboard by:
- getting current state of dashboard by downloading it through API
- changing a few variables (right now i just changed those trying to make it stay in current folder)
response_json["meta"]["folderId"] = folder_id
response_json["meta"]["folderUid"] = folder_uid
response_json["meta"]["overwrite"] = True
response_json["dashboard"]["uid"] = dashboard_uid
response_json["dashboard"]["id"] = dashboard_id
I'm not changing anything else, i don't know therefore why I'm getting problems with name-exists; ofc it exists i want to update it not create a new one, so its expected that the dashboard exists.
I have tried changing the name of the dashboard.