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

238 lines
9.3 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 PrePaidServerRootVolume(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 = {
'volumetype': 'str',
'size': 'int',
'extendparam': 'PrePaidServerRootVolumeExtendParam',
'cluster_type': 'str',
'cluster_id': 'str',
'hwpassthrough': 'bool'
}
attribute_map = {
'volumetype': 'volumetype',
'size': 'size',
'extendparam': 'extendparam',
'cluster_type': 'cluster_type',
'cluster_id': 'cluster_id',
'hwpassthrough': 'hw:passthrough'
}
def __init__(self, volumetype=None, size=None, extendparam=None, cluster_type=None, cluster_id=None, hwpassthrough=False): # noqa: E501
"""PrePaidServerRootVolume - a model defined in huaweicloud sdk"""
self._volumetype = None
self._size = None
self._extendparam = None
self._cluster_type = None
self._cluster_id = None
self._hwpassthrough = None
self.discriminator = None
self.volumetype = volumetype
if size is not None:
self.size = size
if extendparam is not None:
self.extendparam = extendparam
if cluster_type is not None:
self.cluster_type = cluster_type
if cluster_id is not None:
self.cluster_id = cluster_id
if hwpassthrough is not None:
self.hwpassthrough = hwpassthrough
@property
def volumetype(self):
"""Gets the volumetype of this PrePaidServerRootVolume.
云服务器系统盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。 - SATA普通IO磁盘类型。 - SAS高IO磁盘类型。 - SSD超高IO磁盘类型。 - co-p1高IO (性能优化Ⅰ型) - uh-l1超高IO (时延优化) > 说明: > > 对于HANA云服务器、HL1型云服务器、HL2型云服务器需使用co-p1和uh-l1两种磁盘类型。对于其他类型的云服务器不能使用co-p1和uh-l1两种磁盘类型。
:return: The volumetype of this PrePaidServerRootVolume.
:rtype: str
"""
return self._volumetype
@volumetype.setter
def volumetype(self, volumetype):
"""Sets the volumetype of this PrePaidServerRootVolume.
云服务器系统盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。 - SATA普通IO磁盘类型。 - SAS高IO磁盘类型。 - SSD超高IO磁盘类型。 - co-p1高IO (性能优化Ⅰ型) - uh-l1超高IO (时延优化) > 说明: > > 对于HANA云服务器、HL1型云服务器、HL2型云服务器需使用co-p1和uh-l1两种磁盘类型。对于其他类型的云服务器不能使用co-p1和uh-l1两种磁盘类型。
:param volumetype: The volumetype of this PrePaidServerRootVolume.
:type: str
"""
self._volumetype = volumetype
@property
def size(self):
"""Gets the size of this PrePaidServerRootVolume.
系统盘大小容量单位为GB 输入大小范围为[1,1024]。 约束: - 系统盘大小取值应不小于镜像支持的系统盘的最小值(镜像的min_disk属性)。 - 若该参数没有指定或者指定为0时系统盘大小默认取值为镜像中系统盘的最小值(镜像的min_disk属性)。 > 说明: > > 镜像系统盘的最小值(镜像的min_disk属性)可在控制台中点击镜像详情查看。或通过调用“查询镜像详情OpenStack原生”API获取详细操作请参考《镜像服务API参考》中“查询镜像详情OpenStack原生”章节。
:return: The size of this PrePaidServerRootVolume.
:rtype: int
"""
return self._size
@size.setter
def size(self, size):
"""Sets the size of this PrePaidServerRootVolume.
系统盘大小容量单位为GB 输入大小范围为[1,1024]。 约束: - 系统盘大小取值应不小于镜像支持的系统盘的最小值(镜像的min_disk属性)。 - 若该参数没有指定或者指定为0时系统盘大小默认取值为镜像中系统盘的最小值(镜像的min_disk属性)。 > 说明: > > 镜像系统盘的最小值(镜像的min_disk属性)可在控制台中点击镜像详情查看。或通过调用“查询镜像详情OpenStack原生”API获取详细操作请参考《镜像服务API参考》中“查询镜像详情OpenStack原生”章节。
:param size: The size of this PrePaidServerRootVolume.
:type: int
"""
self._size = size
@property
def extendparam(self):
"""Gets the extendparam of this PrePaidServerRootVolume.
:return: The extendparam of this PrePaidServerRootVolume.
:rtype: PrePaidServerRootVolumeExtendParam
"""
return self._extendparam
@extendparam.setter
def extendparam(self, extendparam):
"""Sets the extendparam of this PrePaidServerRootVolume.
:param extendparam: The extendparam of this PrePaidServerRootVolume.
:type: PrePaidServerRootVolumeExtendParam
"""
self._extendparam = extendparam
@property
def cluster_type(self):
"""Gets the cluster_type of this PrePaidServerRootVolume.
云服务器系统盘对应的磁盘存储类型。 磁盘存储类型枚举值: DSS专属存储类型
:return: The cluster_type of this PrePaidServerRootVolume.
:rtype: str
"""
return self._cluster_type
@cluster_type.setter
def cluster_type(self, cluster_type):
"""Sets the cluster_type of this PrePaidServerRootVolume.
云服务器系统盘对应的磁盘存储类型。 磁盘存储类型枚举值: DSS专属存储类型
:param cluster_type: The cluster_type of this PrePaidServerRootVolume.
:type: str
"""
self._cluster_type = cluster_type
@property
def cluster_id(self):
"""Gets the cluster_id of this PrePaidServerRootVolume.
使用SDI规格创建虚拟机时请关注该参数如果该参数值为true说明创建的为scsi类型的卷
:return: The cluster_id of this PrePaidServerRootVolume.
:rtype: str
"""
return self._cluster_id
@cluster_id.setter
def cluster_id(self, cluster_id):
"""Sets the cluster_id of this PrePaidServerRootVolume.
使用SDI规格创建虚拟机时请关注该参数如果该参数值为true说明创建的为scsi类型的卷
:param cluster_id: The cluster_id of this PrePaidServerRootVolume.
:type: str
"""
self._cluster_id = cluster_id
@property
def hwpassthrough(self):
"""Gets the hwpassthrough of this PrePaidServerRootVolume.
使用SDI规格创建虚拟机时请关注该参数如果该参数值为true说明创建的为scsi类型的卷 > 说明: > > 此参数为boolean类型若传入非boolean类型字符程序将按照false方式处理。
:return: The hwpassthrough of this PrePaidServerRootVolume.
:rtype: bool
"""
return self._hwpassthrough
@hwpassthrough.setter
def hwpassthrough(self, hwpassthrough):
"""Sets the hwpassthrough of this PrePaidServerRootVolume.
使用SDI规格创建虚拟机时请关注该参数如果该参数值为true说明创建的为scsi类型的卷 > 说明: > > 此参数为boolean类型若传入非boolean类型字符程序将按照false方式处理。
:param hwpassthrough: The hwpassthrough of this PrePaidServerRootVolume.
:type: bool
"""
self._hwpassthrough = hwpassthrough
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, PrePaidServerRootVolume):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other