All Products
Search
Document Center

Elastic Compute Service:DescribeImageSupportInstanceTypes

Last Updated:Nov 14, 2024

Queries the instance types supported by an image.

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:DescribeImageSupportInstanceTypesget
*Image
acs:ecs:{#regionId}:{#accountId}:image/{#imageId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

Details about the instance types that are supported by the image.

cn-hangzhou
ImageIdstringNo

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

m-o6w3gy99qf89rkga****
ActionTypestringNo

The scenario in which you want to use the image. Valid values:

  • CreateEcs (default): instance creation
  • ChangeOS: replacement of the system disk or operating system
CreateEcs
Filterarray<object>No

The number of vCPUs of the instance type.

objectNo

The filters used to filter instance types.

KeystringNo

Filter N used to filter instance types.

imageId
ValuestringNo

The ID of the image.

m-o6w3gy99qf89rkga****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
ImageIdstring

The key of filter N. Only the image ID can be used to filter instance types. Valid values:

  • imagId: image ID
  • filter: image ID
m-o6w3gy99qf89rkga****
RegionIdstring

{ "RequestId": "CF661E2D-4AFE-4BCD-959A-A65E14416B44", "RegionId": "cn-hangzhou", "ImageId": "ubuntu_16_0402_64_20G_alibase_20180409.vhd", "InstanceTypes": { "InstanceType": [{ "InstanceTypeId": "ecs.t1.xsmall", "CpuCoreCount": 1, "MemorySize": 0.5, "InstanceTypeFamily": "ecs.t1" }, { "InstanceTypeId": "ecs.t1.small", "CpuCoreCount": 1, "MemorySize": 1, "InstanceTypeFamily": "ecs.t1" }] } }

cn-hangzhou
InstanceTypesarray<object>

{ "RequestId": "CF661E2D-4AFE-4BCD-959A-A65E14416B44", "RegionId": "cn-hangzhou", "ImageId": "ubuntu_16_0402_64_20G_alibase_20180409.vhd", "InstanceTypes": { "InstanceType": [{ "InstanceTypeId": "ecs.t1.xsmall", "CpuCoreCount": 1, "MemorySize": 0.5, "InstanceTypeFamily": "ecs.t1" }, { "InstanceTypeId": "ecs.t1.small", "CpuCoreCount": 1, "MemorySize": 1, "InstanceTypeFamily": "ecs.t1" }] } }

InstanceTypeobject
CF661E2D-4AFE-4BCD-959A-A65E14416B44 cn-hangzhou ubuntu_16_0402_64_20G_alibase_20180409.vhd ecs.t1.xsmall 1 0.5 ecs.t1 ecs.t1.small 1 1 ecs.t1
InstanceTypeIdstring

Queries the instance types supported by an image.

ecs.t1.xsmall
InstanceTypeFamilystring

DescribeImageSupportInstanceTypes

ecs.t1
CpuCoreCountinteger

The number of vCPUs of the instance type.

1
MemorySizefloat

The memory size of the instance type. Unit: GiB.

1024

Examples

Sample success responses

JSONformat

{
  "RequestId": " 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "ImageId": "m-o6w3gy99qf89rkga****",
  "RegionId": "cn-hangzhou",
  "InstanceTypes": {
    "InstanceType": [
      {
        "InstanceTypeId": "ecs.t1.xsmall",
        "InstanceTypeFamily": "ecs.t1",
        "CpuCoreCount": 1,
        "MemorySize": 1024
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParamterInvalid Parameter.The specified parameter is invalid.
400InvalidInstanceType.ValueNotSupportedThe specified InstanceType does not exist or beyond the permitted range.The specified instance type does not exist or you are not authorized to manage instances of this instance type.
404InvalidUsageThe specifed Usage is not valid.The specified Usage parameter is invalid.

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

Change history

Change timeSummary of changesOperation
2023-08-25The Error code has changedView Change Details
2023-03-28The Error code has changed. The request parameters of the API has changedView Change Details
2023-03-20The Error code has changed. The request parameters of the API has changedView Change Details