# coding: utf-8
"""
VolumeCreateRequest.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
from pprint import pformat
from six import iteritems
[docs]class VolumeCreateRequest(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self):
"""
VolumeCreateRequest - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition.
"""
self.swagger_types = {
'pool_id': 'str', # (required parameter)
'name': 'str', # (required parameter)
'size_unit': 'str', # (required parameter)
'size': 'int', # (required parameter)
'seg_size': 'int', # (required parameter)
'data_assurance_enabled': 'bool',
'owning_controller_id': 'str',
'meta_tags': 'list[VolumeMetadataItem]'
}
self.attribute_map = {
'pool_id': 'poolId', # (required parameter)
'name': 'name', # (required parameter)
'size_unit': 'sizeUnit', # (required parameter)
'size': 'size', # (required parameter)
'seg_size': 'segSize', # (required parameter)
'data_assurance_enabled': 'dataAssuranceEnabled',
'owning_controller_id': 'owningControllerId',
'meta_tags': 'metaTags'
}
self._pool_id = None
self._name = None
self._size_unit = None
self._size = None
self._seg_size = None
self._data_assurance_enabled = None
self._owning_controller_id = None
self._meta_tags = None
@property
def pool_id(self):
"""
Gets the pool_id of this VolumeCreateRequest.
The identifier of the storage pool from which the volume will be allocated.
:return: The pool_id of this VolumeCreateRequest.
:rtype: str
:required/optional: required
"""
return self._pool_id
@pool_id.setter
def pool_id(self, pool_id):
"""
Sets the pool_id of this VolumeCreateRequest.
The identifier of the storage pool from which the volume will be allocated.
:param pool_id: The pool_id of this VolumeCreateRequest.
:type: str
"""
self._pool_id = pool_id
@property
def name(self):
"""
Gets the name of this VolumeCreateRequest.
The user-label to assign to the new volume.
:return: The name of this VolumeCreateRequest.
:rtype: str
:required/optional: required
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this VolumeCreateRequest.
The user-label to assign to the new volume.
:param name: The name of this VolumeCreateRequest.
:type: str
"""
self._name = name
@property
def size_unit(self):
"""
Gets the size_unit of this VolumeCreateRequest.
Unit for \"size\"
:return: The size_unit of this VolumeCreateRequest.
:rtype: str
:required/optional: required
"""
return self._size_unit
@size_unit.setter
def size_unit(self, size_unit):
"""
Sets the size_unit of this VolumeCreateRequest.
Unit for \"size\"
:param size_unit: The size_unit of this VolumeCreateRequest.
:type: str
"""
allowed_values = ["bytes", "b", "kb", "mb", "gb", "tb", "pb", "eb", "zb", "yb"]
if size_unit not in allowed_values:
raise ValueError(
"Invalid value for `size_unit`, must be one of {0}"
.format(allowed_values)
)
self._size_unit = size_unit
@property
def size(self):
"""
Gets the size of this VolumeCreateRequest.
Number of units (See sizeUnit) to make the volume.
:return: The size of this VolumeCreateRequest.
:rtype: int
:required/optional: required
"""
return self._size
@size.setter
def size(self, size):
"""
Sets the size of this VolumeCreateRequest.
Number of units (See sizeUnit) to make the volume.
:param size: The size of this VolumeCreateRequest.
:type: int
"""
self._size = size
@property
def seg_size(self):
"""
Gets the seg_size of this VolumeCreateRequest.
The segment size of the volume.
:return: The seg_size of this VolumeCreateRequest.
:rtype: int
:required/optional: required
"""
return self._seg_size
@seg_size.setter
def seg_size(self, seg_size):
"""
Sets the seg_size of this VolumeCreateRequest.
The segment size of the volume.
:param seg_size: The seg_size of this VolumeCreateRequest.
:type: int
"""
self._seg_size = seg_size
@property
def data_assurance_enabled(self):
"""
Gets the data_assurance_enabled of this VolumeCreateRequest.
:return: The data_assurance_enabled of this VolumeCreateRequest.
:rtype: bool
:required/optional: optional
"""
return self._data_assurance_enabled
@data_assurance_enabled.setter
def data_assurance_enabled(self, data_assurance_enabled):
"""
Sets the data_assurance_enabled of this VolumeCreateRequest.
:param data_assurance_enabled: The data_assurance_enabled of this VolumeCreateRequest.
:type: bool
"""
self._data_assurance_enabled = data_assurance_enabled
@property
def owning_controller_id(self):
"""
Gets the owning_controller_id of this VolumeCreateRequest.
Set the preferred owning controller. By default this field will alternate between available controllers
:return: The owning_controller_id of this VolumeCreateRequest.
:rtype: str
:required/optional: optional
"""
return self._owning_controller_id
@owning_controller_id.setter
def owning_controller_id(self, owning_controller_id):
"""
Sets the owning_controller_id of this VolumeCreateRequest.
Set the preferred owning controller. By default this field will alternate between available controllers
:param owning_controller_id: The owning_controller_id of this VolumeCreateRequest.
:type: str
"""
self._owning_controller_id = owning_controller_id
@property
def meta_tags(self):
"""
Gets the meta_tags of this VolumeCreateRequest.
Optional array of Meta Data tags for the volume.
:return: The meta_tags of this VolumeCreateRequest.
:rtype: list[VolumeMetadataItem]
:required/optional: optional
"""
return self._meta_tags
@meta_tags.setter
def meta_tags(self, meta_tags):
"""
Sets the meta_tags of this VolumeCreateRequest.
Optional array of Meta Data tags for the volume.
:param meta_tags: The meta_tags of this VolumeCreateRequest.
:type: list[VolumeMetadataItem]
"""
self._meta_tags = meta_tags
[docs] def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
[docs] def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
if self is None:
return None
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if self is None or other is None:
return None
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other