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

# coding: utf-8

"""
SnapshotVolume.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 SnapshotVolume(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self): """ SnapshotVolume - 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 = { 'world_wide_name': 'str', # (required parameter) 'snapshot_ref': 'str', # (required parameter) 'label': 'str', # (required parameter) 'status': 'str', # (required parameter) 'action': 'str', # (required parameter) 'current_manager': 'str', # (required parameter) 'base_volume': 'str', # (required parameter) 'repository_volume': 'str', # (required parameter) 'full_warn_threshold': 'int', # (required parameter) 'over_warn_threshold': 'bool', # (required parameter) 'repository_full': 'bool', # (required parameter) 'rep_full_policy': 'str', # (required parameter) 'rollback_priority': 'int', # (required parameter) 'extent_start': 'int', # (required parameter) 'extent_size': 'int', # (required parameter) 'snapshot_time': 'int', # (required parameter) 'perms': 'VolumePerms', # (required parameter) 'children_inactive': 'bool', # (required parameter) 'volume_handle': 'int', # (required parameter) 'mgmt_client_attribute': 'int', # (required parameter) 'rollback_status': 'str', # (required parameter) 'id': 'str' } self.attribute_map = { 'world_wide_name': 'worldWideName', # (required parameter) 'snapshot_ref': 'snapshotRef', # (required parameter) 'label': 'label', # (required parameter) 'status': 'status', # (required parameter) 'action': 'action', # (required parameter) 'current_manager': 'currentManager', # (required parameter) 'base_volume': 'baseVolume', # (required parameter) 'repository_volume': 'repositoryVolume', # (required parameter) 'full_warn_threshold': 'fullWarnThreshold', # (required parameter) 'over_warn_threshold': 'overWarnThreshold', # (required parameter) 'repository_full': 'repositoryFull', # (required parameter) 'rep_full_policy': 'repFullPolicy', # (required parameter) 'rollback_priority': 'rollbackPriority', # (required parameter) 'extent_start': 'extentStart', # (required parameter) 'extent_size': 'extentSize', # (required parameter) 'snapshot_time': 'snapshotTime', # (required parameter) 'perms': 'perms', # (required parameter) 'children_inactive': 'childrenInactive', # (required parameter) 'volume_handle': 'volumeHandle', # (required parameter) 'mgmt_client_attribute': 'mgmtClientAttribute', # (required parameter) 'rollback_status': 'rollbackStatus', # (required parameter) 'id': 'id' } self._world_wide_name = None self._snapshot_ref = None self._label = None self._status = None self._action = None self._current_manager = None self._base_volume = None self._repository_volume = None self._full_warn_threshold = None self._over_warn_threshold = None self._repository_full = None self._rep_full_policy = None self._rollback_priority = None self._extent_start = None self._extent_size = None self._snapshot_time = None self._perms = None self._children_inactive = None self._volume_handle = None self._mgmt_client_attribute = None self._rollback_status = None self._id = None @property def world_wide_name(self): """ Gets the world_wide_name of this SnapshotVolume. The World Wide Name of the snapshot. :return: The world_wide_name of this SnapshotVolume. :rtype: str :required/optional: required """ return self._world_wide_name @world_wide_name.setter def world_wide_name(self, world_wide_name): """ Sets the world_wide_name of this SnapshotVolume. The World Wide Name of the snapshot. :param world_wide_name: The world_wide_name of this SnapshotVolume. :type: str """ self._world_wide_name = world_wide_name @property def snapshot_ref(self): """ Gets the snapshot_ref of this SnapshotVolume. Reference (key) for the snapshot volume. :return: The snapshot_ref of this SnapshotVolume. :rtype: str :required/optional: required """ return self._snapshot_ref @snapshot_ref.setter def snapshot_ref(self, snapshot_ref): """ Sets the snapshot_ref of this SnapshotVolume. Reference (key) for the snapshot volume. :param snapshot_ref: The snapshot_ref of this SnapshotVolume. :type: str """ self._snapshot_ref = snapshot_ref @property def label(self): """ Gets the label of this SnapshotVolume. Name of the snapshot. :return: The label of this SnapshotVolume. :rtype: str :required/optional: required """ return self._label @label.setter def label(self, label): """ Sets the label of this SnapshotVolume. Name of the snapshot. :param label: The label of this SnapshotVolume. :type: str """ self._label = label @property def status(self): """ Gets the status of this SnapshotVolume. Indicates status of the snapshot. :return: The status of this SnapshotVolume. :rtype: str :required/optional: required """ return self._status @status.setter def status(self, status): """ Sets the status of this SnapshotVolume. Indicates status of the snapshot. :param status: The status of this SnapshotVolume. :type: str """ allowed_values = ["active", "failed", "disabled", "offline", "__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 action(self): """ Gets the action of this SnapshotVolume. Long running action. :return: The action of this SnapshotVolume. :rtype: str :required/optional: required """ return self._action @action.setter def action(self, action): """ Sets the action of this SnapshotVolume. Long running action. :param action: The action of this SnapshotVolume. :type: str """ allowed_values = ["none", "rollback", "__UNDEFINED"] if action not in allowed_values: raise ValueError( "Invalid value for `action`, must be one of {0}" .format(allowed_values) ) self._action = action @property def current_manager(self): """ Gets the current_manager of this SnapshotVolume. Current owner of the snapshot. :return: The current_manager of this SnapshotVolume. :rtype: str :required/optional: required """ return self._current_manager @current_manager.setter def current_manager(self, current_manager): """ Sets the current_manager of this SnapshotVolume. Current owner of the snapshot. :param current_manager: The current_manager of this SnapshotVolume. :type: str """ self._current_manager = current_manager @property def base_volume(self): """ Gets the base_volume of this SnapshotVolume. Base volume for this snapshot. :return: The base_volume of this SnapshotVolume. :rtype: str :required/optional: required """ return self._base_volume @base_volume.setter def base_volume(self, base_volume): """ Sets the base_volume of this SnapshotVolume. Base volume for this snapshot. :param base_volume: The base_volume of this SnapshotVolume. :type: str """ self._base_volume = base_volume @property def repository_volume(self): """ Gets the repository_volume of this SnapshotVolume. Repository volume for this snapshot. :return: The repository_volume of this SnapshotVolume. :rtype: str :required/optional: required """ return self._repository_volume @repository_volume.setter def repository_volume(self, repository_volume): """ Sets the repository_volume of this SnapshotVolume. Repository volume for this snapshot. :param repository_volume: The repository_volume of this SnapshotVolume. :type: str """ self._repository_volume = repository_volume @property def full_warn_threshold(self): """ Gets the full_warn_threshold of this SnapshotVolume. Repository utilization warning threshold. :return: The full_warn_threshold of this SnapshotVolume. :rtype: int :required/optional: required """ return self._full_warn_threshold @full_warn_threshold.setter def full_warn_threshold(self, full_warn_threshold): """ Sets the full_warn_threshold of this SnapshotVolume. Repository utilization warning threshold. :param full_warn_threshold: The full_warn_threshold of this SnapshotVolume. :type: int """ self._full_warn_threshold = full_warn_threshold @property def over_warn_threshold(self): """ Gets the over_warn_threshold of this SnapshotVolume. True if the repository utilization is over the warning threshold. :return: The over_warn_threshold of this SnapshotVolume. :rtype: bool :required/optional: required """ return self._over_warn_threshold @over_warn_threshold.setter def over_warn_threshold(self, over_warn_threshold): """ Sets the over_warn_threshold of this SnapshotVolume. True if the repository utilization is over the warning threshold. :param over_warn_threshold: The over_warn_threshold of this SnapshotVolume. :type: bool """ self._over_warn_threshold = over_warn_threshold @property def repository_full(self): """ Gets the repository_full of this SnapshotVolume. True, if the repository is full. :return: The repository_full of this SnapshotVolume. :rtype: bool :required/optional: required """ return self._repository_full @repository_full.setter def repository_full(self, repository_full): """ Sets the repository_full of this SnapshotVolume. True, if the repository is full. :param repository_full: The repository_full of this SnapshotVolume. :type: bool """ self._repository_full = repository_full @property def rep_full_policy(self): """ Gets the rep_full_policy of this SnapshotVolume. Indication of the volume behavior when the repository is full. :return: The rep_full_policy of this SnapshotVolume. :rtype: str :required/optional: required """ return self._rep_full_policy @rep_full_policy.setter def rep_full_policy(self, rep_full_policy): """ Sets the rep_full_policy of this SnapshotVolume. Indication of the volume behavior when the repository is full. :param rep_full_policy: The rep_full_policy of this SnapshotVolume. :type: str """ allowed_values = ["failwrites", "failsnap", "__UNDEFINED"] if rep_full_policy not in allowed_values: raise ValueError( "Invalid value for `rep_full_policy`, must be one of {0}" .format(allowed_values) ) self._rep_full_policy = rep_full_policy @property def rollback_priority(self): """ Gets the rollback_priority of this SnapshotVolume. The importance of the rollback operation (0-4). Not used in this release of software. :return: The rollback_priority of this SnapshotVolume. :rtype: int :required/optional: required """ return self._rollback_priority @rollback_priority.setter def rollback_priority(self, rollback_priority): """ Sets the rollback_priority of this SnapshotVolume. The importance of the rollback operation (0-4). Not used in this release of software. :param rollback_priority: The rollback_priority of this SnapshotVolume. :type: int """ self._rollback_priority = rollback_priority @property def extent_start(self): """ Gets the extent_start of this SnapshotVolume. The start position of the extent in the base volume (bytes). Not used in this release of software. :return: The extent_start of this SnapshotVolume. :rtype: int :required/optional: required """ return self._extent_start @extent_start.setter def extent_start(self, extent_start): """ Sets the extent_start of this SnapshotVolume. The start position of the extent in the base volume (bytes). Not used in this release of software. :param extent_start: The extent_start of this SnapshotVolume. :type: int """ self._extent_start = extent_start @property def extent_size(self): """ Gets the extent_size of this SnapshotVolume. The size of the extent in bytes. Not used in this release of software. :return: The extent_size of this SnapshotVolume. :rtype: int :required/optional: required """ return self._extent_size @extent_size.setter def extent_size(self, extent_size): """ Sets the extent_size of this SnapshotVolume. The size of the extent in bytes. Not used in this release of software. :param extent_size: The extent_size of this SnapshotVolume. :type: int """ self._extent_size = extent_size @property def snapshot_time(self): """ Gets the snapshot_time of this SnapshotVolume. The controller time when the snapshot was created. :return: The snapshot_time of this SnapshotVolume. :rtype: int :required/optional: required """ return self._snapshot_time @snapshot_time.setter def snapshot_time(self, snapshot_time): """ Sets the snapshot_time of this SnapshotVolume. The controller time when the snapshot was created. :param snapshot_time: The snapshot_time of this SnapshotVolume. :type: int """ self._snapshot_time = snapshot_time @property def perms(self): """ Gets the perms of this SnapshotVolume. Permissions allowed on volume. :return: The perms of this SnapshotVolume. :rtype: VolumePerms :required/optional: required """ return self._perms @perms.setter def perms(self, perms): """ Sets the perms of this SnapshotVolume. Permissions allowed on volume. :param perms: The perms of this SnapshotVolume. :type: VolumePerms """ self._perms = perms @property def children_inactive(self): """ Gets the children_inactive of this SnapshotVolume. True if all child volumes are offline or failed. Child volumes are the base volume and the REPOSITORY volume. :return: The children_inactive of this SnapshotVolume. :rtype: bool :required/optional: required """ return self._children_inactive @children_inactive.setter def children_inactive(self, children_inactive): """ Sets the children_inactive of this SnapshotVolume. True if all child volumes are offline or failed. Child volumes are the base volume and the REPOSITORY volume. :param children_inactive: The children_inactive of this SnapshotVolume. :type: bool """ self._children_inactive = children_inactive @property def volume_handle(self): """ Gets the volume_handle of this SnapshotVolume. Volume SSID. :return: The volume_handle of this SnapshotVolume. :rtype: int :required/optional: required """ return self._volume_handle @volume_handle.setter def volume_handle(self, volume_handle): """ Sets the volume_handle of this SnapshotVolume. Volume SSID. :param volume_handle: The volume_handle of this SnapshotVolume. :type: int """ self._volume_handle = volume_handle @property def mgmt_client_attribute(self): """ Gets the mgmt_client_attribute of this SnapshotVolume. For use by management client. :return: The mgmt_client_attribute of this SnapshotVolume. :rtype: int :required/optional: required """ return self._mgmt_client_attribute @mgmt_client_attribute.setter def mgmt_client_attribute(self, mgmt_client_attribute): """ Sets the mgmt_client_attribute of this SnapshotVolume. For use by management client. :param mgmt_client_attribute: The mgmt_client_attribute of this SnapshotVolume. :type: int """ self._mgmt_client_attribute = mgmt_client_attribute @property def rollback_status(self): """ Gets the rollback_status of this SnapshotVolume. Status of current action being performed on snapshot. :return: The rollback_status of this SnapshotVolume. :rtype: str :required/optional: required """ return self._rollback_status @rollback_status.setter def rollback_status(self, rollback_status): """ Sets the rollback_status of this SnapshotVolume. Status of current action being performed on snapshot. :param rollback_status: The rollback_status of this SnapshotVolume. :type: str """ allowed_values = ["none", "inProgress", "pending", "paused", "__UNDEFINED"] if rollback_status not in allowed_values: raise ValueError( "Invalid value for `rollback_status`, must be one of {0}" .format(allowed_values) ) self._rollback_status = rollback_status @property def id(self): """ Gets the id of this SnapshotVolume. :return: The id of this SnapshotVolume. :rtype: str :required/optional: optional """ return self._id @id.setter def id(self, id): """ Sets the id of this SnapshotVolume. :param id: The id of this SnapshotVolume. :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