调用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。 说明 此参数不生效,即将下线。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | 请求ID。 |
ImageId | String | m-o6w3gy99qf89rkga**** | 查询的镜像ID。 |
RegionId | String | cn-hangzhou | 镜像所属地域ID。 |
InstanceTypes | Array of InstanceType | 由InstanceTypeItemType组成的实例规格集合。 |
|
InstanceType | |||
InstanceTypeId | String | ecs.t1.xsmall | 镜像支持的实例规格ID。 |
InstanceTypeFamily | String | ecs.t1 | 实例规格族。 |
CpuCoreCount | Integer | 1 | 实例规格的vCPU内核数目。 |
MemorySize | Float | 1024 | 实例规格的内存大小,单位GiB。 |
示例
请求示例
https://ecs.aliyuncs.com/?Action=DescribeImageSupportInstanceTypes
&RegionId=cn-hangzhou
&ImageId=m-o6w3gy99qf89rkga****
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/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
格式
HTTP/1.1 200 OK
Content-Type:application/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. | 输入的参数无效 |
400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | 您指定的实例规格不存在,或者您没有权限操作此规格的实例。 |
404 | InvalidUsage | The specifed Usage is not valid. | 指定的参数 Usage 值不合法。 |
访问错误中心查看更多错误码。