I am trying to create grafana chart panels from a template with api from grafana. I am currently using grafana v2.0.2.
I have an api key and I can get dashboards with curls, but I can not create dashboards.
When I make the following request: curl -i -H "Authorization: Bearer eyJrIobfuscatedlkIjoxfQ==" http://localhost:3000/api/dashboards/db/webserver2 then I return json for dasboard.
When I try to create the simplest panel that I found in the api examples, it does not work: curl -i -H "Authorization: Bearer eyJrIobfuscatedlkIjoxfQ==" -d /tmp/simpledash http://localhost:3000/api/dashboards/db where /tmp/simpledash contains:
{ "dashboard": { "id": null, "title": "Production Overview", "tags": [ "templated" ], "timezone": "browser", "rows": [ { } ] "schemaVersion": 6, "version": 0 }, "overwrite": false }
I get the following answer:
HTTP/1.1 422 status code 422 Content-Type: application/json; charset=utf-8 Date: Wed, 01 Jul 2015 16:16:48 GMT Content-Length: 84 [{"fieldNames": ["Dashboard"],"classification":"RequiredError","message":"Required"}]
I tried some json options, but I always get this answer, and on the Internet I could not find a working example. Does anyone have a working example for me? I like to have this work, so I can create a control panel due to impossibility.
Thanks!
source share