Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard creation in JSON #17

Open
AlexandreRio opened this issue Apr 6, 2018 · 1 comment
Open

Dashboard creation in JSON #17

AlexandreRio opened this issue Apr 6, 2018 · 1 comment

Comments

@AlexandreRio
Copy link
Contributor

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?

@AlexandreRio
Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant