diff options
Diffstat (limited to 'rest_server.py')
-rw-r--r-- | rest_server.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rest_server.py b/rest_server.py index ffb750e..1194ab5 100644 --- a/rest_server.py +++ b/rest_server.py @@ -64,7 +64,7 @@ class Configure(Resource): abort(400, str(e)) -class StartJob(Resource): +class Job(Resource): def __init__(self): self.logger = logging.getLogger(__name__) @@ -97,6 +97,13 @@ class StartJob(Resource): except Exception as e: abort(400, str(e)) + def delete(self): + try: + storperf.terminate_workloads() + return True + except Exception as e: + abort(400, str(e)) + class Quota(Resource): @@ -129,7 +136,7 @@ def setup_logging(default_path='storperf/logging.json', api.add_resource(Configure, "/api/v1.0/configure") api.add_resource(Quota, "/api/v1.0/quota") -api.add_resource(StartJob, "/api/v1.0/start") +api.add_resource(Job, "/api/v1.0/job") if __name__ == "__main__": setup_logging() |