huaweicloud-sdk-python-v3/huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/delete_servers_request_body.py

159 lines
5.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding: utf-8
import pprint
import re
import six
class DeleteServersRequestBody(object):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
sensitive_list = []
openapi_types = {
'delete_publicip': 'bool',
'delete_volume': 'bool',
'servers': 'list[ServerId]'
}
attribute_map = {
'delete_publicip': 'delete_publicip',
'delete_volume': 'delete_volume',
'servers': 'servers'
}
def __init__(self, delete_publicip=None, delete_volume=None, servers=None): # noqa: E501
"""DeleteServersRequestBody - a model defined in huaweicloud sdk"""
self._delete_publicip = None
self._delete_volume = None
self._servers = None
self.discriminator = None
if delete_publicip is not None:
self.delete_publicip = delete_publicip
if delete_volume is not None:
self.delete_volume = delete_volume
self.servers = servers
@property
def delete_publicip(self):
"""Gets the delete_publicip of this DeleteServersRequestBody.
配置删除云服务器是否删除云服务器绑定的弹性IP。如果选择不删除则系统仅做解绑定操作保留弹性IP资源。 取值为true或false默认为false。 - true删除云服务器时会同时删除绑定在云服务器上的弹性IP。 - false删除云服务器时仅解绑定在云服务器上的弹性IP不删除弹性IP
:return: The delete_publicip of this DeleteServersRequestBody.
:rtype: bool
"""
return self._delete_publicip
@delete_publicip.setter
def delete_publicip(self, delete_publicip):
"""Sets the delete_publicip of this DeleteServersRequestBody.
配置删除云服务器是否删除云服务器绑定的弹性IP。如果选择不删除则系统仅做解绑定操作保留弹性IP资源。 取值为true或false默认为false。 - true删除云服务器时会同时删除绑定在云服务器上的弹性IP。 - false删除云服务器时仅解绑定在云服务器上的弹性IP不删除弹性IP
:param delete_publicip: The delete_publicip of this DeleteServersRequestBody.
:type: bool
"""
self._delete_publicip = delete_publicip
@property
def delete_volume(self):
"""Gets the delete_volume of this DeleteServersRequestBody.
配置删除云服务器是否删除云服务器对应的数据盘,如果选择不删除,则系统仅做解绑定操作,保留云磁盘资源。 取值为false或true默认为false。 - true删除云服务器时会同时删除挂载在云服务器上的数据盘。 - false删除云服务器时仅卸载云服务器上挂载的数据盘不删除该数据盘。
:return: The delete_volume of this DeleteServersRequestBody.
:rtype: bool
"""
return self._delete_volume
@delete_volume.setter
def delete_volume(self, delete_volume):
"""Sets the delete_volume of this DeleteServersRequestBody.
配置删除云服务器是否删除云服务器对应的数据盘,如果选择不删除,则系统仅做解绑定操作,保留云磁盘资源。 取值为false或true默认为false。 - true删除云服务器时会同时删除挂载在云服务器上的数据盘。 - false删除云服务器时仅卸载云服务器上挂载的数据盘不删除该数据盘。
:param delete_volume: The delete_volume of this DeleteServersRequestBody.
:type: bool
"""
self._delete_volume = delete_volume
@property
def servers(self):
"""Gets the servers of this DeleteServersRequestBody.
所需要删除的云服务器列表。
:return: The servers of this DeleteServersRequestBody.
:rtype: list[ServerId]
"""
return self._servers
@servers.setter
def servers(self, servers):
"""Sets the servers of this DeleteServersRequestBody.
所需要删除的云服务器列表。
:param servers: The servers of this DeleteServersRequestBody.
:type: list[ServerId]
"""
self._servers = servers
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_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:
if attr in self.sensitive_list:
result[attr] = "****"
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DeleteServersRequestBody):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other