summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master/rest_server.py
diff options
context:
space:
mode:
authorMark Beierl <mark.beierl@dell.com>2017-07-24 19:23:04 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-24 19:23:04 +0000
commitcafb53752ce7737d695e23af299429e9e805eced (patch)
treeec53bc31b9f32bb261c5169b4ea968348196e985 /docker/storperf-master/rest_server.py
parent5e01201c1f4d757dfde2eafff10f7ecec370dbdd (diff)
parent5effa0d2ce6faf12098ba2f0ad9ae90114dda05f (diff)
Merge "Returns all job ID's if queried without ID."
Diffstat (limited to 'docker/storperf-master/rest_server.py')
-rw-r--r--docker/storperf-master/rest_server.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/docker/storperf-master/rest_server.py b/docker/storperf-master/rest_server.py
index ef8975c..3df2856 100644
--- a/docker/storperf-master/rest_server.py
+++ b/docker/storperf-master/rest_server.py
@@ -194,14 +194,17 @@ class Job(Resource):
workload_id = request.args.get('id')
- if metrics_type == "metrics":
- return jsonify(storperf.fetch_results(workload_id))
+ if workload_id:
+ if metrics_type == "metrics":
+ return jsonify(storperf.fetch_results(workload_id))
- if metrics_type == "metadata":
- return jsonify(storperf.fetch_metadata(workload_id))
+ if metrics_type == "metadata":
+ return jsonify(storperf.fetch_metadata(workload_id))
- if metrics_type == "status":
- return jsonify(storperf.fetch_job_status(workload_id))
+ if metrics_type == "status":
+ return jsonify(storperf.fetch_job_status(workload_id))
+ else:
+ return jsonify({"job_ids": storperf.fetch_all_jobs()})
@swagger.operation(
parameters=[