RenewInstance - 续费实例

更新时间:
复制 MD 格式

本接口用于续费一台包年包月的 ECS 实例,支持您设置续费时长或者续费至统一到期日。

接口说明

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

  • 请确保您的账号余额或信用额度充足。

  • 仅支持包年包月的实例,按量付费的实例调用该接口会报错。

  • 续费时长参数(PeriodPeriodUnit)与统一到期日参数(ExpectedRenewDay)必须指定其中之一,但不能同时设置。

调试

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

调试

授权信息

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

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

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

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

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

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

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

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

操作

访问级别

资源类型

条件关键字

关联操作

ecs:RenewInstance

update

*Instance

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

请求参数

名称

类型

必填

描述

示例值

ClientToken

string

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

0c593ea1-3bea-11e9-b96b-88e9fe637760

InstanceId

string

需要续费的实例 ID。

i-bp67acfmxazb4p****

Period

integer

包年包月续费时长。一旦指定了DedicatedHostId,则取值范围不能超过专有宿主机的订阅时长。取值范围:

  • PeriodUnit=Week 时,Period 取值:1、2、3、4。

  • PeriodUnit=Month 时,Period 取值:1、2、3、4、5、6、7、8、9、12、24、36、48、60。

说明

您必须指定续费时长参数(PeriodPeriodUnit)或统一到期日参数(ExpectedRenewDay)的其中一个,但不能同时设置。

1

PeriodUnit

string

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

  • Week。

  • Month。

默认值:Month。

Month

ExpectedRenewDay

integer

用于续费实例至统一到期日。取值范围:1~28。

使用该参数,您需要设置 ECS 实例统一到期日,该参数值必须与您已设置的统一到期日保持一致,否则将调用失败。

说明

您必须指定续费时长参数(PeriodPeriodUnit)或统一到期日参数(ExpectedRenewDay)的其中一个,但不能同时设置。

5

返回参数

名称

类型

描述

示例值

object

OrderId

string

订单 ID。

1234567890

RequestId

string

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

示例

正常返回示例

JSON格式

