Dashboard API: Unprocessable Entity

What Grafana version are you using?

Latest from docker “grafana/grafana”

What datasource are you using?

prometheus

What OS are you running grafana on?

Vagrant: bento/ubuntu-16.04

What did you do?

  1. Got dashboard json from here https://grafana.com/dashboards/893
  2. Created datasource Prometheus
  3. GUI import paste JSON works fine, though asks for prometheus datasource
  4. Dashboard API does not work:
++++++ curl -v -L -s --fail -H 'Accept: application/json' -H 'Content-Type: application/json' -X POST -k http://admin:admin@192.168.99.10:3000/api/dashboards/db --data @commands/prom1/dashboards/main_rev5-src.json

*   Trying 192.168.99.10...
* TCP_NODELAY set
* Connected to 192.168.99.10 (192.168.99.10) port 3000 (#0)
* Server auth using Basic with user 'admin'
> POST /api/dashboards/db HTTP/1.1
> Host: 192.168.99.10:3000
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.57.0
> Accept: application/json
> Content-Type: application/json
> Content-Length: 56176
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
} [16384 bytes data]
* We are completely uploaded and fine
* The requested URL returned error: 422 Unprocessable Entity
* stopped the pause stream!
* Closing connection 0
+++++ return 1
++++ exit 1

Can you please suggest a way to import dashboard?

Ok, got it, from here https://github.com/grafana/grafana/issues/7592

Had to use /api/dashboards/import and data: https://pastebin.com/GBVKhJHD