# DescribeImages

## 1. API Description

This API is used to query the details of images.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th>Parameter Name</th><th width="130">Required</th><th width="171">Type</th><th>Description</th></tr></thead><tbody><tr><td>imageIds</td><td>No</td><td>Array of String</td><td>ID list of images.<br>Call <a href="describeimages"><code>DescribeImages</code></a> and find <code>imageId</code> in the response.</td></tr><tr><td>imageName</td><td>No</td><td>String</td><td>Image name.</td></tr><tr><td>zoneId</td><td>Yes</td><td>String</td><td>Zone ID.<br>Call <a href="../common-info/describezones"><code>DescribeZones</code></a> and find <code>zoneId</code> in the response.</td></tr><tr><td>category</td><td>No</td><td>String</td><td><p>Image category.</p><p>Available values:</p><ul><li>CentOS</li><li>Windows</li><li>Ubuntu</li><li>Debian</li></ul></td></tr><tr><td>imageType</td><td>No</td><td>String</td><td><p>Image type.</p><ul><li>PUBLIC_IMAGE: the default images.</li><li>CUSTOM_IMAGE: the newly created images by yourself.</li></ul></td></tr><tr><td>osType</td><td>No</td><td>String</td><td><p>Operating system type.</p><p>Available values:</p><ul><li>Windows</li><li>Linux</li></ul></td></tr><tr><td>imageStatus</td><td>No</td><td>String</td><td><p>Image status.</p><ul><li>CREATING: creating.</li><li>AVAILABLE: able to use.</li><li>UNAVAILABLE: unable to use.</li></ul></td></tr><tr><td>pageNum</td><td>No</td><td>Integer</td><td><p>Number of pages returned.</p><p>Default value: 1.</p></td></tr><tr><td>pageSize</td><td>No</td><td>Integer</td><td><p>Number of items in the current page result.</p><p>Default value: 20;</p><p>Maximum value: 1000.</p></td></tr></tbody></table>

## 3. Output Parameters

| Parameter Name | Type                                                                                                       | Description                                                                                              |
| -------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                                                     | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
| totalCount     | Integer                                                                                                    | Number of images meeting the filtering conditions.                                                       |
| dataSet        | Array of [ImageInfo](https://docs.console.zenlayer.com/test/ci-develop-en/compute/datastructure#imageinfo) | Information on an image.                                                                                 |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query all available images with no parameter.**

```json
POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeImages
<Common Request Params>

Request:
{
  "zoneId": "FRA-A",
  "osType": "linux",
  "pageSize": 3
}

Response:
{
  "requestId": "T6818FFFC-B917-4E46-8BEC-D8BBD8FA2AA5",
  "response": {
    "requestId": "T6818FFFC-B917-4E46-8BEC-D8BBD8FA2AA5",
    "dataSet": [
      {
        "imageVersion": "18.04",
        "imageId": "img-EVhEsCuXhCN0urZ7Vt77oOr6K",
        "imageName": "Ubuntu Server 18.04 LTS x86 64-bit",
        "imageDescription": null,
        "osType": "linux",
        "imageSize": "30",
        "imageStatus": "AVAILABLE",
        "category": "Ubuntu",
        "imageType": "PUBLIC_IMAGE"
      },
      {
        "imageVersion": "11.5",
        "imageId": "img-MJHkbWzEl9anNobblDtpRTDPB",
        "imageName": "Debian 11.5 Amd x86 64-bit",
        "imageDescription": null,
        "osType": "linux",
        "imageSize": "30",
        "imageStatus": "AVAILABLE",
        "category": "Debian",
        "imageType": "PUBLIC_IMAGE"
      },
      {
        "imageVersion": "7.4",
        "imageId": "img-3ELi56cECstEUqmcQzqIGdiuB",
        "imageName": "CentOS 7.4.1708 x86 64-bit",
        "imageDescription": null,
        "osType": "linux",
        "imageSize": "30",
        "imageStatus": "AVAILABLE",
        "category": "CentOS",
        "imageType": "PUBLIC_IMAGE"
      }
    ],
    "totalCount": 7
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/software-toolkit/sdk) to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/instruction/commonerrorcode).​

| HTTP Status Code | Error Code                | Description     |
| ---------------- | ------------------------- | --------------- |
| **404**          | INVALID\_ZONE\_NOT\_FOUND | Zone not found. |
