> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cn/zec/disk-snapshot/describeautosnapshotpolicies.md).

# DescribeAutoSnapshotPolicies

## 1. 接口描述

本接口(DescribeAutoSnapshotPolicies)用于查询自动快照策略的列表数据。

## 2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

| 参数名称                   | 必选 | 类型                                                         | 描述                                                                                                                     |
| ---------------------- | -- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| autoSnapshotPolicyIds  | 否  | Array of String                                            | 根据自动快照策略的ID进行过滤。                                                                                                       |
| zoneIds                | 否  | Array of String                                            | <p>根据自动快照策略的可用区ID进行过滤。</p><p>可通过调用 <a href="/api-reference/cn/zec/location/describezones.md">DescribeZones</a> 获取。</p> |
| autoSnapshotPolicyName | 否  | String                                                     | <p>根据自动快照策略的名称进行过滤。</p><p>该字段支持模糊搜索。</p>                                                                               |
| resourceGroupId        | 否  | String                                                     | 根据资源组ID进行过滤。                                                                                                           |
| pageSize               | 否  | Integer                                                    | <p>返回的分页大小。</p><p>默认值：20</p>                                                                                           |
| pageNum                | 否  | Integer                                                    | <p>返回的分页数。</p><p>默认值：1</p>                                                                                             |
| tagKeys                | 否  | Array of String                                            | <p>根据标签键进行搜索。</p><p>最长不得超过20个标签键。</p>                                                                                  |
| tags                   | 否  | Array of [Tag](/api-reference/cn/zec/datastructure.md#tag) | <p>根据标签进行搜索。</p><p>最长不得超过20个标签。</p>                                                                                    |

## 3. 响应结果

| 参数名称       | 类型                                                                                       | 描述                                                       |
| ---------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId  | String                                                                                   | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| dataSet    | Array of [AutoSnapshotPolicy](/api-reference/cn/zec/datastructure.md#autosnapshotpolicy) | 查询的自动快照策略数据结果。                                           |
| totalCount | Integer                                                                                  | 符合匹配的总数量。                                                |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 查询策略列表。**

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

Request：
{}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "totalCount": 1,
    "dataSet": [
      {
        "autoSnapshotPolicyId": "<autoSnapshotPolicyId>",
        "zoneId": "asia-east-1a",
        "autoSnapshotPolicyName": "Snapshot-Policy",
        "repeatWeekDays": [
            1,
            2,
            3,
            4,
            5,
            6,
            7
        ],
        "hours": [
            0
        ],
        "retentionDays": 30,
        "diskNum": 1,
        "createTime": "2025-08-21T08:09:30Z",
        "resourceGroup": {
            "resourceGroupId": "<resourceGroupId>",
            "resourceGroupName": "Default Resource Group"
        },
        "diskIdSet": [
            "<diskId>"
        ],
        "tags":null
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](/api-reference/cn/api-introduction/instruction/commonerrorcode.md)

| HTTP状态码 | 错误码 | 说明 |
| ------- | --- | -- |
