You need to enable JavaScript to run this app.
文档中心
云服务器

云服务器

复制全文
下载 pdf
实例
ModifyInstanceChargeType - 修改实例计费模式
复制全文
下载 pdf
ModifyInstanceChargeType - 修改实例计费模式
调用 ModifyInstanceChargeType 接口转换实例的计费方式,支持在按量计费和包年包月之间相互转换。​
注意事项​
  • 按量计费实例转换为包年包月时,系统盘计费方式默认同步转换,数据盘可以选择是否将当前挂载的按量计费数据盘转换为包年包月数据盘。了解更多​
  • 包年包月实例转换为按量计费时,系统盘以及实例上挂载的包年包月数据盘将同步转换为按量计费。了解更多​
  • 本操作不适用于实例上已绑定的公网IP。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:ModifyInstanceChargeType​
要执行的操作,取值:ModifyInstanceChargeType。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
AutoPay boolean 可选 示例值:true​
是否自动支付,取值:​
  • true:自动支付。您需要确保账户余额充足,如果账户余额不足会生成异常订单,计费方式转换失败。​
  • false(默认):仅生成订单但不扣费,您可以在生成订单后,登录火山引擎订单管理页面完成支付。​
说明​
如果您的支付方式余额不足,建议将本参数设置为false。​
​
AutoRenew boolean 可选 示例值:true​
实例到期后是否自动续费,取值:​
  • true:自动续费​
  • false(默认):不自动续费​
说明​
仅当参数InstanceChargeType取值为PrePaid时生效。​
​
AutoRenewPeriod integer 可选 示例值:1​
每次自动续费的时长。​
  • 仅当参数AutoRenew取值为true时,该参数有效,默认值为1。​
  • PeriodUnit取值为Month时,AutoRenewPeriod取值为1、2、3、6、12。​
​
ClientToken string 可选 示例值:333456899ff****​
保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
取值:仅支持ASCII字符,且不能超过64个字符。​
​
DryRun boolean 可选 示例值:false​
是否只预检此次请求,取值:​
  • true:发送检查请求,不会修改计费模式。检查项包括是否填写了必需参数、请求格式、业务限制和ECS库存。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation。​
  • false(默认):发送正常请求,通过检查后直接修改计费模式。​
​
IncludeDataVolumes boolean 可选 示例值:true​
是否将实例上挂载的所有按量计费数据盘转换为包年包月数据盘。​
  • true:转换。​
  • false (默认):不转换。​
​
InstanceChargeType string 可选 示例值:PostPaid​
实例需要修改的目标计费方式,取值:​
  • PrePaid(默认):将按量计费实例转换为包年包月实例。​
  • PostPaid:将包年包月实例转换为按量计费实例。​
​
InstanceIds.N string[] 必选 示例值:InstanceIds.1=i-3thhlu8byl4bwbha****​
实例ID,最多支持20个ID。​
  • 参数 - N:表示实例的序号。​
  • 多个Instance ID之间用&分隔。​
​
Period integer 可选 示例值:2​
购买资源的时长,取值:​
1、2、3、4、5、6、7、8、9、12、24、36​
说明​
当InstanceChargeType取值为PrePaid时,该参数生效且为必选值。​
​
PeriodUnit string 可选 示例值:Month​
购买资源时长的时间单位,即参数Period的单位,取值:​
  • Month(默认)​
  • Week (暂不支持)​
