grafcli
grafcli copied to clipboard
Grafana 5.0 support
Since grafana 5 release, rows have become deprecated: https://github.com/grafana/grafana/blob/master/CHANGELOG.md#new-dashboard-grid So, grafcli crashes:
[/remote/host.example.com]> cd dashboard/
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/climb/core.py", line 56, in run
result = self.execute(*shlex.split(command))
File "/usr/local/lib/python3.5/dist-packages/climb/core.py", line 79, in execute
return self._commands.execute(command, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/climb/commands.py", line 26, in execute
return method(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/grafcli/commands.py", line 40, in cd
self._resources.list(path)
File "/usr/local/lib/python3.5/dist-packages/grafcli/resources/resources.py", line 38, in list
return manager.list(*parts)
File "/usr/local/lib/python3.5/dist-packages/grafcli/resources/common.py", line 13, in list
dashboard = self.get(dashboard_name)
File "/usr/local/lib/python3.5/dist-packages/grafcli/resources/common.py", line 33, in get
dashboard = self._storage.get(dashboard_name)
File "/usr/local/lib/python3.5/dist-packages/grafcli/storage/sql.py", line 68, in get
return Dashboard(source, dashboard_id)
File "/usr/local/lib/python3.5/dist-packages/grafcli/documents.py", line 95, in __init__
self._load(source)
File "/usr/local/lib/python3.5/dist-packages/grafcli/documents.py", line 101, in _load
for row in source['rows']:
KeyError: 'rows'
Any plans to implement 5.0 support?
So I've started playing with this and due to some decisions in the grafcli design it turned out into kinda hackish solution.
I've added basic support for rowless dashboard on a new branch: experimental-v5 This will need some testing.
I'm also thinking about re-designing the core code soon with new API in mind.
@m110 First test, just to edit a dashboard with the vim
command, was successful here.
It has been almost a year. Still not working with 5.x although Grafana 6.x has already been released. Should this project be declared dead then?
Tried to use this tool to backup all dashboards, but ran into this issue
I'm currently working on a new release with support for 5.0/6.0. This will come with some major changes, as Grafana evolved since the first version of grafcli.
I will be dropping support for database backends, using only the REST API. There are no "rows" now (well, row is just a type of a panel) and folders were added, so the CLI commands will look a bit different. I'd also like to add support for managing datasources.
Would be really cool to get an update :+1:
Any updates?
I should be able to update the branch with a working version next week. Sorry it takes so long.
Take your time, it's probably all doen in you spare time so...
I got this error too. So, I was switched to another tool (php based). Its much more primitive, but it works with Grafana 6 :) https://github.com/wnasich/grafana_dd
@m110 was this problem resolved? I met a similar problem, thanks.
Trying to use the backup command and hit the same issue
Thank you for your work on this. Is this project still active? I was hoping to get backup support for later versions of Grafana.
I found this project that seems to work well. I really like grafcli but the immediate need is to get this backed up on a daily basis.
https://github.com/ysde/grafana-backup-tool