# Get the list of alarm strategies - ListAlertStrategy

## Overview

Get the list of alarm strategies






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `ListAlertStrategy`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.scloudsg.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |**Yes**|
| **Fuzzy** | string | Fuzzy query (supports fuzzy search of alarm strategy names) |No|
| **Filter.ProductTypes.N** | int | ProductID， See[Product Introduce](https://docs.ucloud.cn/cloudwatch/metric/intro) |No|
| **Filter.AlertStrategyIDs.N** | int | Alarm strategy id, get the alarm strategy list based on strategy id |No|
| **Filter.Status.N** | int | Alarm strategy status, accurately search for the corresponding alarm strategy based on the alarm strategy status, The enumeration values are: 0-diable,1-enable |No|
| **Resources.N** | string | Resource id collection, return the bound alarm strategy list according to the resource id |No|
| **Limit** | int | The query returns the number of items，default value is 300, maximum value: 300. |No|
| **Offset** | int | Data Offset (Default 0)<br /> |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **Data** | array[[*AlertStrategy*](#alertstrategy)] | alarm strategy set |No|
| **TotalCount** | int | Total number of alarm strategy |No|
| **TraceId** | string | trace ID |No|

#### Data Model


#### AlertStrategy

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RuleSet** | array[[*AlertRule*](#alertrule)] | Alarm Rule Set |No|
| **AlertStrategyID** | int | Alert Strategy Id |No|
| **Name** | string | Alarm Strategy Name |No|
| **ProductType** | int | Resource Type |No|
| **ProductKey** | string | Resource Type Name |No|
| **ConfigMode** | int | Alarm rule configuration type (based on template configuration, based on manual configuration) |No|
| **TemplateId** | int | Template Id |No|
| **NotifyType** | string | Notification Method (Notification Group: group, Notified Person: user) |No|
| **NotifyUserIDs** | array[int] | Notifier User ID Collection |No|
| **NotifyGroupIDs** | array[int] | Notification group ID collection |No|
| **NotifyChannelDs** | array[string] | Notification Channels ('email', 'sms', 'webhook') |No|
| **CallbackLanguage** | string | Callback Language (cn, en) |No|
| **CallbackUrls** | array[string] | Callback URL |No|
| **Status** | int | Alarm Strategy Status |No|
| **Remark** | string | Alarm Strategy Remarks |No|
| **CreatedBy** | string | Creator |No|
| **UpdatedBy** | string | Updater |No|
| **CreatedAt** | int | Creation Time |No|
| **UpdatedAt** | int | Update Time |No|

#### AlertRule

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RuleID** | int | Rule ID |No|
| **MetricID** | int | Rule Metric ID. Refer to the list of metrics returned under this type of product GetProductMetrics |No|
| **MetricName** | string | Metric Name |No|
| **ThresholdCompare** | int | Threshold comparison method.<br />Enumeration value comparison method: <br />1->=<br />2-<= <br />3-> <br />4-< <br />5-== <br />6-!= |No|
| **ThresholdValue** | float | Alert Rule ThresholdValue |No|
| **TriggerCount** | int | Trigger Count |No|
| **SendPeriodType** | string | Trigger Cycle. Enum values: continuous Continuous, exponent Exponential, single Non-repetitive |No|
| **SendInterval** | int | Send Interval |No|
| **Level** | string | Alarm Level |No|
| **Status** | int | Alarm Status(0:off 1on) |No|
| **UnitID** | int | Unit ID |No|
| **UnitName** | string | Unit Name |No|

## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=ListAlertStrategy
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=tDITIKFv
&Fuzzy=lDkAENja
&Filter.ProductTypes.N=9
&Filter.Status.N=5
&Limit=7
&Offset=3
&Resources.N=DuWSrHhi
&Filter.AlertStrategyIDs.N=7
```

### Response Example
    
```json
{
  "Action": "ListAlertStrategyResponse",
  "Data": [
    {
      "AlertStrategyID": 111,
      "CallbackLanguage": "cn",
      "CallbackUrls": [
        "https://www.test.com/callback"
      ],
      "CompanyID": 111,
      "ConfigMode": 1,
      "CreatedAt": 1755104421,
      "CreatedBy": "creator@test.com",
      "Name": "资源组告警",
      "NotifyChannelDs": [
        "webhook"
      ],
      "NotifyGroupIDs": [],
      "NotifyType": "group",
      "NotifyUserIDs": [],
      "ObjectType": 2,
      "ProductKey": "uhost",
      "ProductType": 1,
      "ProjectID": 12333,
      "Remark": "",
      "ResourceGroupIDs": [],
      "Resources": [],
      "RuleSet": [
        {
          "Level": "P2",
          "MetricID": 123312,
          "MetricName": "CPU使用率",
          "RuleID": 2223,
          "SendInterval": 2,
          "SendPeriodType": "continuous",
          "Status": 1,
          "ThresholdCompare": 1,
          "ThresholdValue": 0,
          "TriggerCount": 1,
          "UnitID": 32,
          "UnitName": "%"
        }
      ],
      "Status": 0,
      "StrategyType": 1,
      "Tags": [],
      "TemplateId": 0,
      "UpdatedAt": 1755142910,
      "UpdatedBy": "creator@test.com"
    }
  ],
  "RetCode": 0,
  "TotalCount": 1,
  "TraceId": "a1c26582-571a-49db-a841-d4b738472008"
}
```





