Grafana API for external snapshot

Hello,

I’m trying to automatically publish a snapshot from Grafana Server to Grafana Snapshot Server (local).

Publication with GUI works fine.
Publication through API works for local Snapshot (snapshot on Grafana Server).

Publication through API doesn’t work to generate Snapshot from Grafana Server to Grafana Snapshot Server.

I call API with this commande line, on Grafana Server :
curl -k -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer MyApiKey" --data @body.json https://127.0.0.1/api/snapshots

Format of my body.json :
{
“dashboard”: {
##### My JSON Dashboard #####
},
“name”: “Dashboard Name”,
“expires”: 3600,
“external”:true,
“key”:V1Gp8qBE3mccS4shZtOlynn6R9xe6sVW,
“deleteKey”:YguVCes3QpyIBSld5FEmBdTlFse8lrW5
}

Response from API :
{"deleteKey":"oAessUlIIZVsLz5j2byNAhmBgHwCl65o","deleteUrl":"https://myGrafanaCentralServer:443/api/snapshots-delete/oAessUlIIZVsLz5j2byNAhmBgHwCl65o","key":"pXILpIU5UDLfnI1lQ6xCvgapSlqhcH5h","url":"https://MyGrafanaSnapshotServer:443/dashboard/snapshot/pXILpIU5UDLfnI1lQ6xCvgapSlqhcH5h"}

On my Grafana Snapshot Server, I’ve well my snapshot with generate link, all panels, but no data in panels (no graphs).
I’ve not error log…

  • KEY and DELETEKEY are required if external is true. But what does it correspond to ?
    Value that I put doesn’t seem to use in response.

  • How to solve my problem ?

Greetings

1 Like