grafana-api-java-client
grafana-api-java-client copied to clipboard
Dashboard creation in JSON
Is there a way to create a dashboard using a JSON export of an existing one? Just by looking at it it seems that it's the expected format http://docs.grafana.org/http_api/dashboard/#create-update-dashboard
What do you think of adding a new method to create a dashboard from a raw export instead of a created model?
The code would look like this:
RequestBody body = RequestBody.create(MediaType.parse("Application/json"), grafanaRawDashboard);
Response<DashboardCreationResponse> response = service.postRawDashboard(apiKey, body).execute();
The benefit from using this approach is that I don't have to write POJOs for every dashboard part (I'm not sure they're all implemented in the models/) and it's way easier for big dashboards I just copy and paste.
So my question is do you like this idea, would it be merged if I make a PR?