This topic describes how to call the DescribeImages operation by using Alibaba Cloud CLI to query images.

Background information

We recommend that you read the description of the operation before you call the operation. For more information, see DescribeImages.

When you call an API operation through Alibaba Cloud CLI, make sure that request parameter values of different data types are in required formats. For more information, see Parameter format overview.

Example 1: Query information about an image based on the image ID

Query information about the image whose ID is m-bp1cz8on60352qnm****.

aliyun ecs DescribeImages --RegionId cn-hangzhou --ImageId m-bp1cz8on60352qnm**** --output cols=ImageName,Status,OSNameEn,OSType,Progress,Usage rows=Images.Image[]

Sample response:

ImageName | Status    | OSNameEn           | OSType | Progress | Usage
--------- | ------    | --------           | ------ | -------- | -----
namedemo  | Available | CentOS  7.4 64 bit | linux  | 100%     | none

Example 2: Query information about images in a specific state by page

Query information about images in a specific state by page, such as images in the Available state.

In this example, the five entries on the first page are queried.

aliyun ecs DescribeImages --RegionId cn-hangzhou --Status Available --PageNumber 1 --PageSize 5 --output cols=ImageName,Status,OSNameEn,OSType,Progress,Usage rows=Images.Image[]

Sample response:

ImageName   | Status    | OSNameEn                                                       | OSType  | Progress | Usage
---------   | ------    | --------                                                       | ------  | -------- | -----
namedemo1   | Available | CentOS_64                                                      | linux   | 100%     | none
namedemo2   | Available | CentOS  7.6 64 bit                                             | linux   | 100%     | none
namedemo3   | Available | CentOS  7.4 64 bit                                             | linux   | 100%     | none
namedemo4   | Available | CentOS  7.2 64 bit                                             | linux   | 100%     | none
namedemo5   | Available | Windows Server  2016 Data Center Edition 64bit Chinese Edition | windows | 100%     | instance

Example 3: Query information about an image that is bound with a specific tag

Query information about an image that is bound with the owner:zhangsan tag.

aliyun ecs DescribeImages --RegionId cn-hangzhou --Tag.1.Key owner --Tag.1.Value zhangsan --output cols=ImageName,Status,OSNameEn,OSType,Progress,Usage rows=Images.Image[]

Sample response:

ImageName | Status    | OSNameEn           | OSType | Progress | Usage
--------- | ------    | --------           | ------ | -------- | -----
namedemo  | Available | CentOS  7.6 64 bit | linux  | 100%     | none