​
​
​
返回参数​
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。​
OrderId string 示例值:Order7021038849342******​
订单号。​
​
​
​
请求示例​
​
GET /?Action=ModifyInstanceChargeType&Version=2020-04-01&InstanceIds.1=i-4ay51iinvo8w4nho****&InstanceChargeType=PrePaid&PeriodUnit=Month&Period=2&AutoPay=True&IncludeDataVolumes=false HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "2021062415303301022514515207C4****",​
"Action": "ModifyInstanceChargeType",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {​
"OrderId": "Order7021038849342******"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
IdempotentParameterMismatch​
The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.​
幂等参数不一致。​
400​
Insufficient.Balance​
The request is denied due to the lack of balance.​
账户余额不足。​
400​
InvalidAffinityGroupInstanceForModifyInstanceChargeType.Unsupported​
The specified affinity group instance does not support modify instance charge type.​
指定的实例为亲和组实例,不支持更改计费方式。​
400​
InvalidArgument​
The specified argument is invalid.​
指定的参数不合法。​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
指定的ClientToken不合法。​
400​
InvalidDedicatedHostInstanceForModifyInstanceChargeType.Unsupported​
The specified instance is on dedicated host, cannot be used to modify instance charge type.​
指定的实例为专有宿主机上的实例,不支持更改计费类型。​
400​
InvalidInstanceChargeType​
The specified InstanceChargeType is invalid.​
指定的实例计费类型不合法。​
400​
InvalidInstanceStatus​
The status of the specified instance does not support this request.​
当前实例的状态不支持此操作。​
400​
InvalidPeriod​
The specified period is not valid.​
指定的计费周期个数不合法。​
400​
InvalidPeriodUnit​
The specified PeriodUnit is not valid, is unsupported, or cannot be used.​
指定的计费周期不合法。​
400​
InvalidScheduledInstanceForModifyInstanceChargeType.Unsupported​
The specified scheduled instance cannot be used to modify instance charge type.​
指定的弹性预约实例不支持更改计费类型。​
400​
InvalidSpotStrategyForModifyInstanceChargeType.Unsupported​
The specified SpotStrategy cannot be used to modify instance charge type.​
指定的实例抢占策略不支持更改计费类型。​
400​
LimitExceeded.MaximumInstanceIds​
You've reached the limit on the number of InstanceIds that you can set.​
指定的InstanceIds数量超过最大限制。​
400​
MissingParameter.InstanceId​
The required parameter InstanceId is not supplied.​
参数实例ID不能为空。​
400​
QuotaExceeded.MaximumGeneralCpus​
You've reached the limit on the number of general instances CPU that you can create, please submit ticket or sign-on to the Console to request an increase in [general_vcpu] quota.​
通用型实例CPU数量配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumGpuBasicNums​
You've reached the limit on the GPU number of GPU-accelerated instances that you can create, please submit ticket or sign-on to the Console to request an increase in [gpu_basic] quota.​
GPU计算型实例卡数配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumHighPerformanceGpus​
You've reached the limit on the GPU number of High Performance Computing GPU instances that you can create, please submit ticket or sign-on to the Console to request an increase in [gpu_high_performance] quota.​
高性能计算GPU型实例卡数配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumInstanceCpus​
You've reached the limit on the number of instance CPU that you can create, please submit ticket to request an increase in quota.​
实例CPU数量配额不足,请提工单申请提高配额。​
400​
QuotaExceeded.MaximumInstanceTypeInstances​
You've reached the limit on the number of instance type instances that you can create, please submit ticket to request an increase in quota.​
规格实例数量配额不足,请提工单申请提高配额。​
400​
QuotaExceeded.MaximumInstances​
You've reached the limit on the number of instances that you can create, please submit ticket to request an increase in quota.​
实例数量配额不足,请提工单申请提高配额。​
400​
QuotaExceeded.MaximumLocalVolumeCpus​
You've reached the limit on the number of local volume instances CPU that you can create, please submit ticket or sign-on to the Console to request an increase in [local_volume_vcpu] quota.​
本地盘实例CPU数量配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumReservedInstanceGeneralCpus​
You've reached the limit on the number of general reserved instances CPU that you can create, please submit ticket or sign-on to the Console to request an increase in [general_vcpu_ri_regional] quota.​
通用型实例地域级RI CPU数量配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumReservedInstanceGpuBasicNums​
You've reached the limit on the GPU number of GPU-accelerated reserved instances that you can create, please submit ticket or sign-on to the Console to request an increase in [gpu_basic_ri_regional] quota.​
GPU计算型实例地域级RI卡数配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumReservedInstanceHighPerformanceGpus​
You've reached the limit on the GPU number of High Performance Computing GPU reserved instances that you can create, please submit ticket or sign-on to the Console to request an increase in [gpu_high_performance_ri_regional] quota.​
高性能计算GPU型实例地域级RI卡数配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumReservedInstanceLocalVolumeCpus​
You've reached the limit on the number of local volume reserved instances CPU that you can create, please submit ticket or sign-on to the Console to request an increase in [local_volume_vcpu_ri_regional] quota.​
本地盘实例地域级RI CPU数量配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumVolumes​
You've reached the limit on the capacity of Volumes that you can create, please submit ticket to request an increase in quota.​
云盘配额不足,请提工单申请提高配额。​
403​
InvalidInstance.RequestForbidden​
Request is forbidden by the server.​
由于您的账户违反了相关规定,指定的资源已不再可以使用,如需恢复服务请提交工单联系服务人员处理。​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
指定的实例不存在。​
412​
DryRunOperation​
Your request has been validated by the DryRunOperation.​
通过“DryRun”校验,您的请求已通过验证。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
先前的幂等请求仍在处理中,请稍后重试。​
412​
InvalidInstance.Expired​
The specified instance has expired.​
实例已过期。​
412​
OperationDenied.AffinityGroupInstance​
The specified operation is denied as your instance is an affinity group instance, and all instanceIds the affinity group must be specified.​
指定的操作被拒绝,因为该实例为亲和组实例,必须指定该亲和组所有的实例ID。​
412​
OperationDenied.ResourceCreatedByOtherService​
The specified operation is denied as your resource is created by other service. You can check system tags to find the service.​
指定的操作被拒绝,因为您的资源被其他服务创建。您可以通过资源的系统标签查询对应服务。​
412​
OperationDenied.ResourceLocked​
The specified operation is denied as your resource is locked for another operation.​
指定的操作被拒绝,因为您的资源已被其他操作锁定。​
500​
Insufficient.InstanceCapacity​
There is not enough capacity to fulfill your request.​
当前资源不足,请稍后重试或选择其它实例规格。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2026.01.13 10:12:57
这个页面对您有帮助吗?
有用
有用
无用
无用