2020-05-18 07:34:40 +00:00
|
|
|
|
# coding: utf-8
|
|
|
|
|
|
|
|
|
|
import pprint
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
import six
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PostPaidServerExtendParam(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.
|
|
|
|
|
"""
|
|
|
|
|
|
2020-06-15 07:04:23 +00:00
|
|
|
|
sensitive_list = []
|
|
|
|
|
|
2020-05-18 07:34:40 +00:00
|
|
|
|
openapi_types = {
|
|
|
|
|
'charging_mode': 'int',
|
|
|
|
|
'region_id': 'str',
|
|
|
|
|
'support_auto_recovery': 'bool',
|
|
|
|
|
'enterprise_project_id': 'str',
|
|
|
|
|
'market_type': 'str',
|
|
|
|
|
'spot_price': 'str',
|
|
|
|
|
'disk_prior': 'str'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
attribute_map = {
|
|
|
|
|
'charging_mode': 'chargingMode',
|
|
|
|
|
'region_id': 'regionID',
|
|
|
|
|
'support_auto_recovery': 'support_auto_recovery',
|
|
|
|
|
'enterprise_project_id': 'enterprise_project_id',
|
|
|
|
|
'market_type': 'marketType',
|
|
|
|
|
'spot_price': 'spotPrice',
|
|
|
|
|
'disk_prior': 'diskPrior'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def __init__(self, charging_mode=0, region_id=None, support_auto_recovery=False, enterprise_project_id='0', market_type=None, spot_price=None, disk_prior=None): # noqa: E501
|
|
|
|
|
"""PostPaidServerExtendParam - a model defined in huaweicloud sdk"""
|
|
|
|
|
|
|
|
|
|
self._charging_mode = None
|
|
|
|
|
self._region_id = None
|
|
|
|
|
self._support_auto_recovery = None
|
|
|
|
|
self._enterprise_project_id = None
|
|
|
|
|
self._market_type = None
|
|
|
|
|
self._spot_price = None
|
|
|
|
|
self._disk_prior = None
|
|
|
|
|
self.discriminator = None
|
|
|
|
|
|
|
|
|
|
if charging_mode is not None:
|
|
|
|
|
self.charging_mode = charging_mode
|
|
|
|
|
if region_id is not None:
|
|
|
|
|
self.region_id = region_id
|
|
|
|
|
if support_auto_recovery is not None:
|
|
|
|
|
self.support_auto_recovery = support_auto_recovery
|
|
|
|
|
if enterprise_project_id is not None:
|
|
|
|
|
self.enterprise_project_id = enterprise_project_id
|
|
|
|
|
if market_type is not None:
|
|
|
|
|
self.market_type = market_type
|
|
|
|
|
if spot_price is not None:
|
|
|
|
|
self.spot_price = spot_price
|
|
|
|
|
if disk_prior is not None:
|
|
|
|
|
self.disk_prior = disk_prior
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def charging_mode(self):
|
|
|
|
|
"""Gets the charging_mode of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
计费模式: - 0:按需计费。
|
|
|
|
|
|
|
|
|
|
:return: The charging_mode of this PostPaidServerExtendParam.
|
|
|
|
|
:rtype: int
|
|
|
|
|
"""
|
|
|
|
|
return self._charging_mode
|
|
|
|
|
|
|
|
|
|
@charging_mode.setter
|
|
|
|
|
def charging_mode(self, charging_mode):
|
|
|
|
|
"""Sets the charging_mode of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
计费模式: - 0:按需计费。
|
|
|
|
|
|
|
|
|
|
:param charging_mode: The charging_mode of this PostPaidServerExtendParam.
|
|
|
|
|
:type: int
|
|
|
|
|
"""
|
|
|
|
|
self._charging_mode = charging_mode
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def region_id(self):
|
|
|
|
|
"""Gets the region_id of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
云服务器所在区域ID。 请参考[地区和终端节点](https://developer.huaweicloud.com/endpoint)获取。
|
|
|
|
|
|
|
|
|
|
:return: The region_id of this PostPaidServerExtendParam.
|
|
|
|
|
:rtype: str
|
|
|
|
|
"""
|
|
|
|
|
return self._region_id
|
|
|
|
|
|
|
|
|
|
@region_id.setter
|
|
|
|
|
def region_id(self, region_id):
|
|
|
|
|
"""Sets the region_id of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
云服务器所在区域ID。 请参考[地区和终端节点](https://developer.huaweicloud.com/endpoint)获取。
|
|
|
|
|
|
|
|
|
|
:param region_id: The region_id of this PostPaidServerExtendParam.
|
|
|
|
|
:type: str
|
|
|
|
|
"""
|
|
|
|
|
self._region_id = region_id
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def support_auto_recovery(self):
|
|
|
|
|
"""Gets the support_auto_recovery of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
是否配置弹性云服务器自动恢复的功能。 - “true”:配置该功能 - “false”:不配置该功能 > 说明: > > 此参数为boolean类型,若传入非boolean类型字符,程序将按照【“false”:不配置该功能】方式处理。 > > 当marketType为spot时,不支持该功能。
|
|
|
|
|
|
|
|
|
|
:return: The support_auto_recovery of this PostPaidServerExtendParam.
|
|
|
|
|
:rtype: bool
|
|
|
|
|
"""
|
|
|
|
|
return self._support_auto_recovery
|
|
|
|
|
|
|
|
|
|
@support_auto_recovery.setter
|
|
|
|
|
def support_auto_recovery(self, support_auto_recovery):
|
|
|
|
|
"""Sets the support_auto_recovery of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
是否配置弹性云服务器自动恢复的功能。 - “true”:配置该功能 - “false”:不配置该功能 > 说明: > > 此参数为boolean类型,若传入非boolean类型字符,程序将按照【“false”:不配置该功能】方式处理。 > > 当marketType为spot时,不支持该功能。
|
|
|
|
|
|
|
|
|
|
:param support_auto_recovery: The support_auto_recovery of this PostPaidServerExtendParam.
|
|
|
|
|
:type: bool
|
|
|
|
|
"""
|
|
|
|
|
self._support_auto_recovery = support_auto_recovery
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def enterprise_project_id(self):
|
|
|
|
|
"""Gets the enterprise_project_id of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
企业项目ID。 > 说明: > > 关于企业项目ID的获取及企业项目特性的详细信息,请参见《[企业管理服务用户指南](https://support.huaweicloud.com/usermanual-em/zh-cn_topic_0126101490.html)》。 > > 该字段不传(或传为字符串“0”),则将资源绑定给默认企业项目。
|
|
|
|
|
|
|
|
|
|
:return: The enterprise_project_id of this PostPaidServerExtendParam.
|
|
|
|
|
:rtype: str
|
|
|
|
|
"""
|
|
|
|
|
return self._enterprise_project_id
|
|
|
|
|
|
|
|
|
|
@enterprise_project_id.setter
|
|
|
|
|
def enterprise_project_id(self, enterprise_project_id):
|
|
|
|
|
"""Sets the enterprise_project_id of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
企业项目ID。 > 说明: > > 关于企业项目ID的获取及企业项目特性的详细信息,请参见《[企业管理服务用户指南](https://support.huaweicloud.com/usermanual-em/zh-cn_topic_0126101490.html)》。 > > 该字段不传(或传为字符串“0”),则将资源绑定给默认企业项目。
|
|
|
|
|
|
|
|
|
|
:param enterprise_project_id: The enterprise_project_id of this PostPaidServerExtendParam.
|
|
|
|
|
:type: str
|
|
|
|
|
"""
|
|
|
|
|
self._enterprise_project_id = enterprise_project_id
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def market_type(self):
|
|
|
|
|
"""Gets the market_type of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
创建竞价实例时,需指定该参数的值为“spot”。 > 说明: > > 当chargingMode=0时且marketType=spot时此参数生效。
|
|
|
|
|
|
|
|
|
|
:return: The market_type of this PostPaidServerExtendParam.
|
|
|
|
|
:rtype: str
|
|
|
|
|
"""
|
|
|
|
|
return self._market_type
|
|
|
|
|
|
|
|
|
|
@market_type.setter
|
|
|
|
|
def market_type(self, market_type):
|
|
|
|
|
"""Sets the market_type of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
创建竞价实例时,需指定该参数的值为“spot”。 > 说明: > > 当chargingMode=0时且marketType=spot时此参数生效。
|
|
|
|
|
|
|
|
|
|
:param market_type: The market_type of this PostPaidServerExtendParam.
|
|
|
|
|
:type: str
|
|
|
|
|
"""
|
|
|
|
|
self._market_type = market_type
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def spot_price(self):
|
|
|
|
|
"""Gets the spot_price of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
用户愿意为竞价实例每小时支付的最高价格。 > 说明: > > 仅chargingMode=0且marketType=spot时,该参数设置后生效。 > > 当chargingMode=0且marketType=spot时,如果不传递spotPrice,默认使用按需购买的价格作为竞价。
|
|
|
|
|
|
|
|
|
|
:return: The spot_price of this PostPaidServerExtendParam.
|
|
|
|
|
:rtype: str
|
|
|
|
|
"""
|
|
|
|
|
return self._spot_price
|
|
|
|
|
|
|
|
|
|
@spot_price.setter
|
|
|
|
|
def spot_price(self, spot_price):
|
|
|
|
|
"""Sets the spot_price of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
用户愿意为竞价实例每小时支付的最高价格。 > 说明: > > 仅chargingMode=0且marketType=spot时,该参数设置后生效。 > > 当chargingMode=0且marketType=spot时,如果不传递spotPrice,默认使用按需购买的价格作为竞价。
|
|
|
|
|
|
|
|
|
|
:param spot_price: The spot_price of this PostPaidServerExtendParam.
|
|
|
|
|
:type: str
|
|
|
|
|
"""
|
|
|
|
|
self._spot_price = spot_price
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def disk_prior(self):
|
|
|
|
|
"""Gets the disk_prior of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
是否支持先创建卷,再创建虚拟机。 “true”:配置该功能 “false”:不配置该功能
|
|
|
|
|
|
|
|
|
|
:return: The disk_prior of this PostPaidServerExtendParam.
|
|
|
|
|
:rtype: str
|
|
|
|
|
"""
|
|
|
|
|
return self._disk_prior
|
|
|
|
|
|
|
|
|
|
@disk_prior.setter
|
|
|
|
|
def disk_prior(self, disk_prior):
|
|
|
|
|
"""Sets the disk_prior of this PostPaidServerExtendParam.
|
|
|
|
|
|
|
|
|
|
是否支持先创建卷,再创建虚拟机。 “true”:配置该功能 “false”:不配置该功能
|
|
|
|
|
|
|
|
|
|
:param disk_prior: The disk_prior of this PostPaidServerExtendParam.
|
|
|
|
|
:type: str
|
|
|
|
|
"""
|
|
|
|
|
self._disk_prior = disk_prior
|
|
|
|
|
|
|
|
|
|
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:
|
2020-06-15 07:04:23 +00:00
|
|
|
|
if attr in self.sensitive_list:
|
|
|
|
|
result[attr] = "****"
|
|
|
|
|
else:
|
|
|
|
|
result[attr] = value
|
2020-05-18 07:34:40 +00:00
|
|
|
|
|
|
|
|
|
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, PostPaidServerExtendParam):
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return self.__dict__ == other.__dict__
|
|
|
|
|
|
|
|
|
|
def __ne__(self, other):
|
|
|
|
|
"""Returns true if both objects are not equal"""
|
|
|
|
|
return not self == other
|