Add custom dashboards

Use the new generic change list feature to support custom dashboards
based on search queries.

Change-Id: Iea339de591da38bccab54c2e044ef7b94d6789cb
This commit is contained in:
James E. Blair
2014-07-12 19:28:37 -07:00
parent 37cfa0b9bb
commit 2fcb7bc219
7 changed files with 40 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
# Copyright 2014 OpenStack Foundation
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@@ -58,10 +59,17 @@ class ConfigSchema(object):
commentlinks = [commentlink]
dashboard = {v.Required('name'): str,
v.Required('query'): str,
v.Required('key'): str}
dashboards = [dashboard]
def getSchema(self, data):
schema = v.Schema({v.Required('servers'): self.servers,
'palettes': self.palettes,
'commentlinks': self.commentlinks,
'dashboards': self.dashboards,
})
return schema
@@ -114,6 +122,10 @@ class Config(object):
text="{url}",
url="{url}"))])))
self.dashboards = {}
for d in self.config.get('dashboards', []):
self.dashboards[d['key']] = d
def getServer(self, name=None):
for server in self.config['servers']:
if name is None or name == server['name']: