All Products
Search
Document Center

Elastic Compute Service:DescribeResourcesModification

Last Updated:Nov 14, 2024

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

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeResourcesModificationget
*Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
ResourceIdstringYes

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

i-bp67acfmxazb4p****
MigrateAcrossZonebooleanNo

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 instance based on the returned information, take note of the following items:

  • Instance that resides 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 a Linux instance, 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.
  • Instance that resides in a virtual private cloud (VPC): 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 a Linux instance, 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.

true
DestinationResourcestringYes

The type of the resource. Valid values:

  • InstanceType
  • SystemDisk
InstanceType
OperationTypestringNo

The operation of changing resource configurations.

  • Valid values for subscription resources:

    • Upgrade: upgrades resources.
    • Downgrade: downgrades resources.
    • RenewDowngrade: renews and downgrades resources.
    • RenewModify: renews an expired instance and changes its configurations.
  • Set the value to Upgrade for pay-as-you-go resources.

Default value: Upgrade.

Upgrade
InstanceTypestringNo

The instance type. For more information, see Overview of instance families. You can also call the DescribeInstanceTypes operation to query the most recent instance type list. This parameter must be specified when DestinationResource is set to SystemDisk.

ecs.g5.large
CoresintegerNo

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.

2
MemoryfloatNo

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.

8.0
ZoneIdstringNo

The zone ID.

cn-hangzhou-e
ConditionsarrayNo

The conditions.

stringNo

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.

DiskCategory

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
AvailableZonesarray<object>

The information about the queried zones.

AvailableZoneobject
ZoneIdstring

The zone ID.

cn-hangzhou-e
Statusstring

The state of the resource. Valid values:

  • Available
  • SoldOut
Available
StatusCategorystring

The category of the 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
WithStock
RegionIdstring

The region ID.

cn-hangzhou
AvailableResourcesarray<object>

The resources that are available in the zone.

AvailableResourceobject
Typestring

The type of the resources. Valid values:

  • Zone
  • IoOptimized
  • InstanceType
  • SystemDisk
  • DataDisk
  • Network
InstanceType
SupportedResourcesarray<object>

The information about the resources.

SupportedResourceobject
Statusstring

The state of the resource. Valid values:

  • Available
  • SoldOut
Available
Valuestring

The resource type.

ecs.g5.large
Maxinteger

The maximum disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

2
Unitstring

The unit of the disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

null
StatusCategorystring

The category of the 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
WithStock
Mininteger

The minimum disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

1
ConditionSupportedResourcesarray<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.

ConditionSupportedResourceobject

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

Conditionsarray<object>

The conditions.

Conditionobject

The conditions.

Keystring

The condition name. Valid value:

DiskCategory, which indicates a disk category change.

DiskCategory
Statusstring

The stock state of the resource. Valid values:

  • Available
  • SoldOut
Available
Valuestring

The resource type.

ecs.g5.large
Maxinteger

The maximum disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

2
Unitstring

The unit of the disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

null
StatusCategorystring

The category of the 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
WithStock
Mininteger

The minimum disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

1

Examples

Sample success responses

JSONformat

{
  "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.g5.large",
                    "Max": 2,
                    "Unit": "null",
                    "StatusCategory": "WithStock",
                    "Min": 1
                  }
                ]
              },
              "ConditionSupportedResources": {
                "ConditionSupportedResource": [
                  {
                    "Conditions": {
                      "Condition": [
                        {
                          "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 specified OperationType parameter is invalid.
400Invalid.ParamThe input parameter DestinationResource that is mandatory for processing this request is not supplied.The specified DestinationResource parameter is invalid.
400Invalid.InstanceChargeTypeThe specified InstanceChargeType is not valid.The specified InstanceChargeType parameter is invalid.
400InvalidCondition.MalformedThe specified Condition is not valid.-
403InvalidDedicatedHostId.NotFoundThe specified DedicatedHostId does not exist in our records.-
403InvalidParam.TypeAndCpuMem.ConflictThe specified 'InstanceType' and 'Cores','Memory' are not blank at the same time.-
403InvalidParam.CoresThe specified parameter 'Cores' should be empty.-
403InvalidParam.MemoryThe specified parameter 'Memory' should be empty.-
403InvalidParameter.ResourceOwnerIdThe specified parameter ResourceOwnerId is not available anymore.-
404Invalid.RegionIdThe specified RegionId does not exist.The specified RegionId parameter is invalid.
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.The RegionId provided does not exist
404Unavailable.RegionsThe available regions does not exists.-
404Invalid.ResourceTypeThe ResourceType provided does not exist in our records.The specified resource type is invalid.
404Invalid.DestinationResourceThe specified DestinationResource is not valid.The specified DestinationResource parameter is invalid.
404Invalid.IoOptimizedThe specified IoOptimized is not valid.The specified IoOptimized parameter is invalid.
404Invalid.NetworkCategoryThe specified NetworkCategory is not valid.The specified NetworkCategory parameter is invalid.
404Invalid.SpotStrategyThe specified SpotStrategy is not valid.The specified SpotStrategy parameter is invalid.
404Invalid.ResourceIdThe specified ResourceId is not valid.The specified ResourceId parameter is invalid.
404Invalid.InstancePayTypeThe specified InstancePayType is not valid.The specified InstanceChargeType parameter is invalid.
404Invalid.OperationTypeThe specified OperationType is not valid.The specified OperationType parameter is invalid.
404OperationDeniedThe specified operation is denied as this instanceType is not support.The instance type does not support this operation.
404InvalidInstanceId.NotFoundThe specified InstanceId provided does not exist in our records.The specified instance does not exist.
404InvalidResourceId.NotFoundThe specified ResourceId is not found in our records.The specified resource does not exist. Check whether the resource ID is correct.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-04-14The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2022-09-14The Error code has changed. The request parameters of the API has changedView Change Details
2022-09-14The Error code has changed. The request parameters of the API has changedView Change Details