全部产品
Search
文档中心

云服务器 ECS:RenewInstance - 续费一台包年包月ECS实例

更新时间:Mar 19, 2024

调用RenewInstance续费一台包年包月ECS实例。

接口说明

  • 请确保在使用该接口前,您已充分了解云服务器 ECS的计费方式和产品定价。
  • 仅支持为包年包月 ECS 实例续费时长或者续费至统一到期日。
  • 续费实例的时长和续费实例至统一到期日的操作不能同步执行,即续费时长参数(PeriodPeriodUnit)与统一到期日参数(ExpectedRenewDay)必须指定其中之一,但不能同时设置。
  • 您的账号必须支持信用支付。

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ecs:RenewInstanceWrite
  • Instance
    acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}
  • ecs:tag

请求参数

名称类型必填描述示例值
ClientTokenstring

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

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

需要续费的实例 ID。

i-bp67acfmxazb4p****
Periodinteger

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

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

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

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

Month。

默认值:Month。

Month
ExpectedRenewDayinteger

统一到期日。该参数值必须与您已设置的统一到期日保持一致,否则将调用失败。指定该参数后,您的实例将续费至统一到期日。取值范围:1~28。

关于统一到期日功能的限制说明,请参见统一实例到期日

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

返回参数

名称类型描述示例值
object
OrderIdstring

订单 ID。

1234567890
RequestIdstring

请求 ID。

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

示例

正常返回示例

JSON格式

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

错误码

