summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master/rest_server.py
diff options
context:
space:
mode:
authormbeierl <mark.beierl@dell.com>2018-07-04 20:51:54 -0400
committermbeierl <mark.beierl@dell.com>2018-07-05 09:14:02 -0400
commit3de258b9d0f6d4249a5e7f42eec41fcb0080bc66 (patch)
treef2ce3eceb3efcb31822c294aade70b937d75127b /docker/storperf-master/rest_server.py
parenta6c0c07da775203c813bc9a0effba6e0d37d15f7 (diff)
Adds volume_type support
Adds a new optional parameter, volume_type, to the configurations REST API, allowing the user to specify the volume type to create. Change-Id: I29b7bee442a5e1b6b98be439c06a58e3fd322943 JIRA: STORPERF-217 Co-Authored-By: Ameed.Ashour.Ext@Nokia.com Signed-off-by: mbeierl <mark.beierl@dell.com>
Diffstat (limited to 'docker/storperf-master/rest_server.py')
-rw-r--r--docker/storperf-master/rest_server.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/docker/storperf-master/rest_server.py b/docker/storperf-master/rest_server.py
index 839ea81..939e91f 100644
--- a/docker/storperf-master/rest_server.py
+++ b/docker/storperf-master/rest_server.py
@@ -101,6 +101,7 @@ class ConfigurationRequestModel:
'public_network': fields.String,
'volume_count': fields.Integer,
'volume_size': fields.Integer,
+ 'volume_type': fields.String,
'availability_zone': fields.String,
'username': fields.String,
'password': fields.String
@@ -118,6 +119,7 @@ class ConfigurationResponseModel:
'stack_id': fields.String,
'volume_count': fields.Integer,
'volume_size': fields.Integer,
+ 'volume_type': fields.String,
'availability_zone': fields.String,
'slave_addresses': fields.Nested
}
@@ -141,6 +143,7 @@ class Configure(Resource):
'public_network': storperf.public_network,
'volume_count': storperf.volume_count,
'volume_size': storperf.volume_size,
+ 'volume_type': storperf.volume_type,
'stack_created': storperf.is_stack_created,
'availability_zone': storperf.availability_zone,
'slave_addresses': storperf.slave_addresses,
@@ -180,6 +183,8 @@ class Configure(Resource):
storperf.volume_count = request.json['volume_count']
if ('volume_size' in request.json):
storperf.volume_size = request.json['volume_size']
+ if ('volume_type' in request.json):
+ storperf.volume_type = request.json['volume_type']
if ('availability_zone' in request.json):
storperf.availability_zone = request.json['availability_zone']
if ('username' in request.json):
@@ -191,14 +196,7 @@ class Configure(Resource):
if storperf.stack_id is None:
abort(400, storperf.status_reason)
- return jsonify({'agent_count': storperf.agent_count,
- 'agent_flavor': storperf.agent_flavor,
- 'agent_image': storperf.agent_image,
- 'availability_zone': storperf.availability_zone,
- 'public_network': storperf.public_network,
- 'volume_count': storperf.volume_count,
- 'volume_size': storperf.volume_size,
- 'stack_id': storperf.stack_id})
+ return self.get()
except Exception as e:
self.logger.exception(e)