-
What Grafana version and what operating system are you using?
V8.3.5 -
What are you trying to achieve?
Trying to make a PUT request to update the existing grafana datasource with UID and the json file in GO. -
How are you trying to achieve it?
put_req, reqerr := http.NewRequest(“PUT”, fmt.Sprintf(“%s/api/datasources/%s”, GRAFANA_URL,uid), bytes.NewBuffer(jsonBytes)) -
What happened?
Got the response and couldnot update the datasource
response:
{“message”:“Datasource has already been updated by someone else. Please reload and try again”} -
What did you expect to happen?
To update the datasource. -
Can you copy/paste the configuration(s) that you are having problems with?
Structure defining the datasource:
type ESDataSource struct {
UID stringjson:"uid"
Name stringjson:"name"
Type stringjson:"type"
URL stringjson:"url"
Access stringjson:"access"
Database stringjson:"database"
JsonData ESDataSourceJsonDatajson:"jsonData"
} -
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
{“message”:“Datasource has already been updated by someone else. Please reload and try again”} -
Did you follow any online instructions? If so, what is the URL?