Modifies the configurations of a reserved instance, such as the instance type, quantity, and zone, to split, merge, or change the scope of the reserved instance.
Operation description
The region ID of the reserved instance.
You can call the DescribeRegions operation to query the most recent list of regions.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:ModifyReservedInstances | update | *ReservedInstance acs:ecs:{#regionId}:{#accountId}:reservedinstance/{#reservedinstanceId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The IDs of reserved instances. Valid values of N: 1 to 20. | cn-hangzhou |
ReservedInstanceId | array | Yes | The ID of reserved instance N. Valid values of N: 1 to 20. | |
string | Yes | The ID of reserved instance N. Valid values of N: 1 to 20. | ecsri-bp15xx2**** | |
Configuration | array<object> | No | The configurations of reserved instances. | |
object | No | The configurations of reserved instance N. | ||
ReservedInstanceName | string | No | 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 and cannot start with http:// or https://. The name can contain digits, letters, colons (:), underscores (_), and hyphens (-). | testReservedInstanceName |
ZoneId | string | No | The zone ID of reserved instance N. Valid values of N: 1 to 100. This parameter is required when You can call the DescribeZones operation to query the most recent zone list. | cn-hangzhou-i |
Scope | string | Yes | The scope of reserved instance N. Valid values:
Valid values of N: 1 to 100. Default value: Region. | Zone |
InstanceType | string | Yes | 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 Overview of reserved instances.
| ecs.c5.4xlarge |
InstanceAmount | integer | Yes | 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. | 1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7",
"ReservedInstanceIdSets": {
"ReservedInstanceId": [
"{\"ReservedInstanceId\":\"ecsri-bp1cx3****\",\"ecsri-bp15xx2****\"]}"
]
}
}
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 specified 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. | The specified Tag.N.Key parameter is invalid. |
400 | RegionUnauthorized | %s | - |
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. | The specified PeriodUnit parameter is invalid. |
400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | The specified tag value is invalid. |
400 | InvalidChargeType.ValueNotSupported | ChargeType is not valid. | This billing method is not supported. Select another billing method. |
400 | OperationDenied | The specified InstanceType or Zone is not authorized for current user. | - |
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 insufficient. |
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 valid. |
403 | InvalidParameter.ResourceOwnerAccount | ResourceOwnerAccount is Invalid. | The specified ResourceOwnerAccount parameter is invalid. |
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 a different instance type or select a different region or zone. |
403 | InvalidResourceType.NotSupported | %s | - |
403 | InvalidParameter.NotMatch | %s | A specified parameter is invalid. Check whether parameter conflicts exist. |
403 | Account.Arrearage | Your account has been in arrears. | Your account does not have enough balance. Please add funds to your account. |
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 field value is illegal |
403 | InvalidReservedInstanceZone.ValueNotSupported | The zoneId is not exist. | - |
403 | InvalidParameter.ValueNotSupported | The instanceTypeFamily of the instance to be changed must be consistent. | - |
403 | InvalidParameter.ValueNotSupported | The expiration time of the instance to be changed must be consistent. | - |
403 | InvalidParameter.ValueNotSupported | The factor of instanceType is not equal. | - |
403 | InvalidParameter.ValueNotSupported | The offeringClass of instance is not same. | - |
403 | InvalidParameter.ValueNotSupported | The offeringType of instance is not same. | - |
403 | IncorrectInstanceStatus | The status of specified reservedInstance must be active. | - |
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | The resource is in a state that does not support the current operation. |
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. | The reserved instance name cannot be separately modified. |
403 | InvalidReservedInstanceId.NotFound | The specified parameter ReservedInstanceId is invalid. | - |
404 | InvalidZoneId.NotFound | The ZoneId provided does not exist in our records. | The specified zone ID does not exist. |
404 | InvalidZoneId.NotFound | The specified ZoneId does not exist. | The specified zone ID does not exist. |
500 | InternalError | The request processing has failed due to some unknown error. | An internal error has occurred. Try again later. |
500 | InternalError | %s | An internal error has occurred. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-07-28 | API Description Update. The Error code has changed | View Change Details |
2023-05-09 | The Error code has changed | View Change Details |