Commit Graph

10 Commits

Author SHA1 Message Date
Ian Wienand 72080f7136 Strip id/uid from .json input
As noted inline, a default export from Grafana includes the uid/id
which breaks when you re-import it into a different site.  Strip them.

Change-Id: I318614b33aed2ece93d44e832bad7907724cb1bc
2022-03-11 13:38:45 +11:00
Ian Wienand 5f785f7782 Add import of json files
This simply takes any json files present and loads them into Grafana
directly.  The idea is that you can edit the dashboards using the
inbuilt editor, then copy the dashboard JSON and keep it externally
version controlled.  No parsing or validation is done on the JSON
files; we are assuming they have not been hand-modified from what
Grafana generates.

Change-Id: I38695aed2404f8b7fc350d949b7a9212498c35cb
2020-06-25 15:04:14 +10:00
Mathieu Gagné 0941f4e3b0 Add support for multiple config paths
Help messages mention support for multiple config paths separated by colons.
Yet this feature is not implemented. This change implements it.

Change-Id: Ieb99cba98c9cf775765eacd4ebadfbccfa815a65
2016-06-07 16:44:32 -04:00
Paul Belanger 2c92819451 Add datasource support
We now support the ability to create a datasource using yaml files.

Change-Id: I1db38ac25bc309398924c15635ea5dee4eaf264c
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-11-03 12:36:59 -05:00
Paul Belanger 6316206005 Disable cache for cmd testcases
Right now, we don't actually need a cache for our current tests, so
for now we'll disable it.  Future cmd tests, will enable this making
sure we have the proper coverage.

Change-Id: If7a25c3281fd57257473054348555aa06b5b6d95
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-10-19 22:09:56 -04:00
Paul Belanger 4e643e5d06 Replace oslo_config dependency with argparse
This is for the same reasoning as oslo_log. We don't want to depending
on OpenStack libraries.

Change-Id: I34e66af578d3f4b5ac5e710554aad91524285816
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-10-09 10:12:57 -04:00
Paul Belanger 609733c116 Add the ability to parse directories
Change-Id: I0ff6c803608d91e04b8e40750265157d3f4f7530
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-10-01 13:36:58 -04:00
Paul Belanger f4b18fdd74 Add validate command
Like JJB, Zuul and Nodepool, we need to have a CLI command to validate
our configuration files.

Change-Id: I4ccac21a2d77917667e1e844ab9ee1f1f281ea9f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-10-01 09:59:21 -04:00
Paul Belanger 103a882cbf Add caching support
Like we do with JJB, we create a md5sum of the dashboard then cache
it.  This is a simple way to determine if a yaml file has changed.

Change-Id: If7b80b84c5bbcb0d30b0325bae6b8e726bb2f41b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-09-29 11:34:31 -04:00
Paul Belanger 42ef61dde0 Add a slug to better track dashboards
Currently grafana will generate a slug based on the title name. For
now, we can use an existing python library to do this.  Ideally, we'll
need to make sure the slugs generated between both are kept in sync.

How hard can that be?

Also move our validation logic into parser.py, since they are closely
related.

Change-Id: Id43f51d3f9db9131c25a8130f957572344a7d8f1
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-09-28 10:15:10 -04:00