Queries available instance types or system disk categories in a specific zone before you change the instance type or system disk category of an Elastic Compute Service (ECS) instance.
Operation description
Examples of common scenarios in which this operation is used:
Example 1: Query the instance types to which you can change the instance type of an instance.
Query the instance types to which you can change the instance type of the i-bp67acfmxazb4p**** instance and the inventory of the queried instance types in the zone in which the instance resides.
http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&RegionId=cn-hangzhou
&ResourceId=i-bp67acfmxazb4p****
&DestinationResource=InstanceType
&OperationType=Upgrade
&<Common request parameters>
Example 2: Query the instance types to which you can change the instance type of an instance after a system disk category change.
Query the instance types to which you can change the instance type of the i-bp67acfmxazb4p**** instance after a system disk category change and the inventory of the queried instance types in the zone in which the instance resides.
http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&RegionId=cn-hangzhou
&ResourceId=i-bp67acfmxazb4p****
&DestinationResource=InstanceType
&OperationType=Upgrade
&Conditions.0=DiskCategory
&<Common request parameters>
Example 3: Query the system disk categories supported by the instance type to which you want to change the instance type of an instance.
Query the system disk categories supported by the instance type to which you want to change the instance type of the i-bp67acfmxazb4p**** instance and the inventory of the disk categories in the zone in which the instance resides. In this example, the ecs.g7.large instance type is used. To change to the instance type, you must change the system disk category of the instance to a category supported by the instance type.
You can call this operation as described in Example 2 to query the instance types to which you can change the instance type of an instance.
http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&RegionId=cn-hangzhou
&ResourceId=i-bp67acfmxazb4p****
&DestinationResource=SystemDisk
&OperationType=Upgrade
&InstanceType=ecs.g7.large
&<Common request parameters>
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeResourcesModification |
get |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the instance for which you want to change the instance type or system disk category. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| ResourceId |
string |
Yes |
The ID of the instance for which you want to change the instance type or system disk category. |
i-bp67acfmxazb4p**** |
| MigrateAcrossZone |
boolean |
No |
Specifies whether cross-cluster instance type upgrades are supported. Valid values:
Default value: false. When MigrateAcrossZone is set to true and you upgrade the instance type of an instance based on the returned information, take note of the following items:
|
true |
| DestinationResource |
string |
Yes |
The resource type that you want to change. Valid values:
|
InstanceType |
| OperationType |
string |
No |
The operation of changing resource configurations.
Default value: Upgrade. |
Upgrade |
| InstanceType |
string |
No |
The instance type to which you want to change the instance type of the instance. For more information, see Overview of instance families. You can also call the DescribeInstanceTypes operation to query the most recent instance type list. If you set the DestinationResource parameter to SystemDisk, you must specify the InstanceType parameter. In this case, this operation queries the system disk categories supported by the specified instance type. |
ecs.g7.large |
| Cores |
integer |
No |
The number of vCPUs of the instance type. For information about the valid values, see Overview of instance families. This parameter is valid only when the DestinationResource parameter is set to InstanceType. |
2 |
| Memory |
number |
No |
The memory size of the instance type. Unit: GiB. For information about the valid values, see Overview of instance families. This parameter is valid only when the DestinationResource parameter is set to InstanceType. |
8.0 |
| ZoneId |
string |
No |
The ID of the destination zone to which you want to migrate the instance. If you want to change the instance type across zones, you must specify this parameter. |
cn-hangzhou-e |
| Conditions |
array |
No |
The conditions. |
|
|
string |
No |
Set the value to DiskCategory. When you set this parameter to DiskCategory, this operation queries the instance types to which you can change the instance type of the instance after a system disk category change. This parameter is valid only when the DestinationResource parameter is set to InstanceType. |
DiskCategory |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| AvailableZones |
object |
||
| AvailableZone |
array<object> |
The information about the queried zones. |
|
|
array<object> |
|||
| ZoneId |
string |
The zone ID. |
cn-hangzhou-e |
| Status |
string |
The state of the resource. Valid values:
|
Available |
| StatusCategory |
string |
The category of the resource based on stock status. Valid values:
|
WithStock |
| RegionId |
string |
The region ID. |
cn-hangzhou |
| AvailableResources |
object |
||
| AvailableResource |
array<object> |
The resources that are available in the zone. |
|
|
array<object> |
|||
| Type |
string |
The resource type. Valid values:
|
InstanceType |
| SupportedResources |
object |
||
| SupportedResource |
array<object> |
The information about the supported resources. |
|
|
object |
|||
| Status |
string |
The state of the resource. Valid values:
|
Available |
| Value |
string |
The resource type. |
ecs.g7.large |
| Max |
integer |
The maximum disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
2048 |
| Unit |
string |
The unit of the disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
GiB |
| StatusCategory |
string |
The category of the resource based on stock status. Valid values:
|
WithStock |
| Min |
integer |
The minimum disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
20 |
| ConditionSupportedResources |
object |
||
| ConditionSupportedResource |
array<object> |
The resource types that resources can be changed to after the resources meet specified conditions. If the conditions are met, you can change the current resource to a resource in the list. |
|
|
array<object> |
The resource types that resources can be changed to after the resources meet specified conditions. |
||
| Conditions |
object |
||
| Condition |
array<object> |
The conditions. |
|
|
object |
The conditions. |
||
| Key |
string |
The condition name. Valid value: DiskCategory, which indicates a disk category change. |
DiskCategory |
| Status |
string |
The stock state of the resource. Valid values:
|
Available |
| Value |
string |
The resource type. |
ecs.g5.large |
| Max |
integer |
The maximum disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
2048 |
| Unit |
string |
The unit of the disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
GiB |
| StatusCategory |
string |
The category of the resource based on stock status. Valid values:
|
WithStock |
| Min |
integer |
The minimum disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
20 |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"AvailableZones": {
"AvailableZone": [
{
"ZoneId": "cn-hangzhou-e",
"Status": "Available",
"StatusCategory": "WithStock",
"RegionId": "cn-hangzhou",
"AvailableResources": {
"AvailableResource": [
{
"Type": "InstanceType",
"SupportedResources": {
"SupportedResource": [
{
"Status": "Available",
"Value": "ecs.g7.large",
"Max": 2048,
"Unit": "GiB",
"StatusCategory": "WithStock",
"Min": 20
}
]
},
"ConditionSupportedResources": {
"ConditionSupportedResource": [
{
"Conditions": {
"Condition": [
{
"Key": "DiskCategory"
}
]
},
"Status": "Available",
"Value": "ecs.g5.large",
"Max": 2048,
"Unit": "GiB",
"StatusCategory": "WithStock",
"Min": 20
}
]
}
}
]
}
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Invalid.OperationType | The specified operationType is not valid. | The specified OperationType parameter is invalid. |
| 400 | Invalid.Param | The input parameter DestinationResource that is mandatory for processing this request is not supplied. | The specified DestinationResource parameter is invalid. |
| 400 | Invalid.InstanceChargeType | The specified InstanceChargeType is not valid. | The specified InstanceChargeType parameter is invalid. |
| 400 | InvalidCondition.Malformed | The specified Condition is not valid. | |
| 403 | InvalidDedicatedHostId.NotFound | The specified DedicatedHostId does not exist in our records. | |
| 403 | InvalidParam.TypeAndCpuMem.Conflict | The specified 'InstanceType' and 'Cores','Memory' are not blank at the same time. | |
| 403 | InvalidParam.Cores | The specified parameter 'Cores' should be empty. | The specified parameter 'Cores' should be empty. |
| 403 | InvalidParam.Memory | The specified parameter 'Memory' should be empty. | The specified parameter 'Memory' should be empty. |
| 403 | InvalidParameter.ResourceOwnerId | The specified parameter ResourceOwnerId is not available anymore. | |
| 404 | Invalid.RegionId | The specified RegionId does not exist. | The specified RegionId parameter is invalid. |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
| 404 | Unavailable.Regions | The available regions does not exists. | The available region does not exist. |
| 404 | Invalid.ResourceType | The ResourceType provided does not exist in our records. | The specified resource type is invalid. |
| 404 | Invalid.DestinationResource | The specified DestinationResource is not valid. | The specified DestinationResource parameter is invalid. |
| 404 | Invalid.IoOptimized | The specified IoOptimized is not valid. | The specified IoOptimized parameter is invalid. |
| 404 | Invalid.NetworkCategory | The specified NetworkCategory is not valid. | The specified NetworkCategory parameter is invalid. |
| 404 | Invalid.SpotStrategy | The specified SpotStrategy is not valid. | The specified SpotStrategy parameter is invalid. |
| 404 | Invalid.ResourceId | The specified ResourceId is not valid. | The specified ResourceId parameter is invalid. |
| 404 | Invalid.InstancePayType | The specified InstancePayType is not valid. | The specified InstanceChargeType parameter is invalid. |
| 404 | Invalid.OperationType | The specified OperationType is not valid. | The specified parameter OperationType is invalid. |
| 404 | OperationDenied | The specified operation is denied as this instanceType is not support. | The instance type does not support this operation. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId provided does not exist in our records. | The specified instance does not exist. |
| 404 | InvalidResourceId.NotFound | The specified ResourceId is not found in our records. | The specified resource does not exist. Check whether the resource ID is correct. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.