Queries available resources within a specific zone when you upgrade or downgrade instance types or replace system disks.

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

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeResourcesModification

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

RegionIdStringYescn-hangzhou

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

ResourceIdStringYesi-bp67acfmxazb4p****

The ID of the resource. For example, when DestinationResource is set to InstanceType, this parameter can be interpreted as InstanceId.

MigrateAcrossZoneBooleanNotrue

Specifies whether cross-cluster instance type upgrades are supported. Valid values:

  • true
  • false

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:

  • Instances that reside in the classic network:
    • For retired instance types, when a non-I/O-optimized instance is upgraded to an I/O-optimized instance, the private IP address, disk device names, and software authorization codes of the instance change. For Linux instances, basic disks (cloud) are identified as xvd* such as xvda and xvdb, and ultra disks (cloud_efficiency) and standard SSDs (cloud_ssd) are identified as vd* such as vda and vdb.
    • For instance families available for purchase, when the instance type of an instance is changed, the private IP address of the instance changes.
  • Instances that reside in virtual private clouds (VPCs): For retired instance types, when a non-I/O-optimized instance is upgraded to an I/O-optimized instance, the disk device names and software authorization codes of the instance change. For Linux instances, basic disks (cloud) are identified as xvd* such as xvda and xvdb, and ultra disks (cloud_efficiency) and standard SSDs (cloud_ssd) are identified as vd* such as vda and vdb.
DestinationResourceStringYesInstanceType

The target resource type. Valid values:

  • InstanceType
  • SystemDisk
OperationTypeStringNoUpgrade

The operation of changing resource configurations.

  • Valid values for subscription resources:
    • Upgrade
    • Downgrade
    • RenewDowngrade
    • RenewModify
  • Valid values for pay-as-you-go resources: Upgrade

Default value: Upgrade.

InstanceTypeStringNoecs.g5.large

The instance type. 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.

CoresIntegerNo2

The number of vCPU cores 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.

MemoryFloatNo8.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.

ZoneIdStringNocn-hangzhou-e

The ID of the zone.

Conditions.NStringNoDiskCategory

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

ParameterTypeExampleDescription
RequestIdString473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The request ID.

AvailableZonesArray of AvailableZone

The information about the queried zones.

AvailableZone
ZoneIdStringcn-hangzhou-e

The ID of the zone.

StatusStringAvailable

The status of the resource. Valid values:

  • Available
  • SoldOut
StatusCategoryStringWithStock

The category of resource based on stock status. Valid values:

  • WithStock: resources that are in sufficient stock
  • ClosedWithStock: resources that are in insufficient stock
  • WithoutStock: resources that are out of stock
RegionIdStringcn-hangzhou

The ID of the region.

AvailableResourcesArray of AvailableResource

The resources that are available in the zone.

AvailableResource
TypeStringInstanceType

The type of resource. Valid values:

  • Zone
  • IoOptimized
  • InstanceType
  • SystemDisk
  • DataDisk
  • Network
SupportedResourcesArray of SupportedResource

The information about the resources.

SupportedResource
StatusStringAvailable

The status of the resource. Valid values:

  • Available
  • SoldOut
ValueStringecs.g5.large

The resource type.

MaxInteger2

The maximum resource specification value. This parameter is not returned if it has no value.

UnitStringnull

The resource specification unit. This parameter is not returned if it has no value.

StatusCategoryStringWithStock

The category of resource based on stock status. Valid values:

  • WithStock: resources that are in sufficient stock
  • ClosedWithStock: resources that are in insufficient stock
  • WithoutStock: resources that are out of stock
MinInteger1

The minimum resource specification value. This parameter is not returned if it has no value.

ConditionSupportedResourcesArray of ConditionSupportedResource

The resource types that resources can be changed to after the resources meet specified conditions.

ConditionSupportedResource
ConditionsArray of Condition

The conditions.

Condition
KeyStringDiskCategory

The condition name. Valid value:

DiskCategory, which indicates a disk category change.

StatusStringAvailable

The stock status of the resource. Valid values:

  • Available
  • SoldOut
ValueStringecs.g5.large

The resource type.

MaxInteger2

The maximum resource specification value. This parameter is not returned if it has no value.

UnitStringnull

The resource specification unit. This parameter is not returned if it has no value.

StatusCategoryStringWithStock

The category of resource based on stock status. Valid values:

  • WithStock: resources that are in sufficient stock
  • ClosedWithStock: resources that are in insufficient stock
  • WithoutStock: resources that are out of stock
MinInteger1

The minimum resource specification value. This parameter is not returned if it has no value.

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>
                <Max>2</Max>
                <Unit>null</Unit>
                <StatusCategory>WithStock</StatusCategory>
                <Min>1</Min>
            </SupportedResources>
            <ConditionSupportedResources>
                <Conditions>
                    <Key>DiskCategory</Key>
                </Conditions>
                <Status>Available</Status>
                <Value>ecs.g5.large</Value>
                <Max>2</Max>
                <Unit>null</Unit>
                <StatusCategory>WithStock</StatusCategory>
                <Min>1</Min>
            </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",
        "Max" : 2,
        "Unit" : "null",
        "StatusCategory" : "WithStock",
        "Min" : 1
      } ],
      "ConditionSupportedResources" : [ {
        "Conditions" : [ {
          "Key" : "DiskCategory"
        } ],
        "Status" : "Available",
        "Value" : "ecs.g5.large",
        "Max" : 2,
        "Unit" : "null",
        "StatusCategory" : "WithStock",
        "Min" : 1
      } ]
    } ]
  } ]
}

Error codes

HTTP status codeError codeError messageDescription
400Invalid.OperationTypeThe specified operationType is not valid.The error message returned because the specified OperationType parameter is invalid.
400Invalid.ParamThe input parameter DestinationResource that is mandatory for processing this request is not supplied.The error message returned because the specified DestinationResource parameter is invalid.
400Invalid.InstanceChargeTypeThe specified InstanceChargeType is not valid.The error message returned because the specified instance billing method is invalid.
403InvalidDedicatedHostId.NotFoundThe specified DedicatedHostId does not exist in our records.The error message returned because the specified dedicated host does not exist within the current region.
404Invalid.RegionIdThe specified RegionId does not exist.The error message returned because the specified RegionId parameter is invalid.
404Invalid.ResourceTypeThe ResourceType provided does not exist in our records.The error message returned because the specified resource type is invalid.
404Invalid.DestinationResourceThe specified DestinationResource is not valid.The error message returned because the specified DestinationResource parameter is invalid.
404Invalid.IoOptimizedThe specified IoOptimized is not valid.The error message returned because the specified IoOptimized parameter is invalid.
404Invalid.NetworkCategoryThe specified NetworkCategory is not valid.The error message returned because the specified NetworkCategory parameter is invalid.
404Invalid.SpotStrategyThe specified SpotStrategy is not valid.The error message returned because the specified SpotStrategy parameter is invalid.
404Invalid.ResourceIdThe specified ResourceId is not valid.The error message returned because the specified ResourceId parameter is invalid.
404Invalid.InstancePayTypeThe specified InstancePayType is not valid.The error message returned because the specified instance billing method is invalid.
404OperationDeniedThe specified operation is denied as this instanceType is not support.The error message returned because the instance type does not support the operation.
404InvalidInstanceId.NotFoundThe specified InstanceId provided does not exist in our records.The error message returned because the specified instance ID does not exist. Check whether the instance ID is correct.
404InvalidResourceId.NotFoundThe specified ResourceId is not found in our records.The error message returned because the specified ResourceId parameter does not exist. Check whether the resource ID is correct.

For a list of error codes, visit the API Error Center.