m110 / grafcli

Grafana CLI for quick and easy dashboards management.
MIT License
168 stars 20 forks source link

problem export with grafan 8.51 ? #29

Open boubougazelle opened 2 years ago

boubougazelle commented 2 years ago

Hi, i'm trying to get it to work to backup grafana 8.5.1 config on a raspberry-pi with "buster" distribution. I did the config as follows:

[grafcli]
editor = vim
mergetool = vimdiff
history = ~/.grafcli_history
verbose = on
force = on
colorize = on

[resources]
data-dir = ~/.grafcli

[hosts]
localhost = on

[localhost]
type = api
url = http://openplotter.local:3001/api
#user = admin
#password = admin
token = #snip#

To run the thing:

./.local/bin/grafcli backup remote/localhost grafana-backup.tgz

I have the error

"There is no such dashboard: tableau-principal"

So it is able to use the API! Yeah ! It can read the only dashboard I have. But then it fails. Anything incorrect in my config ?

boubougazelle commented 2 years ago

with my little investigation, with 8.5 and 8.4, it seems that the grafana api must be accessed by uid. like in /api/dashboards/uid/sj3jd4. see https://grafana.com/docs/grafana/latest/http_api/dashboard/ and the "slug" seems deprecated if of any help !