ModifyInstanceChargeType_云服务器 ECS_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

请确保在使用该接口前,您已充分了解云服务器 ECS的计费方式和产品定价。

调用该接口时,您需要注意:

  • 目标实例的状态必须为运行中Running)或者已停止Stopped),并且无欠费的情况下才能修改计费方式。
  • 更换计费方式后,默认自动扣费。您需要确保账户余额充足,否则会生成异常订单,此时只能作废订单。如果您的账户余额不足,可以将参数AutoPay置为false,此时会生成正常的未支付订单,您可以登录 ECS 管理控制台支付。
  • 包年包月转按量付费
    • 是否支持包年包月转按量付费功能,是根据您的云服务器使用情况而定的。

    • 包年包月实例转按量实例的时候,新计费方式将覆盖实例的整个生命周期。您会收到修改前后的实例计费的价格差退款,退还到您的原付款渠道中,已使用的代金券将不退回。更多信息,请参见退款规则

    • 退款规则:您在一个月内能自由操作的退款额度有限且不累计,消耗完退款额度后,只能等待次月转换计费方式。一次转换计费消耗的退款额度公式为vCPU 数 *(退款天数*24±浮动小时数)

  • 按量付费转包年包月
    • 支持将实例挂载的所有按量付费数据盘同时转换为包年包月数据盘。
    • 如果按量付费实例已经设置了释放时间,则不能调用该接口。

流控信息

请求速率为1000/60(s)。更多流控信息,请前往配额中心查看

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
ecs:ModifyInstanceChargeType
Update
Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

请求参数

字段名称字段详情
InstanceIdsstring

实例 ID。取值可以由多台实例 ID 组成一个 JSON 数组,最多支持 20 个 ID,ID 之间用半角逗号(,)隔开。

示例值:["i-bp67acfmxazb4p****","i-bp67acfmxazb4d****"]参考取值来源:
    RunInstances
    StopInstances
    StartInstances
    RebootInstances
    DescribeInstances
    CreateInstance
    RenewReservedInstances
    ModifyReservedInstances
    GetInstanceScreenshot
    DeregisterManagedInstance
    DetachInstanceRamRole
    AttachInstanceRamRole
    PurchaseReservedInstancesOffering
RegionIdstring

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

示例值:cn-hangzhou参考取值来源:
    DescribeRegions
Periodinteger<int32>

包年包月续费时长。如果 ECS 实例的宿主机为专有宿主机 DDH,则取值范围不能超过专有宿主机的订阅时长。取值范围:展开详情

示例值:1
PeriodUnitstring

续费时长的时间单位,即参数Period的单位。取值范围:展开详情

示例值:Month
IncludeDataDisksboolean

是否将实例挂载的所有按量付费数据盘一起转换为包年包月数据盘。展开详情

示例值:false
DryRunboolean

是否只预检此次请求。取值范围:展开详情

示例值:false
AutoPayboolean

是否自动支付。取值范围:展开详情

示例值:false
InstanceChargeTypestring

实例需要修改的目标计费方式。取值范围:展开详情

示例值:PrePaid参考取值来源:
    DescribeInstances
ClientTokenstring

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

示例值:123e4567-e89b-12d3-a456-426655440000
IsDetailFeeboolean

包年包月转换为按量计费时,是否返回订单费用详情。取值范围:展开详情

示例值:false

返回参数

字段名称字段详情
OrderIdstring

生成的订单 ID。

示例值:20413515388****
RequestIdstring

请求 ID。

示例值:B61C08E5-403A-46A2-96C1-F7B1216DB10C
FeeOfInstancesobject

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
InvalidInstance.UnpaidOrder
%s诊断
400
Throttling
Request was denied due to request throttling, try again later.诊断
400
InstanceHasProcessingConvertOrder
%s诊断
400
InvalidParameter.InstanceIds
The specified InstanceIds are invalid.诊断
400
InvalidParameter
%s诊断
400
InvalidStatus.ValueNotSupported
%s诊断
400
InvalidInstanceChargeType.ValueNotSupported
%s诊断
400
InvalidSpotStrategy
The specified spotStrategy is not valid.诊断
400
ExpiredInstance
The specified instance has expired.诊断
400
InstancesIdQuotaExceed
The maximum number of Instances is exceeded.诊断
400
InvalidClientToken.ValueNotSupported
The ClientToken provided is invalid.诊断
400
InvalidInternetChargeType.ValueNotSupported
%s诊断
400
ReleaseTimeHaveBeenSet
The specified instance has been set released time.诊断
400
QuotaExceed.AfterpayInstance
The maximum number of Pay-As-You-Go instances is exceeded: %s.诊断
400
InvalidParameter.Bandwidth
%s诊断
400
QuotaExceed.RufundVcpu
The maximum number of refund vcpu is exceeded: %s.诊断
400
InvalidPeriod.UnitMismatch
The specified Period must be correlated with the PeriodUnit.诊断
400
InvalidImageType.NotSupported
%s诊断
400
InvalidPeriod.ExceededDedicatedHost
Instance expired date can't exceed dedicated host expired date.诊断
400
InvalidMarketImageChargeType.NotSupport
The specified chargeType of marketImage is unsupported.诊断
400
InvalidSystemDiskCategory.ValueNotSupported
%s诊断
400
InvalidAccountStatus.PayAmountLimitExceeded
Your account is being restricted, due to no default payment method is set or you has not being authorized.诊断
400
InvalidInstance.NotFoundSystemDisk
The specified instance has no system disk.诊断
400
AccountForbidden.ProductCreationLimited
The commodity must be officially operated by Aliyun and in pay-as-you-go billing method.诊断
400
Invalid.PrivatePoolOptions.MatchCriteria
Target mode does not support this operation.诊断
400
InvalidPeriod
The specified period is not valid.诊断
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 as true.诊断
400
NoPermission.Refund
The operation requires refund permission. Please apply for permission from your main account.诊断
400
QuotaExceeded.InternetBandwidth
%s.诊断
403
InvalidInstance.TempBandwidthUpgrade
Cannot switch to Pay-As-You-Go during the period of temporary bandwidth upgrade.诊断
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
InvalidPeriod.ExceededDedicatedHost
Instance expired date can't exceed dedicated host expired date.诊断
403
RealNameAuthenticationError
Your account has not passed the real-name authentication yet.诊断
403
InvalidOperation.NotSupport
Instance on dedicated host not support modify charge type.诊断
403
QuotaExceed.ElasticQuota
No additional quota is available for the specified ECS instance type.诊断
403
PeriodNotSupported.InstanceOnManagedPrivateSpace
The instance on ManagedPrivateSpace is not supported to modify chargeType.诊断
403
UnsupportedIspChargeType
%s诊断
404
InvalidInstanceId.NotFound
The specified instanceId does not exist.诊断
500
InternalError
The request processing has failed due to some unknown error, exception or failure.诊断
500
InvalidInstanceType.ValueUnauthorized
The specified InstanceType is not authorized.诊断

变更历史

变更时间变更内容概要操作
2024-09-27
变更错误码400
2023-07-21
变更错误码500
2021-07-08
变更错误码400

相关示例