指定 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. | 指定的執行個體規格不支援目前執行個體掛載的資料磁碟規格。 |
| 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。 |
| 400 | MissingParameter.Status | The specified parameter Status is not supplied. | |
| 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.N.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. | 輸入的架構參數無效。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。