Splits, merges, or modifies reserved instances.

Usage notes

Take note of the following items:

  • For information about limits on reserved instances, see the "Limits" section in Overview.
  • Before you call this operation to split a reserved instance, make sure that you are familiar with the limits on splitting a reserved instance. For more information, see Split a reserved instance.
  • Before you call this operation to merge reserved instances, make sure that you are familiar with the limits on merging reserved instances. For more information, see Merge reserved instances.
  • Before you call this operation to modify a reserved instance, make sure that you are familiar with the limits and methods of modifying a reserved instance. For more information, see Modify a reserved instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyReservedInstances

The operation that you want to perform. Set the value to ModifyReservedInstances.

RegionId String Yes cn-hangzhou

The region ID of the reserved instance.

You can call the DescribeRegions operation to query the most recent region list.

ReservedInstanceId.N String No ecsri-bp15xx2****

The ID of reserved instance N. Valid values of N: 1 to 20.

Configuration.N.ReservedInstanceName String No testReservedInstanceName

The name of reserved instance N. Valid values of N: 1 to 100.

The name must be 2 to 128 characters in length. The name must start with a letter but cannot start with http:// or https://. The name can contain digits, letters, colons (:), underscores (_), and hyphens (-).

Configuration.N.ZoneId String No cn-hangzhou-i

The zone ID of reserved instance N. Valid values of N: 1 to 100.

This parameter is required when Scope is set to Zone.

You can call the DescribeZones operation to query the most recent zone list.

Configuration.N.Scope String Yes Zone

The scope of reserved instance N. Valid values:

  • Region
  • Zone

Valid values of N: 1 to 100.

Default value: Region.

Configuration.N.InstanceType String Yes ecs.c5.4xlarge

The instance type that reserved instance N can match. Valid values of N: 1 to 100.

Note The applicable instance types are continuously updated. For more information, see the "Attributes" section in Reserved instance overview.
Configuration.N.InstanceAmount Integer Yes 1

The number of pay-as-you-go instances of the same instance type that reserved instance N can match. The value of this parameter must be greater than or equal to 1. Valid values of N: 1 to 100.

Response parameters

Parameter Type Example Description
RequestId String ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7

The request ID.

ReservedInstanceIdSets Array of String {"ReservedInstanceId":"ecsri-bp1cx3****","ecsri-bp15xx2****"]}

The IDs of the reserved instances.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=ModifyReservedInstances
&RegionId=cn-hangzhou
&ReservedInstanceId.1=ecsri-bp1cx3****
&ReservedInstanceId.2=ecsri-bp15xx2****
&Configuration.1.InstanceType=ecs.c5.4xlarge
&Configuration.1.Scope=Zone
&Configuration.2.InstanceType=ecs.g5.4xlarge
&Configuration.2.Scope=Region
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyReservedInstancesResponse>
    <ReservedInstanceIdSets>
        <ReservedInstanceId>ecsri-bp1cx3****</ReservedInstanceId>
        <ReservedInstanceId>ecsri-bp15xx2****</ReservedInstanceId>
    </ReservedInstanceIdSets>
    <RequestId>ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7</RequestId>
</ModifyReservedInstancesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "ReservedInstanceIdSets" : {
    "ReservedInstanceId" : [ "ecsri-bp1cx3****", "ecsri-bp15xx2****" ]
  },
  "RequestId" : "ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized. You are not authorized to use the instance type.
400 InvalidParameter.Conflict The specified region and cluster do not match. The specified region and cluster do not correspond to each other.
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. Invalid Tag.N.Key value.
400 RegionUnauthorized %s You are not authorized to perform the operation in the region. %s is a variable. An error message is dynamically returned based on call conditions.
400 Zone.NotOnSale %s The requested resources are unavailable in the specified zone. %s is a variable. An error message is dynamically returned based on call conditions.
400 InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid. Invalid PeriodUnit value.
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. Invalid Tag.N.Value value.
400 InvalidChargeType.ValueNotSupported ChargeType is not valid. This billing method is not supported. Select another billing method.
403 OperationDenied.NoStock The requested resource is sold out in the specified zone; try other types of resources or other regions and zones. The requested resources are unavailable in the specified zone. Try another instance type or zone. You can call the DescribeZones operation to query available resources.
403 OperationDenied Sales 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.
403 NodeControllerUnavailable The Node Controller is temporarily unavailable. The node controller is unavailable.
403 OperationDenied The resource is out of usage. The instance is not in the Running state. Start the instance or check whether the specified operation is invalid.
403 InvalidParameter.ResourceOwnerAccount ResourceOwnerAccount is Invalid. Invalid ResourceOwnerAccount value.
403 Zone.NotOpen The specified zone is not granted to you to buy resources yet. You are not authorized to purchase resources in the specified zone.
403 Zone.NotOnSale The specified zone is not available for purchase. The requested resources are unavailable in the specified zone. Try other instance types or select other regions or zones.
403 InvalidParameter.NotMatch %s Invalid parameter value. Check whether parameter conflicts exist.
403 Account.Arrearage Your account has been in arrears. The account balance is insufficient. Add funds to the account and try again.
403 IncorrectInstanceStatus The current status of the resource does not support this operation. This operation cannot be performed on the resource in the current state.
403 OperationDenied.OnlyModifyName It is not allowed to modify the ReservedInstanceName only. The reserved instance name cannot be separately modified.
500 InternalError The request processing has failed due to some unknown error. An internal error occurred. Try again later.
500 InternalError %s An internal error occurred.

For a list of error codes, see Service error codes.