summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master/rest_server.py
diff options
context:
space:
mode:
authormbeierl <mark.beierl@dell.com>2017-08-28 09:43:31 -0400
committermbeierl <mark.beierl@dell.com>2017-08-28 19:09:24 -0400
commitb4421c8b61c183d57ef4acc6874cc8e02c65d633 (patch)
tree74e45639ee21d4c5c4e998e9d4dd50378dd651e8 /docker/storperf-master/rest_server.py
parent6848d519dfa7c8aec38ab6d084df3d08196c0ad3 (diff)
Standardize Output
Re-arrange the JSON output so that it matches the format that gets sent and retrieved from the testresults db. Change-Id: I9f15e553e94b27b9e5a36f4984789c5e710feac4 JIRA: STORPERF-200 Signed-off-by: mbeierl <mark.beierl@dell.com>
Diffstat (limited to 'docker/storperf-master/rest_server.py')
-rw-r--r--docker/storperf-master/rest_server.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/docker/storperf-master/rest_server.py b/docker/storperf-master/rest_server.py
index bd4b66b..6da2004 100644
--- a/docker/storperf-master/rest_server.py
+++ b/docker/storperf-master/rest_server.py
@@ -224,13 +224,13 @@ class Job(Resource):
)
def get(self):
- metrics_type = "metrics"
- if request.args.get('type'):
- metrics_type = request.args.get('type')
-
workload_id = request.args.get('id')
if workload_id:
+ metrics_type = "metrics"
+ if request.args.get('type'):
+ metrics_type = request.args.get('type')
+
if metrics_type == "metrics":
return jsonify(storperf.fetch_results(workload_id))
@@ -240,7 +240,10 @@ class Job(Resource):
if metrics_type == "status":
return jsonify(storperf.fetch_job_status(workload_id))
else:
- return jsonify({"job_ids": storperf.fetch_all_jobs()})
+ metrics_type = None
+ if request.args.get('type'):
+ metrics_type = request.args.get('type')
+ return jsonify(storperf.fetch_all_jobs(metrics_type))
@swagger.operation(
parameters=[