调用DescribeImageSupportInstanceTypes查询指定镜像支持的实例规格。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | DescribeImageSupportInstanceTypes | 系统规定参数。取值:DescribeImageSupportInstanceTypes |
| RegionId | String | 是 | cn-hangzhou | 镜像所属的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 |
| ImageId | String | 否 | m-o6w3gy99qf89rkga**** | 镜像ID。 |
| ActionType | String | 否 | CreateEcs | 实例规格需要使用到的场景。取值范围:
|
| Filter.N.Key | String | 否 | imageId | 指定过滤条件Key,当前只支持过滤镜像ID。取值范围:
|
| Filter.N.Value | String | 否 | m-o6w3gy99qf89rkga**** | 指定过滤条件Value。 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| ImageId | String | m-o6w3gy99qf89rkga**** | 查询的镜像ID。 |
| InstanceTypes | Array of InstanceType | 由InstanceTypeItemType组成的实例规格集合。 |
|
| InstanceType | |||
| CpuCoreCount | Integer | 1 | 实例规格的vCPU内核数目。 |
| InstanceTypeFamily | String | ecs.t1 | 实例规格族。 |
| InstanceTypeId | String | ecs.t1.xsmall | 镜像支持的实例规格ID。 |
| MemorySize | Float | 1024 | 实例规格的内存大小,单位GiB。 |
| RegionId | String | cn-hangzhou | 镜像所属地域ID。 |
| RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | 请求ID。 |
示例
请求示例
https://ecs.aliyuncs.com/?Action=DescribeImageSupportInstanceTypes &RegionId=cn-hangzhou &ImageId=m-o6w3gy99qf89rkga**** &<公共请求参数>
正常返回示例
XML 格式
<DescribeImageSupportInstanceTypesResponse>
<RequestId>CF661E2D-4AFE-4BCD-959A-A65E14416B44</RequestId>
<RegionId>cn-hangzhou</RegionId>
<ImageId>ubuntu_16_0402_64_20G_alibase_20180409.vhd</ImageId>
<InstanceTypes>
<InstanceType>
<InstanceTypeId>ecs.t1.xsmall</InstanceTypeId>
<CpuCoreCount>1</CpuCoreCount>
<MemorySize>0.5</MemorySize>
<InstanceTypeFamily>ecs.t1</InstanceTypeFamily>
</InstanceType>
<InstanceType>
<InstanceTypeId>ecs.t1.small</InstanceTypeId>
<CpuCoreCount>1</CpuCoreCount>
<MemorySize>1</MemorySize>
<InstanceTypeFamily>ecs.t1</InstanceTypeFamily>
</InstanceType>
</InstanceTypes>
</DescribeImageSupportInstanceTypesResponse>
JSON 格式
{
"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"
}]
}
}
错误码
| HttpCode | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
| 400 | InvalidParamter | Invalid Parameter | 指定的参数不合法。 |
| 404 | InvalidUsage | The specifed Usage is not valid | 指定有引用关系的资源类型(image、disk、image_disk、none)不合法。 |
| 400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | 您指定的实例规格不存在,或者您没有权限操作此规格的实例。 |
访问错误中心查看更多错误码。