# CreateAlertStrategy - CreateAlertStrategy

## Overview

CreateAlertStrategy






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateAlertStrategy`.                      | **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 the [GetProjectList API](/docs/api/summary/get_project_list) |**Yes**|
| **Name** | string | Alert Strategy Name |**Yes**|
| **ProductKey** | string | ProductKey， See[Product Introduce](https://docs.ucloud.cn/cloudwatch/metric/intro) |**Yes**|
| **ObjectType** | int | ObjectType |**Yes**|
| **ConfigMode** | int | ConfigMode |**Yes**|
| **Resources.N** | string | Resources |No|
| **ResourceGroupIDs.N** | int | ResourceGroupIDs |No|
| **TemplateId** | int | TemplateId |No|
| **RuleSet.N.MetricID** | int | Rule Metric ID. Refer to the list of metrics returned under this type of product GetProductMetrics |No|
| **RuleSet.N.ThresholdCompare** | int | Threshold comparison method. Enumeration value comparison method:<br />1：>= <br />2：<= <br />3：> <br />4：< <br />5：== <br />6：!= |No|
| **RuleSet.N.ThresholdValue** | int | Alert Rule ThresholdValue |No|
| **RuleSet.N.TriggerCount** | int | Alert Rule TriggerCount |No|
| **RuleSet.N.SendPeriodType** | string | Trigger cycle. Enumeration values: continuous Continuous, exponent Exponential, single Non-repeating |No|
| **RuleSet.N.Level** | string | Alert level. Enumeration value: P0, P1, P2, P3 |No|
| **RuleSet.N.Status** | int | Alert Rule Status |No|
| **RuleSet.N.SendInterval** | int | Silent period (required when the alarm period is set to Continuous) |No|
| **NotifyType** | string | NotifyType |No|
| **NotifyUserIDs.N** | int | NotifyUserIDs |No|
| **NotifyGroupIDs.N** | int | NotifyGroupIDs |No|
| **NotifyChannelDs.N** | string | NotifyChannelDs |No|
| **CallbackLanguage** | string | CallbackLanguage |No|
| **CallbackUrls.N** | string | CallbackUrls |No|
| **NotifyTemplateId** | string | notify template id |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** | [*AlertStrategyId*](#alertstrategyid) | Create Alert Strategy Return Object |No|

#### Data Model


#### AlertStrategyId

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **AlertStrategyID** | int | AlertStrategyId |No|

## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=CreateAlertStrategy
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=wQzVpMKH
&Name=aMtbGsoi
&ProductKey=aimMEstF
&ObjectType=cVlUqdlo
&Name=CEyaaxRn
&ProductKey=cMfAOPHv
&ObjectType=qIlyxnMl
&Resources=GHMEDxZd
&ResourceGroupIDs=NtMeYivb
&Tags=gAUnBrer
&ConfigMode=shiTfGjt
&TemplateId=ejKhnjxe
&RuleSet=RLErYqsa
&NotifyType=YpYuSZaR
&NotifyUserIDs=GmJRfOnL
&NotifyGroupIDs=sDkHomlx
&NotifyChannelDs=vcqcBLDy
&CallbackLanguage=WjVxebho
&CallbackUrls=JpBIGAiC
&Tags.N.Operator=iIvLyhfR
&Tags.N.Values.N.0=dvkInIoI
&RuleSet.N.ThresholdCompare=7
&RuleSet.N.ThresholdValue=7
&RuleSet.N.TriggerCount=2
&RuleSet.N.SendPeriodType=QpKiRoKU
&RuleSet.N.Level=jFTScowr
&RuleSet.N.Status=8
&RuleSet.N.SendInterval=2
&NotifyTemplateId=qQmXuJaB
```

### Response Example
    
```json
{
  "Action": "CreateAlertStrategyResponse",
  "Data": {
    "AlertStrategyId": 1
  },
  "RetCode": 0
}
```