HTTP status code错误码错误信息描述
400InvalidInternetChargeType.ValueNotSupportedThe specified InternetChargeType is not valid.暂不支持指定的网络付费类型的实例,请确认相关参数是否正确。
400InvalidInstanceType.NotSupportedThe specified InstanceType is not Supported.不支持指定的InstanceType。
400InvalidParameterThe specified parameter "InternetMaxBandwidthOut" is not valid.-
400InvalidInstanceChargeType.NotFoundThe InstanceChargeType does not exist in our records.指定的实例计费方式不存在。
400InvalidRebootTime.MalformedThe specified RebootTime is not valid.指定的 RebootTime 不合法。
400InvalidRebootTime.ValueNotSupportedThe specified RebootTime is out of the permitted range.指定的重启时间超出取值范围。
400IdempotenceParamNotMatchRequest uses a client token in a previous request but is not identical to that request.与相同 ClientToken 的请求参数不符合。
400InvalidClientToken.ValueNotSupportedThe ClientToken provided is invalid.指定的 ClientToken 不合法。
400InvalidInstanceType.ValueNotSupportedThe specified InstanceType does not exist or beyond the permitted range.您指定的实例规格不存在,或者您没有权限操作此规格的实例。
400InvalidInstanceType.codeUnauthorizedThe specified InstanceType is not authorized.指定的 InstanceType 不合法。
400InvalidInternetChargeType.InstanceNotSupportedThe specified instance which is in vpc is not support the parameter InternetChargeType.指定的 VPC 网络实例不支持指定的网络计费方式。
400InvalidPeriodThe specified period is not valid.指定的时段不合法。
400MissingParamterThe specified parameter "Period" is not null.-
400Upgrade.NotSupportedUpgrade operation is not supported.升级操作不合法。
400OperationDeniedSpecified instance is in VPC.指定实例存在于 VPC。
400InvalidInstanceType.ValueUnauthorizedThe specified InstanceType is not authorized.指定的实例规格未授权使用。
400InvalidParameterThe specified parameter " InternetMaxBandwidthOut " is not valid.-
400DependencyViolation.InstanceTypeCurrent instancetype cannot be changed to the specified one.当前实例规格不能更改为指定规格。
400InvalidPeriodUnit.ValueNotSupportedThe specified parameter PeriodUnit is not valid.参数 PeriodUnit 无效。
400InvalidDedicatedHostId.NotFoundThe specified DedicatedHostId does not exist.指定的专有宿主机不存在。
400InvalidDedicatedHostStatus.NotSupportOperation denied due to dedicated host status.专有宿主机当前的状态不支持此操作。
400IncorrectDedicatedHostStatusThe current status of the resource does not support this operation.当前资源的状态不支持此操作。
400InvalidPeriod.ExceededDedicatedHostInstance expired date can't exceed dedicated host expired date.-
400InvalidStatus.UpgradingThe instance is upgrading; please try again later.实例正在升级,请稍后重试。
400InvalidPeriod.ExceededMaximumExpirationDateThe specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt.指定的续订期限不能超过最大有效期限。我们建议您尝试在下次尝试时缩短续订时间。
400LastOrderProcessingThe previous order is still processing, please try again later.订单正在处理中,稍后重试。
400Idempotence.ProcessingThe previous request is still processing, please try again later.请求正在处理中,稍后重试。
400OperationDeniedThe current user does not support this operation.您使用的账号暂不支持此操作。
400InvalidLoanOrderStatus.UncompletedAny 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.-
400OperationDenied.UnfinishedOrderThe current instance has unfinished refundOrder, this operation is denied.实例存在未完成的退款订单,请耐心等待,稍后重试。
400InvalidPeriod.NotFoundThe specified period and expectedRenewDay cannot both be empty.-
400InvalidExpectedRenewDay.StarterPackageNotSupportedThe specified starterPackage cannot support renew with expectedRenewDay.-
400InvalidParam.ExpectedRenewDayThe specified param ExpectedRenewDay is not valid.-
400QuotaExceed.AlignInstanceThe maximum number of align operations is exceeded.-
400InvalidExpectedRenewDay.ConflictThe specified expectedRenewDay is in conflict with period.-
400InvalidExpectedRenewDay.ConflictThe specified expectedRenewDay is in conflict with periodUnit.-
400InvalidExpectedRenewDay.ValueNotSupportedThe specified parameter ExpectedRenewDay is not valid.-
400OperationDenied.AbnormalInstanceInfoThe current renewable operation is not supported due to abnormal information of the instance, please submit ticket to process.-
400NoPermission.PriceThe operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true.-
403ChargeTypeViolationThe operation is not permitted due to charge type of the instance.付费方式不支持该操作,请您检查实例的付费类型是否与该操作冲突。
403Diskcategory.MismatchThe disk specified to convert to portable is not allowed due to the disk category does not support.由于磁盘种类限制,指定的磁盘不能转换为可卸载磁盘。
403IncorrectInstanceStatusThe current status of the resource does not support this operation.该资源目前的状态不支持此操作。
403InstanceSpecModification.NotEffectiveThe specified instance has been reserved for making a spec modification and not taken effective in the current contract period.指定的实例因规格调整被保留,在当前合同期内无法生效。
403LastTokenProcessingThe last token request is processing.正在处理上一条令牌请求,请您稍后再试。
403Instance.UnPaidOrderThe specified instance has unpaid order.该实例有未完成的账单。
403InstanceLockedForSecurityThe specified operation is denied as your instance is locked for security reasons.实例被安全锁定。
403InvalidDisk.NotAllowedThe specified disk is not allowed to be converted to portable.指定的磁盘不允许转换为可卸载磁盘。
403InstanceTypeNotSupportedThe specified zone does not offer the specified instancetype.指定的可用区不支持指定的实例规格。
403InvalidChargeType.NotSupportedThe chargeType of the instance does not support this operation.该付费类型的实例不支持该操作。
403OperationDenied.NoStockThe requested resource is sold out in the specified zone, try other types of resources or other regions and zones.请求的资源在指定的可用区已售罄,请您更换实例规格或者可用区重试。
403OperationDenied.ImageNotValidThe specified image is not authorized.您没有使用此镜像的权限。
403OperationDenied.NoStockThe resource is out of usage.该实例不在运行状态,请您启动实例或检查操作是否合理。
403InvalidPeriod.StarterPackageThis instance was created by using a Starter Package plan and can only be renewed monthly, not yearly.参加了入门级套餐活动的实例,只能设置成每月自动续费。
403RenewDateNotSupported.StarterPackageThis instance was created by using a Starter Package plan and can only be renewed three days before it expires.-
404InvalidDiskId.NotFoundThe specified disk does not exist.指定的磁盘不存在。请您检查磁盘 ID 是否正确。
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.指定的实例ID未找到。
500InternalErrorThe request processing has failed due to some unknown error.内部错误,请重试。

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

变更历史

变更时间变更内容概要操作
2022-08-24OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    错误码 403 变更
    删除错误码:404
    删除错误码:500