Queries available resources within a zone when you upgrade or downgrade instance types or 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

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 ID of the target region. You can call the DescribeRegions operation to query the most recent region list.

ResourceId String Yes i-bp67acfmxazb4p****

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

MigrateAcrossZone Boolean No true

Specifies whether instance types can be upgraded across clusters. Valid values:

  • true
  • false

Default value: false.

When the MigrateAcrossZone parameter is set to true and you upgrade the ECS instance based on the returned information, take note of the following items:

  • Classic network-type instances:
    • For phased-out instance types, when a non-I/O-optimized instance is upgraded to an I/O-optimized instance, the private IP address, cloud disk device names, and software license codes of the instance are changed. For Linux instances, basic disks (cloud) are identified by the prefix xvd. Ultra disks (cloud_efficiency) and standard SSDs (cloud_ssd) are identified by the prefix vd.
    • For instance families available for purchase, when the instance type of an instance is changed, the private IP address of the instance is also changed.
  • VPC-type instances: For phased-out instance types, when a non-I/O-optimized instance is upgraded to an I/O-optimized instance, the cloud disk device names and software license codes of the instance are changed. For Linux instances, basic disks (cloud) are identified by the prefix xvd. Ultra disks (cloud_efficiency) and standard SSDs (cloud_ssd) are identified by the prefix vd.
DestinationResource String Yes InstanceType

The type of the target resource. Valid values:

  • InstanceType
  • SystemDisk
OperationType String No Upgrade

The operation to modify resource configurations.

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

Default value: Upgrade.

InstanceType String No ecs.g5.large

The instance type. For more information, see Instance families or call the DescribeInstanceTypes operation to query the most recent instance type list. When the DestinationResource parameter is set to SystemDisk, you must specify this parameter.

Cores Integer No 2

The number of vCPU cores of the instance type. For more information, see Instance families. This parameter is valid only when DestinationResource is set to InstanceType.

Memory Float No 8.0

The memory size of the instance type. Unit: GiB. For more information, see Instance families. This parameter is valid only when DestinationResource is set to InstanceType.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

AvailableZones Array of AvailableZone

The list of available zones.

AvailableZone
ZoneId String cn-hangzhou-e

The ID of the zone.

Status String Available

The status of the resource. Valid values:

  • Available
  • SoldOut
StatusCategory String WithStock

The stock status of the resource. Valid values:

  • WithStock: sufficient stock
  • ClosedWithStock: insufficient stock
  • WithoutStock: out of stock
RegionId String cn-hangzhou

The ID of the region.

AvailableResources Array of AvailableResource

An array of available resources.

AvailableResource
Type String InstanceType

The type of the resource. Valid values:

  • Zone
  • IoOptimized
  • InstanceType
  • SystemDisk
  • DataDisk
  • Network
SupportedResources Array of SupportedResource

An array of supported resources.

SupportedResource
Status String Available

The status of the resource. Valid values:

  • Available
  • SoldOut
Value String ecs.g5.large

The resource type.

Max Integer 2

The maximum number of available resources of a specific resource type. No value is returned when the parameter value is null.

Unit String null

The unit of the resource type. No value is returned when the parameter value is null.

StatusCategory String WithStock

The stock status of the resource. Valid values:

  • WithStock: sufficient stock
  • ClosedWithStock: insufficient stock
  • WithoutStock: out of stock
Min Integer 1

The minimum number of available resources of a specific resource type. No value is returned when the parameter value is null.

Examples

Sample requests

https://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>994F2B60-B050-49E3-9283-44655FAC7A4X</RequestId>
    <AvailableZones>
        <AvailableZone>
            <Status>Available</Status>
            <RegionId>cn-hangzhou</RegionId>
            <AvailableResources>
                <AvailableResource>
                    <Type>InstanceType</Type>
                    <SupportedResources>
                        <SupportedResource>
                            <Status>Available</Status>
                            <Value>ecs.g5.xlarge</Value>
                        </SupportedResource>
                        <SupportedResource>
                            <Status>Available</Status>
                            <Value>ecs.t5-lc1m2.large</Value>
                        </SupportedResource>
                        <SupportedResource>
                            <Status>Available</Status>
                            <Value>ecs.t5-c1m4.2xlarge</Value>
                        </SupportedResource>
                        <SupportedResource>
                            <Status>Available</Status>
                            <Value>ecs.c5.xlarge</Value>
                        </SupportedResource>
                    </SupportedResources>
                </AvailableResource>
            </AvailableResources>
            <ZoneId>cn-hangzhou-e</ZoneId>
        </AvailableZone>
    </AvailableZones>
