Queries available resources within a specific zone when you upgrade or downgrade instance types or replace system disks.
Debugging
Request parameters
|
Parameter |
Type |
Required |
Example |
Description |
| Action | String | Yes | DescribeResourcesModification | The operation that you want to perform. Set the value to DescribeResourcesModification. |
| RegionId | String | Yes | cn-hangzhou | The region ID. You can call the DescribeRegions operation to query the most recent region list. |
| ResourceId | String | Yes | i-bp67acfmxazb4p**** | The resource ID. For example, when DestinationResource is set to InstanceType, this parameter can be interpreted as InstanceId. |
| MigrateAcrossZone | Boolean | No | true | 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 Elastic Compute Service (ECS) instance based on the returned information, take note of the following items:
|
| DestinationResource | String | Yes | InstanceType | The target resource type. Valid values:
|
| OperationType | String | No | Upgrade | The operation of changing resource configurations.
Default value: Upgrade. |
| InstanceType | String | No | ecs.g5.large | The type of ENI N. Valid values of N: 1 and 2. If the value of N is 1, a primary or secondary ENI can be configured. If the value of N is 2, a primary ENI and a secondary ENI must be configured. Valid values: Primary and Secondary. Default value: Secondary. For more information, see Overview of instance families or call the DescribeInstanceTypes operation to query the most recent instance type list. This parameter is required when DestinationResource is set to SystemDisk. |
| Cores | Integer | No | 2 | The number of vCPUs of the instance type. For information about the values, see Overview of instance families. This parameter takes effect only when DestinationResource is set to InstanceType. |
| Memory | Float | Not supported | 8.0 | The memory size of the instance type. Unit: GiB. For information about the values, see Overview of instance families. This parameter takes effect only when DestinationResource is set to InstanceType. |
| ZoneId | String | No | cn-hangzhou-e | The ID of the zone. |
| Conditions.N | String | No | DiskCategory | The condition. If you specify this parameter, the system queries the resource types that the resource can be changed to after the resource meets the specified condition. Set the value to DiskCategory, which indicates a disk category change. When you set this parameter to DiskCategory, the system queries the instance types that the instance can be changed to after a disk category change. |
Response parameters
Parameter |
Type |
Example |
Description |
| RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | The ID of the request. |
| AvailableZones | Array of AvailableZone | The information about the queried zones. |
|
| AvailableZone | |||
| ZoneId | String | cn-hangzhou-e | The ID of the zone. |
| Status | String | Available | The status of the resource. Valid values:
|
| StatusCategory | String | WithStock | The category of the resource based on stock status. Valid values:
|
| RegionId | String | cn-hangzhou | The region ID. |
| AvailableResources | Array of AvailableResource | The resources that are available in the zone. |
|
| AvailableResource | |||
| Type | String | InstanceType | The type of a resource. Valid values:
|
| SupportedResources | Array of SupportedResource | The information about the resources. |
|
| SupportedResource | |||
| Status | String | Available | The status of the resource. Valid values:
|
| Value | String | ecs.g5.large | The resource type. |
| Max | Integer | 2048 | The maximum disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
| Unit | String | GiB | The unit of the disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
| StatusCategory | String | WithStock | The category of the resource based on stock status. Valid values:
|
| Min | Integer | 20 | The minimum disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
| ConditionSupportedResources | Array of ConditionSupportedResource | 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. |
|
| ConditionSupportedResource | |||
| Conditions | Array of Condition | The conditions. |
|
| Condition | |||
| Key | String | DiskCategory | The condition name. Valid value: DiskCategory, which indicates a disk category change. |
| Status | String | Available | The stock status of the resource. Valid values:
|
| Value | String | ecs.g5.large | The resource type. |
| Max | Integer | 2048 | The maximum disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
| Unit | String | GiB | The unit of the disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
| StatusCategory | String | WithStock | The category of the resource based on stock status. Valid values:
|
| Min | Integer | 20 | The minimum disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk. |
Examples
Sample requests
http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&DestinationResource=InstanceType
&RegionId=cn-hangzhou
&ResourceId=i-bp67acfmxazb4p****
&MigrateAcrossZone=true
&OperationType=Upgrade
&InstanceType=ecs.g5.large
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeResourcesModificationResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<AvailableZones>
<ZoneId>cn-hangzhou-e</ZoneId>
<Status>Available</Status>
<StatusCategory>WithStock</StatusCategory>
<RegionId>cn-hangzhou</RegionId>
<AvailableResources>
<Type>InstanceType</Type>
<SupportedResources>
<Status>Available</Status>
<Value>ecs.g5.large</Value>
<StatusCategory>WithStock</StatusCategory>
</SupportedResources>
<ConditionSupportedResources>
<Conditions>
<Key>DiskCategory</Key>
</Conditions>
<Status>Available</Status>
<Value>ecs.g5.large</Value>
<StatusCategory>WithStock</StatusCategory>
</ConditionSupportedResources>
</AvailableResources>
</AvailableZones>
</DescribeResourcesModificationResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"AvailableZones" : [ {
"ZoneId" : "cn-hangzhou-e",
"Status" : "Available",
"StatusCategory" : "WithStock",
"RegionId" : "cn-hangzhou",
"AvailableResources" : [ {
"Type" : "InstanceType",
"SupportedResources" : [ {
"Status" : "Available",
"Value" : "ecs.g5.large",
"StatusCategory" : "WithStock"
} ],
"ConditionSupportedResources" : [ {
"Conditions" : [ {
"Key" : "DiskCategory"
} ],
"Status" : "Available",
"Value" : "ecs.g5.large",
"StatusCategory" : "WithStock"
} ]
} ]
} ]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
| 400 | Invalid.OperationType | The specified operationType is not valid. | Invalid OperationType value. |
| 400 | Invalid.Param | The input parameter DestinationResource that is mandatory for processing this request is not supplied. | Invalid DestinationResource value. |
| 400 | Invalid.InstanceChargeType | The specified InstanceChargeType is not valid. | Invalid InstanceChargeType value. |
| 403 | InvalidDedicatedHostId.NotFound | The specified DedicatedHostId does not exist in our records. | The specified dedicated host does not exist in the current region. |
| 404 | Invalid.RegionId | The specified RegionId does not exist. | Invalid RegionId value. |
| 404 | Invalid.ResourceType | The ResourceType provided does not exist in our records. | Invalid ResourceType value. |
| 404 | Invalid.DestinationResource | The specified DestinationResource is not valid. | Invalid DestinationResource value. |
| 404 | Invalid.IoOptimized | The specified IoOptimized is not valid. | Invalid IoOptimized value. |
| 404 | Invalid.NetworkCategory | The specified NetworkCategory is not valid. | Invalid NetworkCategory value. |
| 404 | Invalid.SpotStrategy | The specified SpotStrategy is not valid. | Invalid SpotStrategy value. |
| 404 | Invalid.ResourceId | The specified ResourceId is not valid. | Invalid ResourceId value. |
| 404 | Invalid.InstancePayType | The specified InstancePayType is not valid. | Invalid InstanceChargeType value. |
| 404 | OperationDenied | The specified operation is denied as this instanceType is not support. | The instance type does not support the operation. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId provided does not exist in our records. | The specified instance ID does not exist. Check whether the instance ID is correct. |
| 404 | InvalidResourceId.NotFound | The specified ResourceId is not found in our records. | The specified ResourceId parameter does not exist. Check whether the resource ID is correct. |
For a list of error codes, see Service error codes.