aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/api/controllers/metric.py
diff options
context:
space:
mode:
Diffstat (limited to 'qtip/api/controllers/metric.py')
-rw-r--r--qtip/api/controllers/metric.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/qtip/api/controllers/metric.py b/qtip/api/controllers/metric.py
index dd4c8ac..96cd985 100644
--- a/qtip/api/controllers/metric.py
+++ b/qtip/api/controllers/metric.py
@@ -14,13 +14,12 @@ from qtip.loader import metric
def list_metrics():
- metric_list = list(metric.MetricSpec.list_all())
- return metric_list, httplib.OK
+ metrics = list(metric.MetricSpec.list_all())
+ metrics_by_name = [m['name'] for m in metrics]
+ return {'metrics': metrics_by_name}, httplib.OK
-@common.get_one_exceptions(resource='metric')
+@common.check_endpoint_for_error(resource='Metric')
def get_metric(name):
- metric_spec = metric.MetricSpec(name)
- return {'name': metric_spec.name,
- 'abspath': metric_spec.abspath,
- 'content': metric_spec.content}
+ metric_spec = metric.MetricSpec(name)
+ return metric_spec.content