Source code for netapp.santricity.models.symbol.volume_scan_descriptor

# coding: utf-8

"""
VolumeScanDescriptor.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 VolumeScanDescriptor(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self): """ VolumeScanDescriptor - 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 = { 'volume_ref': 'str', # (required parameter) 'starting_lba': 'int', # (required parameter) 'ending_lba': 'int', # (required parameter) 'repair_media': 'bool', # (required parameter) 'repair_parity': 'bool', # (required parameter) 'priority': 'str', # (required parameter) 'timeout': 'int' } self.attribute_map = { 'volume_ref': 'volumeRef', # (required parameter) 'starting_lba': 'startingLBA', # (required parameter) 'ending_lba': 'endingLBA', # (required parameter) 'repair_media': 'repairMedia', # (required parameter) 'repair_parity': 'repairParity', # (required parameter) 'priority': 'priority', # (required parameter) 'timeout': 'timeout' } self._volume_ref = None self._starting_lba = None self._ending_lba = None self._repair_media = None self._repair_parity = None self._priority = None self._timeout = None @property def volume_ref(self): """ Gets the volume_ref of this VolumeScanDescriptor. The reference value that identifies the volume to be scanned/repaired. :return: The volume_ref of this VolumeScanDescriptor. :rtype: str :required/optional: required """ return self._volume_ref @volume_ref.setter def volume_ref(self, volume_ref): """ Sets the volume_ref of this VolumeScanDescriptor. The reference value that identifies the volume to be scanned/repaired. :param volume_ref: The volume_ref of this VolumeScanDescriptor. :type: str """ self._volume_ref = volume_ref @property def starting_lba(self): """ Gets the starting_lba of this VolumeScanDescriptor. The starting LBA of the scan/repair. :return: The starting_lba of this VolumeScanDescriptor. :rtype: int :required/optional: required """ return self._starting_lba @starting_lba.setter def starting_lba(self, starting_lba): """ Sets the starting_lba of this VolumeScanDescriptor. The starting LBA of the scan/repair. :param starting_lba: The starting_lba of this VolumeScanDescriptor. :type: int """ self._starting_lba = starting_lba @property def ending_lba(self): """ Gets the ending_lba of this VolumeScanDescriptor. The ending LBA of the scan/repair. :return: The ending_lba of this VolumeScanDescriptor. :rtype: int :required/optional: required """ return self._ending_lba @ending_lba.setter def ending_lba(self, ending_lba): """ Sets the ending_lba of this VolumeScanDescriptor. The ending LBA of the scan/repair. :param ending_lba: The ending_lba of this VolumeScanDescriptor. :type: int """ self._ending_lba = ending_lba @property def repair_media(self): """ Gets the repair_media of this VolumeScanDescriptor. When this parameter is set to true(1) the controller will automatically repair any media errors detected during the scan. When it is set to false(0) the scan will stop on any media error detected and report the error in the ParityScanResponse. :return: The repair_media of this VolumeScanDescriptor. :rtype: bool :required/optional: required """ return self._repair_media @repair_media.setter def repair_media(self, repair_media): """ Sets the repair_media of this VolumeScanDescriptor. When this parameter is set to true(1) the controller will automatically repair any media errors detected during the scan. When it is set to false(0) the scan will stop on any media error detected and report the error in the ParityScanResponse. :param repair_media: The repair_media of this VolumeScanDescriptor. :type: bool """ self._repair_media = repair_media @property def repair_parity(self): """ Gets the repair_parity of this VolumeScanDescriptor. When this parameter is set to true(1) the parity for the data stripe containing startingLBA will be repaired. When this parameter is set to false(0) the controller performs a volume parity scan on the data from startingLBA to endingLBA. :return: The repair_parity of this VolumeScanDescriptor. :rtype: bool :required/optional: required """ return self._repair_parity @repair_parity.setter def repair_parity(self, repair_parity): """ Sets the repair_parity of this VolumeScanDescriptor. When this parameter is set to true(1) the parity for the data stripe containing startingLBA will be repaired. When this parameter is set to false(0) the controller performs a volume parity scan on the data from startingLBA to endingLBA. :param repair_parity: The repair_parity of this VolumeScanDescriptor. :type: bool """ self._repair_parity = repair_parity @property def priority(self): """ Gets the priority of this VolumeScanDescriptor. Scan priority :return: The priority of this VolumeScanDescriptor. :rtype: str :required/optional: required """ return self._priority @priority.setter def priority(self, priority): """ Sets the priority of this VolumeScanDescriptor. Scan priority :param priority: The priority of this VolumeScanDescriptor. :type: str """ allowed_values = ["priority0", "priority1", "priority2", "priority3", "priority4", "__UNDEFINED"] if priority not in allowed_values: raise ValueError( "Invalid value for `priority`, must be one of {0}" .format(allowed_values) ) self._priority = priority @property def timeout(self): """ Gets the timeout of this VolumeScanDescriptor. Volume scan timeout, in seconds. :return: The timeout of this VolumeScanDescriptor. :rtype: int :required/optional: required """ return self._timeout @timeout.setter def timeout(self, timeout): """ Sets the timeout of this VolumeScanDescriptor. Volume scan timeout, in seconds. :param timeout: The timeout of this VolumeScanDescriptor. :type: int """ self._timeout = timeout
[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