Merge "TrivialFix for the docstring and json format"

This commit is contained in:
Jenkins 2017-08-25 17:03:46 +00:00 committed by Gerrit Code Review
commit a1cc94046d
2 changed files with 26 additions and 10 deletions

View File

@ -4337,13 +4337,21 @@ def qos_specs_create(context, values):
"""Create a new QoS specs.
:param values dictionary that contains specifications for QoS
e.g. {'name': 'Name',
'consumer': 'front-end',
'specs': {
'total_iops_sec': 1000,
'total_bytes_sec': 1024000
}
}
Expected format of the input parameter:
.. code-block:: json
{
'name': 'Name',
'consumer': 'front-end',
'specs':
{
'total_iops_sec': 1000,
'total_bytes_sec': 1024000
}
}
"""
specs_id = str(uuid.uuid4())
session = get_session()

View File

@ -36,10 +36,18 @@ CONTROL_LOCATION = ['front-end', 'back-end', 'both']
def create(context, name, specs=None):
"""Creates qos_specs.
:param specs dictionary that contains specifications for QoS
e.g. {'consumer': 'front-end',
:param specs: Dictionary that contains specifications for QoS
Expected format of the input parameter:
.. code-block:: json
{
'consumer': 'front-end',
'total_iops_sec': 1000,
'total_bytes_sec': 1024000}
'total_bytes_sec': 1024000
}
"""
# Validate the key-value pairs in the qos spec.
utils.validate_dictionary_string_length(specs)