</DescribeResourcesModificationResponse>

JSON format

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

{
  "RequestId" : "994F2B60-B050-49E3-9283-44655FAC7A4X",
  "AvailableZones" : {
    "AvailableZone" : [ {
      "Status" : "Available",
      "RegionId" : "cn-hangzhou",
      "AvailableResources" : {
        "AvailableResource" : [ {
          "Type" : "InstanceType",
          "SupportedResources" : {
            "SupportedResource" : [ {
              "Status" : "Available",
              "Value" : "ecs.g5.xlarge"
            }, {
              "Status" : "Available",
              "Value" : "ecs.t5-lc1m2.large"
            }, {
              "Status" : "Available",
              "Value" : "ecs.t5-c1m4.2xlarge"
            }, {
              "Status" : "Available",
              "Value" : "ecs.c5.xlarge"
            } ]
          }
        } ]
      },
      "ZoneId" : "cn-hangzhou-e"
    } ]
  }
}

Error codes

HttpCode Error code Error message Description
400 Invalid.OperationType The specified operationType is not valid. The error message returned because the specified OperationType parameter is invalid.
400 Invalid.Param The input parameter DestinationResource that is mandatory for processing this request is not supplied. The error message returned because the specified DestinationResource parameter is invalid.
400 Invalid.InstanceChargeType The specified InstanceChargeType is not valid. The error message returned because the specified InstanceChargeType parameter is invalid.
403 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist in our records. The error message returned because the specified dedicated host does not exist within the current region.
403 InvalidParam.TypeAndCpuMem.Conflict The specified 'InstanceType' and 'Cores','Memory' are not blank at the same time. The error message returned because none of the InstanceType, Cores, and Memory parameters are specified.
403 InvalidParam.Cores The specified parameter 'Cores' should be empty The error message returned because the Cores parameter is specified.
403 InvalidParam.Memory The specified parameter 'Memory' should be empty The error message returned because the Memory parameter is specified.
404 Invalid.RegionId The specified RegionId does not exist. The error message returned because the specified RegionId parameter is invalid.
404 Unavailable.Regions The available regions does not exists The error message returned because the specified RegionId parameter is invalid.
404 Invalid.ResourceType The ResourceType provided does not exist in our records. The error message returned because the specified ResourceType parameter is invalid.
404 Invalid.DestinationResource The specified DestinationResource is not valid. The error message returned because the specified DestinationResource parameter is invalid.
404 Invalid.IoOptimized The specified IoOptimized is not valid. The error message returned because the specified IoOptimized parameter is invalid.
404 Invalid.NetworkCategory The specified NetworkCategory is not valid. The error message returned because the specified NetworkCategory parameter is invalid.
404 Invalid.SpotStrategy The specified SpotStrategy is not valid. The error message returned because the specified SpotStrategy parameter is invalid.
404 Invalid.ResourceId The specified ResourceId is not valid. The error message returned because the specified ResourceId parameter is invalid.
404 Invalid.InstancePayType The specified InstancePayType is not valid. The error message returned because the specified InstanceChargeType parameter is invalid.
404 OperationDenied The specified operation is denied as this instanceType is not support. The error message returned because the instance type does not support the current operation.
404 InvalidInstanceId.NotFound The specified InstanceId provided does not exist in our records. The error message returned because the specified InstanceId parameter does not exist. Check whether the instance ID is correct.
404 InvalidResourceId.NotFound The specified ResourceId is not found in our records The error message returned because the specified ResourceId parameter is invalid. Check whether the resource exists.

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