import logging
import logging.config
import logging.handlers
+import requests
import socket
import struct
import sys
-import requests
-
class Usage(Exception):
pass
if (erase):
response = requests.delete(
- 'http://127.0.0.1:5000/api/v1.0/configure')
+ 'http://127.0.0.1:5000/api/v1.0/configurations')
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
if (terminate):
response = requests.delete(
- 'http://127.0.0.1:5000/api/v1.0/job')
+ 'http://127.0.0.1:5000/api/v1.0/jobs')
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
if (configuration is not None):
response = requests.post(
- 'http://127.0.0.1:5000/api/v1.0/configure', json=configuration)
+ 'http://127.0.0.1:5000/api/v1.0/configurations', json=configuration)
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
if (report is not None):
print "Fetching report for %s..." % (report,)
response = requests.get(
- 'http://127.0.0.1:5000/api/v1.0/job?id=%s' % (report,))
+ 'http://127.0.0.1:5000/api/v1.0/jobs?id=%s' % (report,))
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
else:
print "Calling start..."
response = requests.post(
- 'http://127.0.0.1:5000/api/v1.0/job', json=options)
+ 'http://127.0.0.1:5000/api/v1.0/jobs', json=options)
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+from storperf.db.job_db import JobDB
+from storperf.plot.barchart import Barchart
+from storperf.storperf_master import StorPerfMaster
import io
import json
import logging
from flask import abort, Flask, request, jsonify, send_from_directory
from flask_restful import Resource, Api, fields
-
from flask_restful_swagger import swagger
-from storperf.db.job_db import JobDB
-from storperf.plot.barchart import Barchart
-from storperf.storperf_master import StorPerfMaster
app = Flask(__name__, static_url_path="")
rootLogger.addHandler(socketHandler)
-api.add_resource(Configure, "/api/v1.0/configure")
-api.add_resource(Quota, "/api/v1.0/quota")
-api.add_resource(Job, "/api/v1.0/job")
+api.add_resource(Configure, "/api/v1.0/configurations")
+api.add_resource(Quota, "/api/v1.0/quotas")
+api.add_resource(Job, "/api/v1.0/jobs")
if __name__ == "__main__":
setup_logging()
self.metrics_emitter.transmit_metrics(carbon_metrics)
def register_workloads(self, workloads):
+ self.workload_modules = []
+
if (workloads is None or len(workloads) == 0):
workload_dir = os.path.normpath(
os.path.join(os.path.dirname(__file__), "workloads"))