{
  "OrderId": "1234567890",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is not valid. 暂不支持指定的网络付费类型的实例,请确认相关参数是否正确。
400 InvalidInstanceType.NotSupported The specified InstanceType is not Supported.
400 InvalidParameter The specified parameter "InternetMaxBandwidthOut" is not valid.
400 InvalidInstanceChargeType.NotFound The InstanceChargeType does not exist in our records. 指定的实例计费方式不存在。
400 InvalidRebootTime.Malformed The specified RebootTime is not valid.
400 InvalidRebootTime.ValueNotSupported The specified RebootTime is out of the permitted range. 指定的重启时间超出取值范围。
400 IdempotenceParamNotMatch Request uses a client token in a previous request but is not identical to that request. 与相同 ClientToken 的请求参数不符合。
400 InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. 指定的 ClientToken 不合法。
400 InvalidInstanceType.ValueNotSupported The specified InstanceType does not exist or beyond the permitted range. 您指定的实例规格不存在,或者您没有权限操作此规格的实例。
400 InvalidInstanceType.codeUnauthorized The specified InstanceType is not authorized. 指定的 InstanceType 不合法。
400 InvalidInternetChargeType.InstanceNotSupported The specified instance which is in vpc is not support the parameter InternetChargeType. 指定的 VPC 网络实例不支持指定的网络计费方式。
400 InvalidPeriod The specified period is not valid. 指定的时段不合法。
400 MissingParamter The specified parameter "Period" is not null. 操作中缺少了必要的参数 "Period"
400 Upgrade.NotSupported Upgrade operation is not supported. 升级操作不合法。
400 OperationDenied Specified instance is in VPC. 指定实例存在于 VPC。
400 InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized.
400 DependencyViolation.InstanceType Current instancetype cannot be changed to the specified one. 当前实例规格不能更改为指定规格。
400 InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid. 参数 PeriodUnit 无效。
400 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist. 指定的专有宿主机不存在。
400 InvalidDedicatedHostStatus.NotSupport Operation denied due to dedicated host status. 专有宿主机当前的状态不支持此操作。
400 IncorrectDedicatedHostStatus The current status of the resource does not support this operation. 当前资源的状态不支持此操作。
400 InvalidPeriod.ExceededDedicatedHost Instance expired date can't exceed dedicated host expired date.
400 InvalidStatus.Upgrading The instance is upgrading; please try again later. 实例正在升级,请稍后重试。
400 InvalidPeriod.ExceededMaximumExpirationDate The specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt. 指定的续订期限不能超过最大有效期限。我们建议您尝试在下次尝试时缩短续订时间。
400 LastOrderProcessing The previous order is still processing, please try again later. 订单正在处理中,稍后重试。
400 Idempotence.Processing The previous request is still processing, please try again later. 请求正在处理中,稍后重试。
400 InvalidLoanOrderStatus.Uncompleted Any unpaid order must be cancelled before you try this action again. The scheduled unpaid order is a loan order that cannot be auto cancelled. For more information, visit the loan management center.
400 OperationDenied.UnfinishedOrder The current instance has unfinished refundOrder, this operation is denied. 实例存在未完成的退款订单,请耐心等待,稍后重试。
400 InvalidPeriod.NotFound The specified period and expectedRenewDay cannot both be empty.
400 InvalidExpectedRenewDay.StarterPackageNotSupported The specified starterPackage cannot support renew with expectedRenewDay.
400 InvalidParam.ExpectedRenewDay The specified param ExpectedRenewDay is not valid.
400 QuotaExceed.AlignInstance The maximum number of align operations is exceeded.
400 InvalidExpectedRenewDay.Conflict The specified expectedRenewDay is in conflict with period.
400 InvalidExpectedRenewDay.ValueNotSupported The specified parameter ExpectedRenewDay is not valid.
400 OperationDenied.AbnormalInstanceInfo The current renewable operation is not supported due to abnormal information of the instance, please submit ticket to process.
400 NoPermission.Price The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. 该操作需要价格权限。请向您的主账户申请权限,或将参数AutoPay设置为true进行自动支付。
400 InvalidOperation.ClassicNetworkTypeNotSupported The classic network instance does not support this operation. 抱歉,您续费的基于经典网络架构的实例已无法续费,需要迁移至专有网络进行正常续费操作。
500 InternalError The request processing has failed due to some unknown error.
403 ChargeTypeViolation The operation is not permitted due to charge type of the instance.
403 Diskcategory.Mismatch The disk specified to convert to portable is not allowed due to the disk category does not support. 由于磁盘种类限制,指定的磁盘不能转换为可卸载磁盘。
403 IncorrectInstanceStatus The current status of the resource does not support this operation.
403 InstanceSpecModification.NotEffective The specified instance has been reserved for making a spec modification and not taken effective in the current contract period. 指定的实例因规格调整被保留,在当前合同期内无法生效。
403 LastTokenProcessing The last token request is processing.
403 Instance.UnPaidOrder The specified instance has unpaid order.
403 InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. 实例被安全锁定。
403 InvalidDisk.NotAllowed The specified disk is not allowed to be converted to portable.
403 InstanceTypeNotSupported The specified zone does not offer the specified instancetype.
403 InvalidChargeType.NotSupported The chargeType of the instance does not support this operation. 该付费类型的实例不支持该操作。
403 OperationDenied.NoStock The requested resource is sold out in the specified zone, try other types of resources or other regions and zones. 请求的资源在指定的可用区已售罄,请您更换实例规格或者可用区重试。
403 OperationDenied.ImageNotValid The specified marketplace image is not authorized. Please verify the marketplace image authorization and try again.
403 InvalidPeriod.StarterPackage This instance was created by using a Starter Package plan and can only be renewed monthly, not yearly. 参加了入门级套餐活动的实例,只能设置成每月自动续费。
403 RenewDateNotSupported.StarterPackage This instance was created by using a Starter Package plan and can only be renewed three days before it expires.
403 PrePaidInstance.Expired The prePaid instance has expired. 包年包月实例已到期。
404 InvalidDiskId.NotFound The specified disk does not exist. 指定的磁盘不存在。请您检查磁盘 ID 是否正确。
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定的实例ID无效。

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

变更历史

更多信息,参考变更详情