指定ImageId、镜像被使用场景、Filter过滤等参数,查询您可以使用的镜像资源列表。
接口说明
您可以查询的镜像资源包括您的自定义镜像、阿里云提供的公共镜像、云市场镜像以及其他阿里云用户主动共享给您的共享镜像。
支持分页查询,查询结果包括可使用的镜像资源的总数和当前页的镜像资源。每页的数量默认为 10 条。
通过阿里云 CLI 调用 API 时,不同数据类型的请求参数取值必须遵循格式要求。更多信息,请参见 CLI 参数格式说明。
当查询阿里云官方提供的镜像或共享镜像(ImageOwnerAlias 指定 system 或 others)时,本次请求可忽略 RAM 鉴权规则。更多信息,请参见鉴权规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:DescribeImages |
get |
Image
Image
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
镜像所属的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。 |
cn-hangzhou |
| Status |
string |
否 |
查询指定状态的镜像,如果不配置此参数,默认只返回 Available 状态的镜像。取值范围:
默认值:Available。当前参数支持同时取多个值,值之间以半角逗号(,)隔开。 |
Available |
| ImageId |
string |
否 |
镜像 ID。 |
m-bp1g7004ksh0oeuc**** |
| ShowExpired |
boolean |
否 |
订阅型镜像是否已经超过使用期限。 |
false |
| SnapshotId |
string |
否 |
根据某一快照 ID 创建的自定义镜像。 |
s-bp17ot2q7x72ggtw**** |
| ImageName |
string |
否 |
镜像名称。支持模糊搜索。 |
testImageName |
| ImageFamily |
string |
否 |
镜像族系名称,查询镜像时可通过设置该参数来过滤当前族系对应的镜像。 默认值:空。 说明
阿里云官方镜像关联的镜像族系信息请参见公共镜像概述。 |
hangzhou-daily-update |
| ImageOwnerAlias |
string |
否 |
镜像来源。取值范围:
默认值:空。 说明
空表示返回取值为 system、self 以及 others 的结果。 |
self |
| InstanceType |
string |
否 |
为指定的实例规格查询可以使用的镜像。 |
ecs.g5.large |
| IsSupportIoOptimized |
boolean |
否 |
镜像是否可以运行在 I/O 优化实例上。 |
true |
| IsSupportCloudinit |
boolean |
否 |
镜像是否支持 cloud-init。 |
true |
| OSType |
string |
否 |
镜像的操作系统类型。取值范围:
|
linux |
| Architecture |
string |
否 |
镜像的体系架构。取值范围:
|
i386 |
| PageNumber |
integer |
否 |
镜像资源列表的页码。 起始值:1。 默认值:1。 |
1 |
| PageSize |
integer |
否 |
分页查询时设置的每页行数。 最大值:100。 默认值:10。 |
10 |
| Usage |
string |
否 |
镜像是否已经运行在 ECS 实例中。取值范围:
|
instance |
| DryRun |
boolean |
否 |
是否只预检此次请求。
默认值:false。 |
false |
| ActionType |
string |
否 |
镜像需要被使用到的场景。取值范围:
|
CreateEcs |
| ResourceGroupId |
string |
否 |
自定义镜像所在的企业资源组 ID。使用该参数过滤资源时,资源数量不能超过 1000 个。 说明
不支持默认资源组过滤。 |
rg-bp67acfmxazb4p**** |
| Tag |
array<object> |
否 |
标签列表。 |
|
|
object |
否 |
标签信息。 |
||
| key |
string |
否 |
镜像的标签键。 说明
该参数即将被弃用,为提高兼容性,建议您使用另一个 |
null |
| Key |
string |
否 |
镜像的标签键。N 的取值范围:1~20。 使用一个标签过滤资源,查询到该标签下的资源数量不能超过 1000 个;使用多个标签过滤资源,查询到同时绑定了多个标签的资源数量不能超过 1000 个。如果资源数量超过 1000 个,请使用 ListTagResources 接口进行查询。 |
TestKey |
| Value |
string |
否 |
镜像的标签值。N 的取值范围:1~20。 |
TestValue |
| value |
string |
否 |
镜像的标签值。 说明
该参数即将被弃用,为提高兼容性,建议您使用另一个 |
null |
| Filter |
array<object> |
否 |
查询资源时的筛选条件列表。 |
|
|
object |
否 |
查询资源时的筛选条件。 |
||
| Key |
string |
否 |
查询资源时的筛选键。取值范围:
默认值:null。 |
CreationStartTime |
| Value |
string |
否 |
查询资源时的筛选值。
默认值:null。 |
2017-12-05T22:40Z |
| IsPublic |
boolean |
否 |
是否查询已发布的社区镜像。取值范围:
默认值:false。 |
false |
| ImageOwnerId |
integer |
否 |
镜像所属的阿里云账号 ID。该参数仅在查询共享镜像以及社区镜像时生效。 |
20169351435666**** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| PageSize |
integer |
当前分页包含多少条目。 |
1 |
| PageNumber |
integer |
当前页码。 |
1 |
| RequestId |
string |
请求 ID。 |
66189103-EDB2-43E2-BB60-BFF2B62F4EB8 |
| TotalCount |
integer |
镜像总数。 |
1 |
| RegionId |
string |
镜像所属地域 ID。 |
cn-hangzhou |
| Images |
object |
||
| Image |
array<object> |
镜像信息 Images 组成的集合。 |
|
|
array<object> |
镜像信息。 |
||
| CreationTime |
string |
镜像的创建时间。 |
2019-11-15T06:07:05Z |
| Status |
string |
镜像的状态。可能值:
|
Available |
| ImageFamily |
string |
镜像族系名称。 |
hangzhou-daily-update |
| Progress |
string |
镜像完成的进度,单位为百分比。 |
100% |
| IsCopied |
boolean |
是否是拷贝的镜像。 |
false |
| IsSupportIoOptimized |
boolean |
是否可以在 I/O 优化实例上运行。 |
true |
| ImageOwnerAlias |
string |
镜像来源。可能值:
|
self |
| IsSupportCloudinit |
boolean |
是否支持 Cloud Init。 |
true |
| ImageVersion |
string |
镜像版本。 |
2 |
| Usage |
string |
有引用关系的资源类型。可能值:
|
none |
| IsSelfShared |
string |
是否共享过该自定义镜像给其他用户。 |
true |
| Description |
string |
描述信息。 |
Archive log for Oracle |
| Size |
integer |
镜像大小,单位:GiB。 重要
如果镜像包含数据盘,此参数仅代表镜像关联的系统盘快照大小。
|
60 |
| ResourceGroupId |
string |
镜像所在的企业资源组 ID。 |
rg-bp67acfmxazb4p**** |
| Platform |
string |
操作系统平台。 |
Windows Server 2016 |
| OSNameEn |
string |
操作系统的英文显示名称。 |
Windows Server 2016 Data Center Edition 64bit Chinese Edition |
| ImageName |
string |
镜像的名称。 |
testImageName |
| OSName |
string |
操作系统的中文显示名称。 |
Windows Server 2016 数据中心版 64位中文版 |
| ImageId |
string |
镜像 ID。 |
m-bp1g7004ksh0oeuc**** |
| OSType |
string |
操作系统类型。可能值:
|
windows |
| IsSubscribed |
boolean |
是否订阅了该镜像的商品码对应的镜像商品的服务条款。 |
false |
| ProductCode |
string |
云市场镜像中的镜像商品标识。 |
test000**** |
| Architecture |
string |
镜像系统架构类型。可能值:
|
x86_64 |
| BootMode |
string |
镜像的启动模式。可能值:
更多关于镜像的启动模式说明,请参见镜像启动模式。 |
BIOS |
| DiskDeviceMappings |
object |
||
| DiskDeviceMapping |
array<object> |
镜像下包含云盘和快照的映射关系集合。 |
|
|
object |
镜像下包含云盘和快照的映射关系。 |
||
| Type |
string |
镜像的类型。 |
system |
| ImportOSSBucket |
string |
导入镜像所属 OSS 的 bucket。 |
testEcsImport |
| Progress |
string |
对于复制中的镜像,返回复制任务的进度。 |
32% |
| SnapshotId |
string |
快照 ID。 |
s-bp17ot2q7x72ggtw**** |
| ImportOSSObject |
string |
导入镜像所属 OSS 的 object。 |
imageImport |
| Device |
string |
云盘的设备信息,例如/dev/xvdb。 |
/dev/xvda |
| Size |
string |
云盘的大小。单位为 GiB。 |
60 |
| RemainTime |
integer |
对于复制中的镜像,返回复制任务的剩余时间,单位:秒。 |
233 |
| Format |
string |
镜像格式。 |
qcow2 |
| Encrypted |
boolean |
说明
该参数正在邀测中。 |
true |
| Tags |
object |
||
| Tag |
array<object> |
镜像的标签对信息列表。 |
|
|
object |
镜像的标签对信息。 |
||
| TagValue |
string |
镜像的标签值。 |
Oracle |
| TagKey |
string |
镜像的标签键。 |
DTS |
| IsPublic |
boolean |
是否为公开镜像。公开镜像包括阿里云提供的公共镜像以及您已发布为社区镜像的自定义镜像。可能值:
|
false |
| ImageOwnerId |
integer |
镜像所属的阿里云账号 ID。该参数仅在查询共享镜像以及社区镜像时生效。 |
1234567890 |
| LoginAsNonRootSupported |
boolean |
当前镜像是否支持非 root 用户登录。可能值:
|
false |
| SupplierName |
string |
社区镜像认证企业名称。 |
TestName |
| DetectionOptions |
object |
镜像检测相关结果。 |
|
| Status |
string |
镜像检测任务状态。可能值:
|
Processing |
| Items |
object |
||
| Item |
array<object> |
镜像检测项列表。 |
|
|
object |
镜像检测项。 |
||
| Name |
string |
镜像检测项名称。 |
Nvme |
| Value |
string |
镜像检测项结果。 |
Supported |
| RiskLevel |
string |
导入的自定义镜像检测项是否存在风险,如果存在风险返回此字段,不存在风险则不返回。 风险等级可能值:
|
High |
| RiskCode |
string |
检测项可能存在的缺陷。 |
NVMe.NotInstalled |
| Features |
object |
镜像特性相关属性。 |
|
| NvmeSupport |
string |
镜像是否支持 NVMe。可能值:
|
supported |
| ImdsSupport |
string |
镜像的元数据访问模式,可能值:
|
v2 |
| CpuOnlineUpgrade |
string |
是否支持 CPU 热升配。可能值:
|
supported |
| CpuOnlineDowngrade |
string |
是否支持 CPU 热降配。可能值:
|
supported |
| MemoryOnlineUpgrade |
string |
是否支持内存热升配。可能值:
|
unsupported |
| MemoryOnlineDowngrade |
string |
是否支持内存热降配。可能值:
|
unsupported |
| LicenseType |
string |
许可证类型。该属性决定了基于此镜像创建 ECS 实例的计费方式和激活逻辑,仅对 Windows Server 类型镜像具有业务参考意义。可能值:
|
BYOL |
示例
正常返回示例
JSON格式
{
"PageSize": 1,
"PageNumber": 1,
"RequestId": "66189103-EDB2-43E2-BB60-BFF2B62F4EB8",
"TotalCount": 1,
"RegionId": "cn-hangzhou",
"Images": {
"Image": [
{
"CreationTime": "2019-11-15T06:07:05Z",
"Status": "Available",
"ImageFamily": "hangzhou-daily-update",
"Progress": "100%",
"IsCopied": false,
"IsSupportIoOptimized": true,
"ImageOwnerAlias": "self",
"IsSupportCloudinit": true,
"ImageVersion": "2",
"Usage": "none",
"IsSelfShared": "true",
"Description": "Archive log for Oracle",
"Size": 60,
"ResourceGroupId": "rg-bp67acfmxazb4p****",
"Platform": "Windows Server 2016",
"OSNameEn": "Windows Server 2016 Data Center Edition 64bit Chinese Edition",
"ImageName": "testImageName",
"OSName": "Windows Server 2016 数据中心版 64位中文版",
"ImageId": "m-bp1g7004ksh0oeuc****",
"OSType": "windows",
"IsSubscribed": false,
"ProductCode": "test000****",
"Architecture": "x86_64",
"BootMode": "BIOS",
"DiskDeviceMappings": {
"DiskDeviceMapping": [
{
"Type": "system",
"ImportOSSBucket": "testEcsImport",
"Progress": "32%",
"SnapshotId": "s-bp17ot2q7x72ggtw****",
"ImportOSSObject": "imageImport",
"Device": "/dev/xvda",
"Size": "60",
"RemainTime": 233,
"Format": "qcow2",
"Encrypted": true
}
]
},
"Tags": {
"Tag": [
{
"TagValue": "Oracle",
"TagKey": "DTS"
}
]
},
"IsPublic": false,
"ImageOwnerId": 1234567890,
"LoginAsNonRootSupported": false,
"SupplierName": "TestName",
"DetectionOptions": {
"Status": "Processing",
"Items": {
"Item": [
{
"Name": "Nvme",
"Value": "Supported",
"RiskLevel": "High",
"RiskCode": "NVMe.NotInstalled"
}
]
}
},
"Features": {
"NvmeSupport": "supported",
"ImdsSupport": "v2",
"CpuOnlineUpgrade": "supported",
"CpuOnlineDowngrade": "supported",
"MemoryOnlineUpgrade": "unsupported",
"MemoryOnlineDowngrade": "unsupported"
},
"LicenseType": "BYOL"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidImageOwnerAlias.ValueNotSupported | The specified ImageOwnerAlias value is not supported. | 无效的镜像所有者别名,请您检查该参数是否正确。 |
| 400 | InvalidParamter | Invalid Parameter. | 输入的参数无效。 |
| 400 | InvalidTag.Mismatch | The specified Tag.n.Key and Tag.n.Value are not match. | 指定的 Tag.N.Key 和 Tag.N.Value 不匹配。 |
| 400 | InvalidTagCount | The specified tags are beyond the permitted range. | 指定的标记超出取值范围。 |
| 400 | InvalidInstanceType.ValueNotSupported | The specified instance type %s does not exist. You can use the DescribeInstanceTypes API to query the available instance types. | 指定的规格不存在,您可以使用DescribeInstanceTypes接口查询可用的规格。 |
| 400 | InvalidFilterValue.NetworkType | The specified networkType value in the Filter is invalid. | 过滤器中指定的网络类型值无效。 |
| 400 | InvalidOperation.ImageOwnerIdUnsupported | The parameter "ImageOwnerId" is not supported in this context, it is only valid when querying shared images or community images. | 此处不支持ImageOwnerId参数,该参数仅在查询共享镜像或社区镜像时有效。 |
| 400 | InvalidImageOwnerAlias.PublicImageUnsupported | When querying images, the parameter ImageOwnerAlias should be others while specified parameter IsPublic is true. | 查询镜像时,参数IsPublic是true,则参数ImageOwnerAlias必须是others。 |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | CurrentAccount.NotSupportPublicImage | Public image is not supported for current account. | 当前用户不支持使用公共镜像。 |
| 404 | InvalidFilterKey.NotFound | The specified Filter Key is not found. | Filter的Key参数无效。 |
| 404 | InvalidFilterValue | The specified Filter Value is not valid. | Filter中的Value无效。 |
| 404 | InvalidUsage | The specified Usage is not valid. | Usage参数无效。 |
| 404 | InvalidOSType | The specified OSType is not valid. | OSType参数无效。 |
| 404 | InvalidArchitecture | The specified Architecture is not valid. | Architecture参数无效。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。