diff options
Diffstat (limited to 'docker/storperf-master/rest_server.py')
-rw-r--r-- | docker/storperf-master/rest_server.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/docker/storperf-master/rest_server.py b/docker/storperf-master/rest_server.py index ef8975c..d551b57 100644 --- a/docker/storperf-master/rest_server.py +++ b/docker/storperf-master/rest_server.py @@ -160,7 +160,7 @@ class Job(Resource): "name": "id", "description": "The UUID of the workload in the format " "NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN", - "required": True, + "required": False, "type": "string", "allowMultiple": False, "paramType": "query" @@ -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=[ |