This is probably obvious, but the documentation is not extremely clear and my testing is inconclusive:
Is GET /api/dashboards/uid/:uid supposed to return both the dashboard meta/model & resulting data from the panel queries, or just the dashboard meta/model?
Just the dashboard and meta models. The dashboard model contains an array of panels and each panel has a targets property which contains the panel query (or queries):
I am trying to generate a snapshot of the dashboard through the API (api/snapshots), but it is not clear to me how to programmatically get the panel data to post to the snapshot API. That is why I was trying to query the dashboard.
@daniellee This is hacky, but it works for my use-case - it just simulates clicking on the generate snapshot link. Using Apify’s synchronous API, the API call will return the snapshot URL.
Not really. Grafana takes the dashboard json, parses out the queries for each panel and executes them.
So you could do the same thing but that would be quite a lot of code (template variables, different data sources, series overrides, timeshift overrides etc., ) - basically the whole dashboard rendering javascript from Grafana.