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
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
We now support the ability to create a datasource using yaml files.
Change-Id: I1db38ac25bc309398924c15635ea5dee4eaf264c
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
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>
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>
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>
In Openstack I don't think we need to be too concerned with what we're
loading from yaml, but another project might? So, in the name of
reusability, I propose we use safe_load. Unless of course this actually
breaks something :)
Change-Id: Ib64f84cba22290a5059e649aee94d65dfa78344f
This will centeralize our overlapping yaml code paths.
Change-Id: Ib8bc0fc93b49363cb511d9891a24ea48fdee136d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>