# ListAlertRecord - ListAlertRecord

## Overview

Get alarm records within a time period






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `ListAlertRecord`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.surfercloud.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**|
| **StartAt** | int | StartAt，Query the alarm record start time (does not support querying data one year before the current time), Value is a 10 digit timestamp |**Yes**|
| **EndAt** | int | EndAt，Query the end time of the alarm record (the interval between the end time and the start time cannot exceed one month), Value is a 10 digit timestamp |**Yes**|
| **Fuzzy** | string | Fuzzy query (supports fuzzy search of resourceID and alarm content) |No|
| **Filter.ProductTypes.N** | int | ProductID, accurately search for corresponding alarm records based on product type， See[Product Introduce](https://docs.ucloud.cn/cloudwatch/metric/intro) |No|
| **Filter.Levels.N** | string | Alarm level, accurately search for corresponding alarm records according to the alarm level, The enumeration values are: P0, P1, P2, P3 |No|
| **Filter.Status.N** | string | Alarm status, accurately search for corresponding alarm records based on the alarm status，The enumeration values are: firing，resolved |No|
| **OrderType** | string | Sorting (by default, in reverse order of alarm occurrence time), The enumeration values are: asc,desc |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[[*AlertRecord*](#alertrecord)] | Alarm data set |No|
| **TotalCount** | int | Alarm total count |No|

#### Data Model


#### AlertRecord

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region |No|
| **RecordID** | int | Alert Record RecordID |No|
| **ProjectID** | int | ProjectID |No|
| **StrategyName** | string | Alarm Record Trigger Alarm Strategy Name |No|
| **ProductType** | int | Product Type |No|
| **ProductName** | string | Product Type Name |No|
| **ResourceID** | string | Resource ID |No|
| **MetricID** | int | Metric ID |No|
| **MetricName** | string | Metric Name |No|
| **UnitName** | string | Unit Name |No|
| **StrategyID** | int | Alarm Record Triggered Alarm Strategy Id |No|
| **RuleID** | int | Alarm Record Triggered Alarm Rule Id |No|
| **Tag** | array[string] | Alert Tag |No|
| **Value** | int | Alert Current Value |No|
| **ThresholdCompare** | int | Alert Threshold Compare |No|
| **ThresholdValue** | int | Alert Threshold Value |No|
| **ShieldRuleID** | int | Alarm shielding rule id (if a shielding rule is configured and conditions are met) |No|
| **Level** | string | Alarm Level |No|
| **Status** | string | Alarm Status |No|
| **StartAt** | int | Alarm Trigger Time |No|
| **EndAt** | int | Alarm End Time |No|
| **ContentAttrList** | array[[*ContentAttrItem*](#contentattritem)] | Additional product attributes list |No|

#### ContentAttrItem

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Key** | string | Key |No|
| **Value** | string | Value |No|

## Example

### Request Example
    
```
https://api.surfercloud.com/?Action=ListAlertRecord
&ProjectId=rUrflzQM
&StartAt=7
&EndAt=5
&Fuzzy=vvLUeMEW
&Filter.ProductTypes.N=5
&Filter.Levels.N=QkBHiEdM
&Filter.Status.N=ABHpgWqC
&OrderType=oJIlivxI
&Limit=2
&Offset=5
```

### Response Example
    
```json
{
  "Action": "ListAlertRecordResponse",
  "Data": [
    {
      "ContentAttrList": [
        {
          "Key": "cMnEFLXx",
          "Value": "DHEWfGuJ"
        }
      ],
      "EndAt": 1786645900,
      "Level": "P2",
      "MetricID": 2,
      "MetricName": "QtNBvaDl",
      "ProductName": "UHost",
      "ProductType": 1,
      "ProjectID": 0,
      "RecordID": 5,
      "Region": "ShFuYpCl",
      "ResourceID": "eTClVBZb",
      "RuleID": 3,
      "ShieldRuleID": 0,
      "StartAt": 1786635900,
      "Status": "firing",
      "StrategyID": 3,
      "StrategyName": "BBItLUMH",
      "Tag": [
        "zGJLxima"
      ],
      "ThresholdCompare": 1,
      "ThresholdValue": 0,
      "UnitName": "bAKKDqbA",
      "Value": 1
    }
  ],
  "RetCode": 0,
  "TotalCount": 1
}
```





