torkelo/grafana — pull request #340 by edasque (2014-04-23 22:12:56+00:00)
Title: First iteration of the coffee script based CLI ES-stored dashboard impor...

First iteration of the coffee script based CLI ES-stored dashboard import/export utility

I sent you an email about this about a week ago but didn't ask. I think this could be useful to people from what I can tell. It's written in CoffeeScript so I'll need to provide some grunt tasks to compile. I need to clean it up a bit as well and provide unit tests. But before I start that work, I wanted to make sure there is interest.

Syntax and TODO follow:

> coffee dashboard_import_export.coffee
error You need to tell me whether to export or import!

Usage: dashboard_import_export.coffee [options]

Options:

-h, --help output usage information
-V, --version output the version number
-h, --host [host] ElasticSearch host to export to/import from
-p, --port [port]
-e --export [DashboardName] Export the named Grafana Dashboard from ElasticSearch
-o --overwrite Whether or not to overwrite should the export file already exist
-i --import [DashboardFile.json] Import the given file in ElasticSearch

TODO:
* remove minimalist
* add unit testing
* add grunt task for coffee