# DescribePolicys

## 1. API Description

This API (DescribePolicys) is used to get a list of protection strategies.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type                                                                                      | Description                                                                                                                  |
| -------------- | -------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| policyIds      | No       | Array of String                                                                           | <p>Filter by the list of protection strategy IDs.</p><p>You can query up to 100 protection strategy IDs in each request.</p> |
| policyName     | No       | String                                                                                    | <p>Filter by the protection strategy name.</p><p>This field supports fuzzy search.</p>                                       |
| pageSize       | No       | Integer                                                                                   | <p>Number of items in the current page result.</p><p>Default: 20.</p><p>Default value: 20</p>                                |
| pageNum        | No       | Integer                                                                                   | <p>Number of pages returned.</p><p>Default value: 1</p>                                                                      |
| tagKeys        | No       | Array of String                                                                           | <p>Search by tag key.</p><p>You can query up to 20 tag keys in each request.</p>                                             |
| tags           | No       | Array of [Tag](https://docs.console.zenlayer.com/api-reference/compute/datastructure#tag) | <p>Search by tag.</p><p>You can query up to 20 tags in each request.</p>                                                     |

## 3. Output Parameters

| Parameter Name | Type                                                                                                    | Description                                                                                                           |
| -------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                                                  | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| totalCount     | Integer                                                                                                 | Number of disks meeting the filtering conditions.                                                                     |
| dataSet        | Array of [PolicyInfo](https://docs.console.zenlayer.com/api-reference/compute/datastructure#policyinfo) | Data for the list of protection strategies.                                                                           |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Get a list of protection strategies.**

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

Request：
{
    "policyIds": ["policyId1","policyId2"],
    "name": "xxxx",
    "pageSize": 10,
    "pageNum": 1
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "totalCount": 1,
    "dataSet": [
        {
            "policyId": "<policyId>",
            "policyName": "policyName",
            "resourceGroupId": "<resourceGroupId>",
            "resourceGroupName": "Default Resource Group",
            "createTime": "2025-05-01T01:01:01Z",
            "tags":null
          }
      ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/api-reference/api-introduction/toolkit/api-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/api-reference/api-introduction/instruction/commonerrorcode).

| HTTP Status Code | Error Code | Description |
| ---------------- | ---------- | ----------- |
