# CreateAlertStrategyTemplate - CreateAlertStrategyTemplate

## Overview

CreateAlertStrategyTemplate






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateAlertStrategyTemplate`.                      | **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**|
| **Name** | string | Template Name |**Yes**|
| **ProductKey** | string | ProductKey， See[Product Introduce](https://docs.ucloud.cn/cloudwatch/metric/intro) |**Yes**|
| **RuleSet.N.MetricID** | int | Rule Metric ID. Refer to the metric list returned under this type of product GetProductMetrics |**Yes**|
| **RuleSet.N.ThresholdCompare** | int | Threshold comparison method.<br />Enumeration value comparison method: <br />1：>= <br />2：<= <br />3：> <br />4：< <br />5：== <br />6：!= |**Yes**|
| **RuleSet.N.ThresholdValue** | int | Alert Rule ThresholdValue |**Yes**|
| **RuleSet.N.TriggerCount** | int | Alert Rule TriggerCount |**Yes**|
| **RuleSet.N.SendPeriodType** | string | Trigger SendPeriodType. Enumeration value: <br />continuous <br />exponent <br />single |**Yes**|
| **RuleSet.N.Level** | string | Alert level. Enumeration value: P0, P1, P2, P3 |**Yes**|
| **RuleSet.N.Status** | int | Alert Rule Status  |**Yes**|
| **RuleSet.N.SendInterval** | int | <br />Silent period (required when the alarm period is set to Continuous) |No|
| **Remark** | string | Remark |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** | [*AlertTemplate*](#alerttemplate) | Create Alert Template Return Object |No|

#### Data Model


#### AlertTemplate

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **TemplateID** | int | Alert Template ID |**Yes**|

## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=CreateAlertStrategyTemplate
&ProjectId=pTKUYkHe
&Name=IFqEXhrk
&ProductKey=tIEzPRln
&RuleSet.N.MetricID=8
&RuleSet.N.ThresholdCompare=1
&RuleSet.N.ThresholdValue=1
&RuleSet.N.TriggerCount=6
&RuleSet.N.SendPeriodType=rQFwFYOx
&RuleSet.N.Level=zPfiXYdy
&RuleSet.N.Status=4
&RuleSet.N.SendInterval=8
&Remark=KvhtYeRp
```

### Response Example
    
```json
{
  "Action": "CreateAlertStrategyTemplateResponse",
  "Data": {},
  "RetCode": 0
}
```





