ModifyDiskChargeType - 修改云盘的计费方式

更新时间:
复制 MD 格式

将包年包月ECS实例上挂载的数据盘的计费方式在按量付费和包年包月之间进行转换。

接口说明

转换数据盘计费方式前,请仔细阅读转换云盘计费方式

使用该接口时,请注意:

  • 不支持修改挂载在按量付费实例上数据盘的计费方式,按量付费实例仅支持挂载按量付费云盘。

  • 数据盘挂载的实例不能为到期停机状态。

  • 更换计费方式前后的价格差退款会退还到您的原付费方式中,已使用的代金券不退回。

  • 每块云盘成功修改计费方式一次,五分钟内不能再次修改。

  • 开启多重挂载特性的云盘,仅支持按量付费的计费方式,不能转换为包年包月的计费方式。

更换计费方式后,默认自动扣费。您需要确保账户余额充足,否则会生成异常订单,此时只能作废订单。如果您的账户余额不足,可以将参数 AutoPay 置为 false,此时会生成正常的未支付订单,您可以登录阿里云费用与成本后,在我的订单页面支付。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

ecs:ModifyDiskChargeType

update

*Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

请求参数

名称

类型

必填

描述

示例值

InstanceId

string

云盘挂载的实例 ID。

i-bp1i778bq705cvx1****

RegionId

string

实例所属的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

cn-hangzhou

DiskIds

string

云盘 ID 列表,一个带有格式的 JSON Array,最多支持 16 个 ID,用半角逗号(,)隔开。

["d-bp67acfmxazb4ph****", "d-bp67acfmxazb4pi****", … "d-bp67acfmxazb4pj****"]

AutoPay

boolean

是否自动支付。取值范围:

  • true(默认):自动支付。您需要确保账户余额充足,如果账户余额不足会生成异常订单,只能作废订单。

  • false:只生成订单不扣费。如果您的账户余额不足,会生成正常的未支付订单,此订单可登录阿里云费用与成本后,在我的订单页面支付。

true

ClientToken

string

保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且不能超过 64 个字符。更多信息,请参见如何保证幂等性

123e4567-e89b-12d3-a456-426655440000

DiskChargeType

string

云盘计费方式。取值范围:

  • PrePaid(默认):按量付费数据盘转换为包年包月数据盘。

  • PostPaid:包年包月数据盘转换为按量付费数据盘。

说明

转换按量付费云盘为包年包月时,其容量费用计费周期自动与关联的 ECS 实例同步。

PostPaid

返回参数

名称

类型

描述

示例值

object

OrderId

string

生成的订单 ID。

123456****

RequestId

string

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

示例

正常返回示例

JSON格式

{
  "OrderId": "123456****",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized.
400 InvalidInstanceType.ValueNotSupported The specified InstanceType is not supported. 当前不支持您指定的实例规格,请选择其它实例规格。
400 MissingParameter.RegionId RegionId should not be null. 参数 RegionId 不得为空。
400 MissingParameter.InstanceIdNotSupported InstanceId should not be null. 参数 InstanceId 不能为空。
400 ChargeTypeViolation The operation is not permitted due to charge type of the instance. 付费方式不支持该操作,请您检查实例的付费类型是否与该操作冲突。
400 InvalidInstanceId.Released The specified Instance is not exist. 指定的实例不存在,请您检查实例 ID 是否正确。
400 InvalidInstance.PurchaseNotFound The specified Instance has no purchase. 指定的实例无法购买。
400 InvalidInstance.UnPaidOrder The specified Instance has unpaid order. 指定的实例有未支付的订单,请您先支付再进行操作。
400 InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. 指定的 ClientToken 不合法。
400 Account.Arrearage Your account has been in arrears. 账户余额不足,请先充值再操作。
400 Idempotence.SignatureMismatch There is a idempotence signature mismatch between this and last request. 作为和上一个幂等参数相同的请求,其他参数也必须完全相匹配。
400 OrderCreationFailed Order creation failed. Please check your parameters and try again later.
400 Throttling Request was denied due to request throttling. Please try again after 5 minutes.
400 InstanceDowngrade.QuotaExceed Quota of instance downgrade is exceed. 您的实例降配已超额度,无法进行此操作。
400 InvalidInstanceId.NotFound The specified InstanceId does not exist.
400 InvalidDisk.DetachedSystemDisk The specified disk is a detached system disk. This operation is not supported.
400 LastOrderProcessing The previous order is still processing. Please try again later. 上一个订单仍正在处理中,请稍后再试。
400 InvalidAction.WithActiveElasticUpgrade The instance has active Elastic Upgrade.
400 DISK_IN_DEDICATED_BLOCK_STORAGE_CLUSTER The disk in dedicated block storage cluster is not allowed to do this operation.
400 NoPermission.Price The operation requires price permission. Please either apply for permission from your main account or set the parameter AutoPay to true.
400 NoPermission.Refund The operation requires refund permission. Please apply for permission from your main account. 该账号无权限操作退款,主账号需要授权退款相关权限。
400 InvalidOperation.DiskMustAttachedToInstance The specified data disks must have been attached to this instance. 指定的磁盘必须已经挂载到这台实例上。
400 InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). 实例已过期或者欠费,请您续费或者结清后再进行操作。
400 InvalidOrder.Overdue The specified account has overdue orders. 您有欠费账单,不符合购买条件。请先充值结清账单后再购买。
400 IncorrectInstanceStatus The current status of the instance does not support this operation. 当前实例状态不支持此操作。
500 InternalError The request processing has failed due to some unknown error.
403 InvalidInstanceType.ValueNotSupported The specified InstanceType is not supported.
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance.
403 Throttling Request was denied due to request throttling. Please try again after 5 minutes.
403 InvalidInstanceChargeType.NotFound The chargeType of the instance does not support this operation. 该付费类型的实例不支持该操作。
403 InvalidOperation.MultiAttachDisk Multi attach disk does not support this operation. 开启多重挂载特性的云盘不支持该操作。
403 InvalidOperation.UnpaidOrder The specified instance has unpaid orders and does not support the current operation. 指定的实例有未完成支付的订单,不支持当前操作。
403 OperationDenied The specified InstanceType or Zone is not available or not authorized. 指定的实例规格或可用区不可用或者未授权。
404 InvalidRegionId.NotFound The RegionId provided does not exist. 指定的地域不存在,请确认该参数是否正确。
404 PaymentMethodNotFound No billing method has been registered on the account. 您未注册任何计费方式,请注册后重试。
404 InvalidZoneId.NotFound The ZoneId provided does not exist in our records.
404 InvalidRamRole.NotFound The specified parameter "RAMRoleName" does not exist. RAM角色未被授权用于ECS服务
404 InvalidDiskIds.NotFound Some of the specified data disks do not exist. 参数 DiskIds 中的一些数据盘,不存在。
404 InvalidDiskIds.NotPortable The specified DiskId is not portable.
404 InvalidDataDiskSize.ValueNotSupported The specified parameter "Size" is not supported.
404 InvalidAction.NotSupported The specified action is not supported. 不支持指定的 API 操作。
404 InvalidInstanceStatus.NotSupported The status of the specified instance is invalid. 当前实例的状态不支持此操作。
404 InvalidInstanceId.NOT_FOUND The specified instance is not exist. 指定的实例不存在。
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定的实例ID无效。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情