Commit Graph

7 Commits

Author SHA1 Message Date
Paul Belanger 3a32d511bb Rework grafana object for future functionality
Currently we only support dashboards for Grafana, this is about to
change. For example, we also need to add the ability to create
datasources and even users. Here we are breaking out the logic into
more specific functions.

Additionaly, this helps when we eventually break out this code into
python-grafana.

Change-Id: I10a618adbf9052c8dccda38fefb7abf3a148d3b6
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-10-09 14:00:28 -04:00
Paul Belanger 30f7d21f3f Make sure dashboard exists after we create it
The long term goal here is to eventually create python-grafana from
our embedded grafana.py file. So, most of this code just makes the
Grafana object more user friendly.

However, we've also added some validation around create_dashboard, we
added some checks before we create and after. To ensure we actually
created our new dashboards.

Finally, add some sphinx docs since everybody loves documentation.

Change-Id: Icbba403afe5208fbef1855118d4c3f4293461e00
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-10-02 13:42:35 -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
Paul Belanger 8029107fc8 The apikey is now optional
Grafana 2.1.0 added basic auth support. With that in mind, the api key
is now optional.

Change-Id: Ie186fa9ce48ca4ae222f75345e9b660f5ffa2909
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-09-23 14:55:34 -04:00
Paul Belanger 3a6973cc56 Initial unit tests for CLI
Change-Id: Ie18bda7edd09cf95bc2c0066ddaf73e1c4c8a7fa
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-06-30 13:07:51 -04:00
Paul Belanger 3f276f3bbc Properly build grafana URL
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-05-06 13:33:50 -04:00
Paul Belanger 210033302d Break out grafana class into own file
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-05-06 13:29:45 -04:00