As currently described, this approach does not work. The reason for that is that creating a snapshot via the API does not actually populate any data, as described in e.g. https://community.grafana.com/t/snapshot-using-http-api-does-nothing/. An alternative approach which does work described in https://gist.github.com/svet-b/1ad0656cd3ce0e1a633e16eb20f66425.
Packages:
- The
jq
JSON processing command line tool, which is available for most distributions (https://stedolan.github.io/jq/,sudo apt install jq
) - NodeJS, and the
puppeteer
package (npm install puppeteer
), which is used to run headless Chrome