diff options
author | Taseer <taseer94@gmail.com> | 2017-07-24 22:34:57 +0500 |
---|---|---|
committer | Taseer <taseer94@gmail.com> | 2017-07-25 00:20:24 +0500 |
commit | 5effa0d2ce6faf12098ba2f0ad9ae90114dda05f (patch) | |
tree | b4ced0e8a09b41a9b9f288be4783b82c13c9a330 /docker/storperf-master/rest_server.py | |
parent | 0afe85092131e5ed7ef277df715ff9941778b29e (diff) |
Returns all job ID's if queried without ID.
JIRA: STORPERF-184
Change-Id: I631b4adbd830420a3b502e4f2a86a66824c87fcd
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'docker/storperf-master/rest_server.py')
-rw-r--r-- | docker/storperf-master/rest_server.py | 15 |
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=[ |