Json file not updating the grafana dashboard but creating new dashboard successfully using HTTP API

  1. I am having grafana running in linux server

  2. Also i exported already created dashboard json file and save it in ‘/u04/mydata.json’ in linux server

  3. I deleted already created dashboard in grafana, so there is no dashboard available in grafana database

  4. Now i am trying to upload ‘/u04/mydata.json’ contents using grafana HTTP API using curl command in linux server

  5. so i have used curl -X POST --insecure -H “Authorization: Bearer @@” -H “Content-Type: application/json” -d ‘{“dashboard”:{“id”: null, “title”: “tested33”},“overwrite”:true}’ --data-binary “/u04/mydata.json” http://rhsappnb:3000/api/dashboards/db

  6. After executing the above curl command , the curl responded the ‘success’ message like {“id”:45,“slug”:“tested33”,“status”:“success”,“uid”:“Lpk-GASZz”,“url”:"/d/Lpk-GASZz/tested33",“version”:2}

  7. So now in my grafana database a new dashboard created successfully without any issue but the contents in “/u04/mydata.json” is not updated.

  8. In newly created json model it is having only the basic details which i paste below,

  9. {“annotations”: {“list”: [ { “builtIn”: 1,“datasource”: “-- Grafana --”,“enable”: true,“hide”: true,“iconColor”: “rgba(0, 211, 255, 1)”,“name”: “Annotations & Alerts”,“type”: “dashboard” } ] }, “editable”: true, “gnetId”: null, “graphTooltip”: 0, “id”: 45, “links”: [], “panels”: [], “schemaVersion”: 18, “style”: “dark”, “tags”: [], “templating”: { “list”: [] }, “time”: { “from”: “now-6h”, “to”: “now” }, “timepicker”: { “refresh_intervals”: [ “5s”, “10s”, “30s”, “1m”, “5m”, “15m”, “30m”, “1h”, “2h”, “1d” ], “time_options”: [ “5m”, “15m”, “1h”, “6h”, “12h”, “24h”, “2d”, “7d”, “30d” ] }, “timezone”: “”, “title”: “tested33”, “uid”: “Lpk-GASZz”, “version”: 2}

  10. So what ever i given inside the dashboard , it is updating successfully but it is not reading the contents of ‘/u04/mydata.json’ and updating in json file

11)Kindly assist me where to change the syntax to update the contents successfully.