All Products
Search
Document Center

Elastic Compute Service:RenewReservedInstances

更新時間:Dec 24, 2024

Renews one or more reserved instances. When you renew reserved instances, you can specify a validity period (renewal period) and whether to enable auto-renewal for the reserved instances.

Operation description

Before you call this operation, make sure that you are familiar with the billing and pricing of reserved instances.

  • You can manually renew reserved instances or enable auto-renewal for reserved instances. For more information, see the Renewal section of the "Reserved instances" topic.
  • You can call the DescribeReservedInstances operation to query the reserved instances that you purchased.
  • You can call this operation to enable auto-renewal for reserved instances but cannot call this operation to disable auto-renewal for reserved instances. To disable auto-renewal for a reserved instance, call the ModifyReservedInstanceAutoRenewAttribute operation.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:RenewReservedInstancescreate
*ReservedInstance
acs:ecs:{#regionId}:{#accountId}:reservedinstance/{#ReservedInstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ReservedInstanceIdarrayNo

The IDs of the reserved instances.

stringNo

The ID of the reserved instance. You can call the DescribeReservedInstances operation to query the IDs of reserved instances that you purchased.

You can specify up to 10 IDs of reserved instances in a single request.

ecsri-2ze53qonjqxg7r****
RegionIdstringNo

The region ID of the reserved instance. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
PeriodintegerNo

The validity period of the reserved instance.

Valid values: 1 and 3.

Default value: 1.

1
PeriodUnitstringNo

The unit of the validity period of the reserved instance.

Set the value to Year.

Year
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-426655440000
AutoRenewbooleanNo

Specifies whether to enable auto-renewal for the reserved instance. Valid values:

  • true
  • false

Default value: false.

true
AutoRenewPeriodintegerNo

The auto-renewal duration. Unit: months. This parameter takes effect only when AutoRenew is set to true.

Valid values: 12 and 36. Default value: 12.

1

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

8C314443-AF0D-4766-9562-C83B7F1****
ReservedInstanceIdSetsarray

The IDs of the reserved instances.

ReservedInstanceIdstring

The ID of the reserved instance.

ecsri-2ze53qonjqxg7r****
OrderIdstring

The order ID.

2023912123****

Examples

Sample success responses

JSONformat

{
  "RequestId": "8C314443-AF0D-4766-9562-C83B7F1****",
  "ReservedInstanceIdSets": {
    "ReservedInstanceId": [
      "ecsri-2ze53qonjqxg7r****"
    ]
  },
  "OrderId": "2023912123****"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidInstanceType.ValueUnauthorizedThe specified InstanceType is not authorized.You are not authorized to use the specified instance type.
400InvalidParameter.ConflictThe specified region and cluster do not match.The specified region and cluster do not correspond to each other.
400InvalidTagKey.MalformedThe specified Tag.n.Key is not valid.The specified Tag.N.Key parameter is invalid.
400RegionUnauthorized%s-
400Zone.NotOnSale%sThe requested resources are unavailable in the specified zone. %s is a variable. An error message is dynamically returned based on call conditions.
400InvalidPeriodUnit.ValueNotSupportedThe specified parameter PeriodUnit is not valid.The specified PeriodUnit parameter is invalid.
400InvalidTagValue.MalformedThe specified Tag.n.Value is not valid.The specified tag value is invalid.
400InvalidChargeType.ValueNotSupportedChargeType is not valid.This billing method is not supported. Select another billing method.
400OperationDeniedThe specified InstanceType or Zone is not authorized for current user.-
400InvalidPeriodThe specified Period or PeriodUnit is not correct.-
400MissingParameter.ReservedInstanceIdsThe specified ReservedInstanceIds does not exist.-
400InvalidParameter.PeriodUnitThe specified PeriodUnit is invalid.-
400InvalidParameter.PeriodThe specified Period is invalid.-
400InvalidParameter.ReservedInstanceIdsThe specified ReservedInstanceIds is invalid.-
400InvalidPeriod.ExceededMaximumExpirationThe specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt.-
403OperationDenied.NoStockThe requested resource is sold out in the specified zone; try other types of resources or other regions and zones.The requested resources are insufficient.
403OperationDeniedSales of this resource are temporarily suspended in the specified region; please try again later.The requested resource is unavailable in the specified region. Try again later.
403NodeControllerUnavailableThe Node Controller is temporarily unavailable.The node controller is unavailable.
403OperationDeniedThe resource is out of usage.The instance is not in the Running state. Start the instance or check whether the specified operation is valid.
403InvalidParameter.ResourceOwnerAccountResourceOwnerAccount is Invalid.The specified ResourceOwnerAccount parameter is invalid.
403Zone.NotOpenThe specified zone is not granted to you to buy resources yet.You are not authorized to purchase resources in the specified zone.
403Zone.NotOnSaleThe specified zone is not available for purchase.The requested resources are unavailable in the specified zone. Try a different instance type or select a different region or zone.
403InvalidResourceType.NotSupported%s-
403InvalidParameter.NotMatch%sA specified parameter is invalid. Check whether parameter conflicts exist.
403Account.ArrearageYour account has been in arrears.Your account does not have enough balance. Please add funds to your account.
403InvalidReservedInstanceName.MalformedThe specified parameter ReservedInstanceName is invalid.-
403InvalidParameter.ScopeThe specified parameter 'Scope' is invalid.-
403InvalidReservedInstanceStatus.ValueNotSupportedReservedInstance status is not supported.-
403InvalidReservedInstanceOfferingType.ValueNotSupportedThe OfferingType is not supported.-
403InvalidReservedInstanceOfferingClass.ValueNotSupportedThe OfferingClass is not supported.-
403MissingParameter.ZoneIdThe specified zoneId should be not empty.-
403MissingParameter.InstanceTypeThe instanceType should be not empty.-
403MissingParameter.ReservedInstanceIdThe ids of reservedInstance can not be empty.-
403MissingParameter.ReservedInstanceConfigurationThe configurations of reservedInstance can not be empty.-
403InvalidParameter.SplitOrMergeThe Many-to-many of modification is not supported.-
403MissingParameter.InstanceTypeAndAmountBothEmptyThe instanceType and amount can not be both empty.-
403InvalidReservedInstancePlatform.ValueNotSupportedThe Platform is not supported.-
403InvalidParameter.ReservedInstanceNameThe reservedInstanceName is invalid.reservedInstanceName field value is illegal
403InvalidReservedInstanceZone.ValueNotSupportedThe zoneId is not exist.-
403InvalidParameter.ValueNotSupportedThe instanceTypeFamily of the instance to be changed must be consistent.-
403InvalidParameter.ValueNotSupportedThe expiration time of the instance to be changed must be consistent.-
403InvalidParameter.ValueNotSupportedThe factor of instanceType is not equal.-
403InvalidParameter.ValueNotSupportedThe offeringClass of instance is not same.-
403InvalidParameter.ValueNotSupportedThe offeringType of instance is not same.-
403IncorrectInstanceStatusThe status of specified reservedInstance must be active.-
403IncorrectInstanceStatusThe current status of the resource does not support this operation.The resource is in a state that does not support the current operation.
403InvalidPlatform.ValueNotSupportedThe platform of reservedInstance is invalid.-
403InvalidScope.ValueNotSupportedThe scope of reservedInstance is invalid, The valid value is Zone or Region.-
403InvalidConfiguration.ValueNotSupportedThe modification Configuration should not be empty.-
403InvalidZoneId.ValueNotSupportedThe specified zoneId should be same.-
403InvalidParameterThe parameter is invalid.Please check it.-
403InvalidInstanceAmount.ValueNotSupportedThe instanceAmount is invalid.-
403OperationDenied.OnlyModifyNameIt is not allowed to modify the ReservedInstanceName only.The reserved instance name cannot be separately modified.
403InvalidReservedInstanceId.NotFoundThe specified parameter ReservedInstanceId is invalid.-
403ChargeTypeViolationThe operation is not permitted due to charge type of the instance.The operation is not supported while the instance is using the current billing method.
404InvalidZoneId.NotFoundThe ZoneId provided does not exist in our records.The specified zone ID does not exist.
404InvalidZoneId.NotFoundThe specified ZoneId does not exist.The specified zone ID does not exist.
500InternalErrorThe request processing has failed due to some unknown error.An internal error has occurred. Try again later.
500InternalError%sAn internal error has occurred.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-11-02The Error code has changed. The request parameters of the API has changedView Change Details
2022-08-12Add OperationView Change Details