调用ModifyDedicatedHostsChargeType修改专有宿主机的付费类型。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ModifyDedicatedHostsChargeType |
系统规定参数。取值:ModifyDedicatedHostsChargeType。 |
DedicatedHostIds | String | 是 | ["dh-bp181e5064b5sotr****","dh-bp18064b5sotrr9c****"] |
专有宿主机ID。取值可以由多台专有宿主机ID组成一个JSON数组,最多支持20个ID,ID之间用半角逗号(,)隔开。 |
RegionId | String | 是 | cn-hangzhou |
专有宿主机所属的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 |
Period | Integer | 否 | 1 |
包年包月续费时长。取值范围:
|
PeriodUnit | String | 否 | Month |
续费时长的时间单位,即参数
默认值为Month。 |
DryRun | Boolean | 否 | false |
是否只预检此次请求。取值范围:
默认值为false。 |
AutoPay | Boolean | 否 | false |
是否自动支付。取值范围:
默认值为true。 说明 如果您的支付方式余额不足,可以将参数
AutoPay 置为false ,此时会生成未支付订单,您可以自行支付。
|
DedicatedHostChargeType | String | 否 | PrePaid |
专有宿主机需要修改的目标计费方式。取值范围:
默认值为PrePaid。 |
ClientToken | String | 否 | e4567-e89b-12d3-a456-426655440000 |
保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。 |
DetailFee | Boolean | 否 | false |
包年包月转换为按量付费时,是否返回订单费用详情。 默认值为false。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
OrderId | String | 20413515388**** |
生成的订单ID。 |
RequestId | String | B61C08E5-403A-46A2-96C1-F7B1216DB10C |
请求ID。 |
FeeOfInstances | Array of FeeOfInstance |
订单费用详情。 |
|
FeeOfInstance | |||
InstanceId | String | dh-bp181e5064b5sotrr**** |
专有宿主机ID。 |
Currency | String | CNY |
账单费用货币单位。 中国站:CNY。 国际站:USD。 |
Fee | String | 0 |
费用数值。 |
示例
请求示例
https://ecs.aliyuncs.com/?Action=ModifyDedicatedHostsChargeType
&RegionId=cn-hangzhou
&DedicatedHostIds=["dh-bp181e5064b5sotr****","dh-bpe5064b5sotrr9c****"]
&Period=1
&PeriodUnit=Month
&AutoPay=false
&ClientToken=e4567-e89b-12d3-a456-426655440000
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyDedicatedHostsChargeTypeResponse>
<RequestId>B61C08E5-403A-46A2-96C1-F7B1216DB10C</RequestId>
<OrderId>20413515388****</OrderId>
<FeeOfInstances>
<FeeOfInstance>
<Fee>0</Fee>
<InstanceId>dh-bp181e5064b5sotr****</InstanceId>
<Currency>CNY</Currency>
</FeeOfInstance>
<FeeOfInstance>
<Fee>0</Fee>
<InstanceId>dh-bp181e5064b5sotr****</InstanceId>
<Currency>CNY</Currency>
</FeeOfInstance>
</FeeOfInstances>
</ModifyDedicatedHostsChargeTypeResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B61C08E5-403A-46A2-96C1-F7B1216DB10C",
"OrderId" : "20413515388****",
"FeeOfInstances" : {
"FeeOfInstance" : [ {
"Fee" : "0",
"InstanceId" : "dh-bp181e5064b5sotr****",
"Currency" : "CNY"
}, {
"Fee" : "0",
"InstanceId" : "dh-bp181e5064b5sotr****",
"Currency" : "CNY"
} ]
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter.InstanceIds | The specified InstanceIds are invalid. | 指定的实例无效。 |
400 | InvalidParameter | %s | 无效的参数。 |
400 | InvalidStatus.ValueNotSupported | %s | 该资源当前的状态不支持此操作。 |
400 | InvalidInstanceChargeType.ValueNotSupported | %s | 暂不支持此付款类型,请核对相关信息后重试。 |
400 | ExpiredInstance | The specified instance has expired. | 指定的实例已过期。 |
400 | InstancesIdQuotaExceed | The maximum number of Instances is exceeded. | 超过了实例数的上限。 |
400 | InvalidClientToken.ValueNotSupported | The ClientToken provided is invalid. | 指定的 ClientToken 不合法。 |
400 | ReleaseTimeHaveBeenSet | The specified instance has been set released time. | 指定的实例已设置释放时间。 |
400 | Throttling | Request was denied due to request throttling, please try again after 5 minutes. | 您当前的请求被流控,请5分钟后重试。 |
400 | Throttling | %s | 请求被流控。 |
400 | QuotaExceed.AfterpayInstance | The maximum number of Pay-As-You-Go instances is exceeded: %s | 按量付费的实例库存不足,请减少创建数量。 |
400 | QuotaExceed.RufundVcpu | The maximum number of refund vcpu is exceeded: %s | 退款规则中vCPU配额超过了最大数量限制,具体限制请参见错误信息中%s占位符的实际信息。 |
400 | InvalidPeriod.UnitMismatch | The specified Period must be correlated with the PeriodUnit. | 指定的时长必须与 PeriodUnit 关联。 |
400 | InvalidImageType.NotSupported | %s | 指定的镜像类型无效,请查询本地域是否支持此镜像类型。 |
400 | InvalidSystemDiskCategory.ValueNotSupported | %s | 当前操作不支持此系统磁盘类型。 |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 内部错误,请重试。 |
500 | InternalError | The request processing has failed due to some unknown error. | 内部错误,请重试。 |
403 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | 您指定的实例规格不存在,或者您没有权限操作此规格的实例。 |
403 | InstanceType.Offline | %s | 实例规格因停售、供货不足等原因,不支持该操作。 |
403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | 账号余额不足,请您先充值再进行该操作。 |
403 | Account.Arrearage | Your account has an outstanding payment. | 您的账号存在未支付的款项。 |
403 | InvalidParameter.NotMatch | %s | 您输入的参数无效,请检查参数之间是否冲突。 |
403 | InvalidAction | %s | 操作无效。 |
403 | QuotaExceed.PostPaidDisk | Living postPaid disks quota exceeded. | 按量付费磁盘数量已超出允许数量。 |
403 | ImageNotSupportInstanceType | The specified instanceType is not supported by instance with marketplace image. | 指定的市场镜像不支持该实例规格。 |
403 | InvalidInstanceType.PhasedOut | This instanceType is no longer offered. | 您指定的实例规格已下线不再出售。 |
403 | RealNameAuthenticationError | Your account has not passed the real-name authentication yet. | 您的阿里云账号尚未通过实名认证,请先实名认证后再操作。 |
404 | InvalidInstanceId.NotFound | The specified instanceId does not exist. | 指定的实例ID未找到。 |
访问错误中心查看更多错误码。