Source code for netapp.santricity.models.v2.drive_selection_request

# coding: utf-8

"""
DriveSelectionRequest.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 DriveSelectionRequest(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self): """ DriveSelectionRequest - 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 = { 'drive_count': 'int', # (required parameter) 'selected_spindle_speeds': 'list[int]', 'fde_capable_only': 'bool', 'drive_capacity_min': 'int', 'drive_type': 'str', 'interface_type': 'str', 'protection_information_capable': 'bool', 'size_unit': 'str', 'raid_level': 'str', 'target_usable_capacity': 'int' } self.attribute_map = { 'drive_count': 'driveCount', # (required parameter) 'selected_spindle_speeds': 'selectedSpindleSpeeds', 'fde_capable_only': 'fdeCapableOnly', 'drive_capacity_min': 'driveCapacityMin', 'drive_type': 'driveType', 'interface_type': 'interfaceType', 'protection_information_capable': 'protectionInformationCapable', 'size_unit': 'sizeUnit', 'raid_level': 'raidLevel', 'target_usable_capacity': 'targetUsableCapacity' } self._drive_count = None self._selected_spindle_speeds = None self._fde_capable_only = None self._drive_capacity_min = None self._drive_type = None self._interface_type = None self._protection_information_capable = None self._size_unit = None self._raid_level = None self._target_usable_capacity = None @property def drive_count(self): """ Gets the drive_count of this DriveSelectionRequest. :return: The drive_count of this DriveSelectionRequest. :rtype: int :required/optional: required """ return self._drive_count @drive_count.setter def drive_count(self, drive_count): """ Sets the drive_count of this DriveSelectionRequest. :param drive_count: The drive_count of this DriveSelectionRequest. :type: int """ self._drive_count = drive_count @property def selected_spindle_speeds(self): """ Gets the selected_spindle_speeds of this DriveSelectionRequest. Only select drives with these spindle speeds :return: The selected_spindle_speeds of this DriveSelectionRequest. :rtype: list[int] :required/optional: optional """ return self._selected_spindle_speeds @selected_spindle_speeds.setter def selected_spindle_speeds(self, selected_spindle_speeds): """ Sets the selected_spindle_speeds of this DriveSelectionRequest. Only select drives with these spindle speeds :param selected_spindle_speeds: The selected_spindle_speeds of this DriveSelectionRequest. :type: list[int] """ self._selected_spindle_speeds = selected_spindle_speeds @property def fde_capable_only(self): """ Gets the fde_capable_only of this DriveSelectionRequest. Only select FDE capable drives :return: The fde_capable_only of this DriveSelectionRequest. :rtype: bool :required/optional: optional """ return self._fde_capable_only @fde_capable_only.setter def fde_capable_only(self, fde_capable_only): """ Sets the fde_capable_only of this DriveSelectionRequest. Only select FDE capable drives :param fde_capable_only: The fde_capable_only of this DriveSelectionRequest. :type: bool """ self._fde_capable_only = fde_capable_only @property def drive_capacity_min(self): """ Gets the drive_capacity_min of this DriveSelectionRequest. Only consider drives with at least this minimum raw capacity in SizeUnits :return: The drive_capacity_min of this DriveSelectionRequest. :rtype: int :required/optional: optional """ return self._drive_capacity_min @drive_capacity_min.setter def drive_capacity_min(self, drive_capacity_min): """ Sets the drive_capacity_min of this DriveSelectionRequest. Only consider drives with at least this minimum raw capacity in SizeUnits :param drive_capacity_min: The drive_capacity_min of this DriveSelectionRequest. :type: int """ self._drive_capacity_min = drive_capacity_min @property def drive_type(self): """ Gets the drive_type of this DriveSelectionRequest. Only consider drives of this media type :return: The drive_type of this DriveSelectionRequest. :rtype: str :required/optional: optional """ return self._drive_type @drive_type.setter def drive_type(self, drive_type): """ Sets the drive_type of this DriveSelectionRequest. Only consider drives of this media type :param drive_type: The drive_type of this DriveSelectionRequest. :type: str """ allowed_values = ["ssd", "hdd"] if drive_type not in allowed_values: raise ValueError( "Invalid value for `drive_type`, must be one of {0}" .format(allowed_values) ) self._drive_type = drive_type @property def interface_type(self): """ Gets the interface_type of this DriveSelectionRequest. Only consider drives of this interface type :return: The interface_type of this DriveSelectionRequest. :rtype: str :required/optional: optional """ return self._interface_type @interface_type.setter def interface_type(self, interface_type): """ Sets the interface_type of this DriveSelectionRequest. Only consider drives of this interface type :param interface_type: The interface_type of this DriveSelectionRequest. :type: str """ allowed_values = ["fibre", "sas", "sata"] if interface_type not in allowed_values: raise ValueError( "Invalid value for `interface_type`, must be one of {0}" .format(allowed_values) ) self._interface_type = interface_type @property def protection_information_capable(self): """ Gets the protection_information_capable of this DriveSelectionRequest. Only consider drives that have Data Assurance capability. :return: The protection_information_capable of this DriveSelectionRequest. :rtype: bool :required/optional: optional """ return self._protection_information_capable @protection_information_capable.setter def protection_information_capable(self, protection_information_capable): """ Sets the protection_information_capable of this DriveSelectionRequest. Only consider drives that have Data Assurance capability. :param protection_information_capable: The protection_information_capable of this DriveSelectionRequest. :type: bool """ self._protection_information_capable = protection_information_capable @property def size_unit(self): """ Gets the size_unit of this DriveSelectionRequest. Use this unit for any capacity based parameters :return: The size_unit of this DriveSelectionRequest. :rtype: str :required/optional: optional """ return self._size_unit @size_unit.setter def size_unit(self, size_unit): """ Sets the size_unit of this DriveSelectionRequest. Use this unit for any capacity based parameters :param size_unit: The size_unit of this DriveSelectionRequest. :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 raid_level(self): """ Gets the raid_level of this DriveSelectionRequest. The intended RAID level for the storage-pool. :return: The raid_level of this DriveSelectionRequest. :rtype: str :required/optional: optional """ return self._raid_level @raid_level.setter def raid_level(self, raid_level): """ Sets the raid_level of this DriveSelectionRequest. The intended RAID level for the storage-pool. :param raid_level: The raid_level of this DriveSelectionRequest. :type: str """ allowed_values = ["raidUnsupported", "raidAll", "raid0", "raid1", "raid3", "raid5", "raid6", "raidDiskPool", "__UNDEFINED"] if raid_level not in allowed_values: raise ValueError( "Invalid value for `raid_level`, must be one of {0}" .format(allowed_values) ) self._raid_level = raid_level @property def target_usable_capacity(self): """ Gets the target_usable_capacity of this DriveSelectionRequest. The aggregate capacity of the selected drives must be at least this many SizeUnits :return: The target_usable_capacity of this DriveSelectionRequest. :rtype: int :required/optional: optional """ return self._target_usable_capacity @target_usable_capacity.setter def target_usable_capacity(self, target_usable_capacity): """ Sets the target_usable_capacity of this DriveSelectionRequest. The aggregate capacity of the selected drives must be at least this many SizeUnits :param target_usable_capacity: The target_usable_capacity of this DriveSelectionRequest. :type: int """ self._target_usable_capacity = target_usable_capacity
[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