本接口用于对一张或多张预留实例券进行续费,支持您在续费时设置购买时长和自动续费属性。
接口说明
请确保在使用该接口前,已充分了解预留实例券的收费方式和价格。
预留实例券支持手动续费和自动续费两种续费方式,详细信息请参见预留实例券续费说明。
您可以调用 DescribeReservedInstances 查询已购买的预留实例券。
该接口支持开启自动续费,但不支持取消自动续费,您可以通过 ModifyReservedInstanceAutoRenewAttribute 取消自动续费。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:RenewReservedInstances |
create |
*ReservedInstance
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ReservedInstanceId |
array |
否 |
预留实例券 ID。 |
|
|
string |
否 |
预留实例券 ID。您可以调用 DescribeReservedInstances 查看已购买的预留实例券。 单次续费的预留实例券数量最多不超过 10 个。 |
ecsri-2ze53qonjqxg7r**** |
|
| RegionId |
string |
否 |
预留实例券所属的地域 ID。 您可以调用 DescribeRegions 获取最新的阿里云地域列表。 |
cn-hangzhou |
| Period |
integer |
否 |
购买预留实例券的时长。 取值范围:1、3。 默认值:1。 |
1 |
| PeriodUnit |
string |
否 |
购买预留实例券的时长单位。 取值范围:Year。 默认值:Year。 |
Year |
| ClientToken |
string |
否 |
保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且不能超过 64 个字符。更多信息,请参见如何保证幂等性。 |
123e4567-e89b-12d3-a456-426655440000 |
| AutoRenew |
boolean |
否 |
是否要自动续费。
默认值:false。 |
true |
| AutoRenewPeriod |
integer |
否 |
每次自动续费的时长,单位为月。当参数 AutoRenew 取值为 true 时,该参数才生效。 取值范围:12,36。默认值为 12。 |
1 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
8C314443-AF0D-4766-9562-C83B7F1**** |
| ReservedInstanceIdSets |
object |
||
| ReservedInstanceId |
array |
预留实例券 ID 列表。 |
|
|
string |
预留实例券 ID。 |
ecsri-2ze53qonjqxg7r**** |
|
| OrderId |
string |
订单 ID。 |
2023912123**** |
示例
正常返回示例
JSON格式
{
"RequestId": "8C314443-AF0D-4766-9562-C83B7F1****",
"ReservedInstanceIdSets": {
"ReservedInstanceId": [
"ecsri-2ze53qonjqxg7r****"
]
},
"OrderId": "2023912123****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | |
| 400 | InvalidParameter.Conflict | The specified region and cluster do not match. | 指定的地域与指定的集群不匹配。 |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | 指定的标签键参数有误。 |
| 400 | InvalidPeriodUnit.ValueNotSupported | The specified parameter PeriodUnit is not valid. | 参数 PeriodUnit 无效。 |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | 指定的标签值参数有误。 |
| 400 | InvalidChargeType.ValueNotSupported | ChargeType is not valid. | |
| 400 | OperationDenied | The specified InstanceType or Zone is not authorized for current user. | |
| 400 | InvalidPeriod | The specified Period or PeriodUnit is not correct. | |
| 400 | MissingParameter.ReservedInstanceIds | The specified ReservedInstanceIds does not exist. | |
| 400 | InvalidParameter.PeriodUnit | The specified PeriodUnit is invalid. | 指定的PeriodUnit无效 |
| 400 | InvalidParameter.Period | The specified Period is invalid. | |
| 400 | InvalidParameter.ReservedInstanceIds | The specified ReservedInstanceIds is invalid. | |
| 400 | InvalidPeriod.ExceededMaximumExpiration | The specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 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 | Sales of this resource are temporarily suspended in the specified region; please try again later. | 指定的地域暂时关闭了此资源的售卖,请稍后重试。 |
| 403 | NodeControllerUnavailable | The Node Controller is temporarily unavailable. | |
| 403 | InvalidParameter.ResourceOwnerAccount | ResourceOwnerAccount is Invalid. | 指定的 ResourceOwnerAccount 不合法。 |
| 403 | Zone.NotOpen | The specified zone is not granted to you to buy resources yet. | |
| 403 | Zone.NotOnSale | The specified zone is not available for purchase. | 指定可用区已经售罄,请您更换实例规格或者更换地域创建。 |
| 403 | Account.Arrearage | Your account has been in arrears. | |
| 403 | InvalidReservedInstanceName.Malformed | The specified parameter ReservedInstanceName is invalid. | |
| 403 | InvalidParameter.Scope | The specified parameter 'Scope' is invalid. | |
| 403 | InvalidReservedInstanceStatus.ValueNotSupported | ReservedInstance status is not supported. | |
| 403 | InvalidReservedInstanceOfferingType.ValueNotSupported | The OfferingType is not supported. | |
| 403 | InvalidReservedInstanceOfferingClass.ValueNotSupported | The OfferingClass is not supported. | |
| 403 | MissingParameter.ZoneId | The specified zoneId should be not empty. | |
| 403 | MissingParameter.InstanceType | The instanceType should be not empty. | |
| 403 | MissingParameter.ReservedInstanceId | The ids of reservedInstance can not be empty. | |
| 403 | MissingParameter.ReservedInstanceConfiguration | The configurations of reservedInstance can not be empty. | |
| 403 | InvalidParameter.SplitOrMerge | The Many-to-many of modification is not supported. | |
| 403 | MissingParameter.InstanceTypeAndAmountBothEmpty | The instanceType and amount can not be both empty. | |
| 403 | InvalidReservedInstancePlatform.ValueNotSupported | The Platform is not supported. | |
| 403 | InvalidParameter.ReservedInstanceName | The reservedInstanceName is invalid. | reservedInstanceName字段值不合法 |
| 403 | InvalidReservedInstanceZone.ValueNotSupported | The zoneId is not exist. | |
| 403 | InvalidParameter.ValueNotSupported | The instanceTypeFamily of the instance to be changed must be consistent. | |
| 403 | IncorrectInstanceStatus | The status of specified reservedInstance must be active. | 预留实例券状态不正确导致续费失败 |
| 403 | InvalidPlatform.ValueNotSupported | The platform of reservedInstance is invalid. | |
| 403 | InvalidScope.ValueNotSupported | The scope of reservedInstance is invalid, The valid value is Zone or Region. | |
| 403 | InvalidConfiguration.ValueNotSupported | The modification Configuration should not be empty. | |
| 403 | InvalidZoneId.ValueNotSupported | The specified zoneId should be same. | |
| 403 | InvalidParameter | The parameter is invalid.Please check it. | |
| 403 | InvalidInstanceAmount.ValueNotSupported | The instanceAmount is invalid. | |
| 403 | OperationDenied.OnlyModifyName | It is not allowed to modify the ReservedInstanceName only. | 不允许只修改预留实例券的名称。 |
| 403 | InvalidReservedInstanceId.NotFound | The specified parameter ReservedInstanceId is invalid. | |
| 403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | |
| 404 | InvalidZoneId.NotFound | The ZoneId provided does not exist in our records. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。