# ListAlertStrategyTemplate - ListAlertStrategyTemplate

## Overview

ListAlertStrategyTemplate






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `ListAlertStrategyTemplate`.                      | **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. Leave blank for the default project; sub-accounts must fill in. Please refer to [GetProjectList API](/docs/api/summary/get_project_list) |**Yes**|
| **Filter.TemplateIDs.N** | int | Template id collection, get the alert template list according to the template 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) |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[[*ListAlertTemplate*](#listalerttemplate)] | Alert Template List |No|
| **TotalCount** | int | TotalCount |No|

#### Data Model


#### ListAlertTemplate

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **CompanyID** | int | company id |No|
| **TemplateID** | int | template id |No|
| **Name** | string | Template Name |No|
| **ProductType** | int | ProductType |No|
| **ProductKey** | string | ProductKey |No|
| **RuleSet** | array[[*AlertRule*](#alertrule)] | RuleSet |No|
| **Remark** | string | Remark |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=ListAlertStrategyTemplate
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=WlvKlnLL
&ProjectId=kaGOEwqa
&Filter.TemplateIDs.N=8
&Limit=9
&Offset=7
```

### Response Example
    
```json
{
  "Action": "ListAlertStrategyTemplateResponse",
  "Data": [
    {
      "CompanyID": 4,
      "Name": "dnJZlrWA",
      "ProductKey": "RwmwuAAp",
      "ProductType": 9,
      "Remark": "tNWQKTXr",
      "RuleSet": [
        {
          "Level": "cQBWjaRy",
          "MetricID": 3,
          "MetricName": "HbmMUMkx",
          "RuleID": 7,
          "SendInterval": 2,
          "SendPeriodType": "rUXdydLC",
          "Status": 3,
          "ThresholdCompare": 1,
          "ThresholdValue": 1.86358,
          "TriggerCount": 8
        }
      ],
      "TemplateID": 9
    }
  ],
  "Message": "uIxKeOnd",
  "RetCode": 0,
  "TotalCount": 6
}
```





