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

# coding: utf-8

"""
PIT.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 PIT(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self): """ PIT - 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 = { 'pit_ref': 'str', # (required parameter) 'pit_group_ref': 'str', # (required parameter) 'creation_method': 'str', # (required parameter) 'pit_timestamp': 'int', # (required parameter) 'pit_sequence_number': 'int', # (required parameter) 'status': 'str', # (required parameter) 'active_cow': 'bool', # (required parameter) 'is_rollback_source': 'bool', # (required parameter) 'pit_capacity': 'int', # (required parameter) 'repository_capacity_utilization': 'int', # (required parameter) 'id': 'str' } self.attribute_map = { 'pit_ref': 'pitRef', # (required parameter) 'pit_group_ref': 'pitGroupRef', # (required parameter) 'creation_method': 'creationMethod', # (required parameter) 'pit_timestamp': 'pitTimestamp', # (required parameter) 'pit_sequence_number': 'pitSequenceNumber', # (required parameter) 'status': 'status', # (required parameter) 'active_cow': 'activeCOW', # (required parameter) 'is_rollback_source': 'isRollbackSource', # (required parameter) 'pit_capacity': 'pitCapacity', # (required parameter) 'repository_capacity_utilization': 'repositoryCapacityUtilization', # (required parameter) 'id': 'id' } self._pit_ref = None self._pit_group_ref = None self._creation_method = None self._pit_timestamp = None self._pit_sequence_number = None self._status = None self._active_cow = None self._is_rollback_source = None self._pit_capacity = None self._repository_capacity_utilization = None self._id = None @property def pit_ref(self): """ Gets the pit_ref of this PIT. The reference (key) for this PiT. :return: The pit_ref of this PIT. :rtype: str :required/optional: required """ return self._pit_ref @pit_ref.setter def pit_ref(self, pit_ref): """ Sets the pit_ref of this PIT. The reference (key) for this PiT. :param pit_ref: The pit_ref of this PIT. :type: str """ self._pit_ref = pit_ref @property def pit_group_ref(self): """ Gets the pit_group_ref of this PIT. A reference to the associated PiT Group. :return: The pit_group_ref of this PIT. :rtype: str :required/optional: required """ return self._pit_group_ref @pit_group_ref.setter def pit_group_ref(self, pit_group_ref): """ Sets the pit_group_ref of this PIT. A reference to the associated PiT Group. :param pit_group_ref: The pit_group_ref of this PIT. :type: str """ self._pit_group_ref = pit_group_ref @property def creation_method(self): """ Gets the creation_method of this PIT. The PiT creation method. :return: The creation_method of this PIT. :rtype: str :required/optional: required """ return self._creation_method @creation_method.setter def creation_method(self, creation_method): """ Sets the creation_method of this PIT. The PiT creation method. :param creation_method: The creation_method of this PIT. :type: str """ allowed_values = ["unknown", "user", "schedule", "__UNDEFINED"] if creation_method not in allowed_values: raise ValueError( "Invalid value for `creation_method`, must be one of {0}" .format(allowed_values) ) self._creation_method = creation_method @property def pit_timestamp(self): """ Gets the pit_timestamp of this PIT. The controller-time (measured in seconds since January 1, 1970) when the PiT was created. :return: The pit_timestamp of this PIT. :rtype: int :required/optional: required """ return self._pit_timestamp @pit_timestamp.setter def pit_timestamp(self, pit_timestamp): """ Sets the pit_timestamp of this PIT. The controller-time (measured in seconds since January 1, 1970) when the PiT was created. :param pit_timestamp: The pit_timestamp of this PIT. :type: int """ self._pit_timestamp = pit_timestamp @property def pit_sequence_number(self): """ Gets the pit_sequence_number of this PIT. The sequence number within PITGroup. This is a monotonically increasing sequence value that can be used to determine the absolute order of the PiTs within a PiT group. Using this sequence number avoids issues with timestamps when real-time clocks are changed. Note that this sequence number will be the same on all PiTs taken in multiple PITGroups at the same time under a single IO suspension, either as part of a consistency group operation (createCGPIT) or when a list of PITGroups is passed to createPIT. :return: The pit_sequence_number of this PIT. :rtype: int :required/optional: required """ return self._pit_sequence_number @pit_sequence_number.setter def pit_sequence_number(self, pit_sequence_number): """ Sets the pit_sequence_number of this PIT. The sequence number within PITGroup. This is a monotonically increasing sequence value that can be used to determine the absolute order of the PiTs within a PiT group. Using this sequence number avoids issues with timestamps when real-time clocks are changed. Note that this sequence number will be the same on all PiTs taken in multiple PITGroups at the same time under a single IO suspension, either as part of a consistency group operation (createCGPIT) or when a list of PITGroups is passed to createPIT. :param pit_sequence_number: The pit_sequence_number of this PIT. :type: int """ self._pit_sequence_number = pit_sequence_number @property def status(self): """ Gets the status of this PIT. The state of this PiT. :return: The status of this PIT. :rtype: str :required/optional: required """ return self._status @status.setter def status(self, status): """ Sets the status of this PIT. The state of this PiT. :param status: The status of this PIT. :type: str """ allowed_values = ["unknown", "optimal", "failed", "purged", "__UNDEFINED"] if status not in allowed_values: raise ValueError( "Invalid value for `status`, must be one of {0}" .format(allowed_values) ) self._status = status @property def active_cow(self): """ Gets the active_cow of this PIT. If true, the PiT is actively recording copy-on-write data. :return: The active_cow of this PIT. :rtype: bool :required/optional: required """ return self._active_cow @active_cow.setter def active_cow(self, active_cow): """ Sets the active_cow of this PIT. If true, the PiT is actively recording copy-on-write data. :param active_cow: The active_cow of this PIT. :type: bool """ self._active_cow = active_cow @property def is_rollback_source(self): """ Gets the is_rollback_source of this PIT. If true, the PiT is a rollback source. :return: The is_rollback_source of this PIT. :rtype: bool :required/optional: required """ return self._is_rollback_source @is_rollback_source.setter def is_rollback_source(self, is_rollback_source): """ Sets the is_rollback_source of this PIT. If true, the PiT is a rollback source. :param is_rollback_source: The is_rollback_source of this PIT. :type: bool """ self._is_rollback_source = is_rollback_source @property def pit_capacity(self): """ Gets the pit_capacity of this PIT. The capacity in bytes of this PiT (capacity of the base at the time the PiT was created). :return: The pit_capacity of this PIT. :rtype: int :required/optional: required """ return self._pit_capacity @pit_capacity.setter def pit_capacity(self, pit_capacity): """ Sets the pit_capacity of this PIT. The capacity in bytes of this PiT (capacity of the base at the time the PiT was created). :param pit_capacity: The pit_capacity of this PIT. :type: int """ self._pit_capacity = pit_capacity @property def repository_capacity_utilization(self): """ Gets the repository_capacity_utilization of this PIT. Repository utilization in bytes (only reported if activeCOW = false). :return: The repository_capacity_utilization of this PIT. :rtype: int :required/optional: required """ return self._repository_capacity_utilization @repository_capacity_utilization.setter def repository_capacity_utilization(self, repository_capacity_utilization): """ Sets the repository_capacity_utilization of this PIT. Repository utilization in bytes (only reported if activeCOW = false). :param repository_capacity_utilization: The repository_capacity_utilization of this PIT. :type: int """ self._repository_capacity_utilization = repository_capacity_utilization @property def id(self): """ Gets the id of this PIT. :return: The id of this PIT. :rtype: str :required/optional: optional """ return self._id @id.setter def id(self, id): """ Sets the id of this PIT. :param id: The id of this PIT. :type: str """ self._id = id
[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