Skip to Content

ListAlertRecord - ListAlertRecord

Overview

Get alarm records within a time period

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is ListAlertRecord.Yes
PublicKeystringThe user’s public key can be obtained from ConsoleYes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.Yes
StartAtintStartAt,Query the alarm record start time (does not support querying data one year before the current time), Value is a 10 digit timestamp
Yes
EndAtintEndAt,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 timestampYes
FuzzystringFuzzy query (supports fuzzy search of resourceID and alarm content)No
Filter.ProductTypes.NintProductID, accurately search for corresponding alarm records based on product type, SeeProduct IntroduceNo
Filter.Levels.NstringAlarm level, accurately search for corresponding alarm records according to the alarm level, The enumeration values are: P0, P1, P2, P3No
Filter.Status.NstringAlarm status, accurately search for corresponding alarm records based on the alarm status,The enumeration values are: firing,resolvedNo
OrderTypestringSorting (by default, in reverse order of alarm occurrence time), The enumeration values are: asc,descNo
LimitintThe query returns the number of items,default value is 300, maximum value: 300.No
OffsetintData Offset (Default 0)
No

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
Dataarray[AlertRecord]Alarm data setNo
TotalCountintAlarm total countNo

Data Model

AlertRecord

Field NameTypeDescription InformationRequired
RegionstringRegionNo
RecordIDintAlert Record RecordIDNo
ProjectIDintProjectIDNo
StrategyNamestringAlarm Record Trigger Alarm Strategy NameNo
ProductTypeintProduct TypeNo
ProductNamestringProduct Type NameNo
ResourceIDstringResource IDNo
MetricIDintMetric IDNo
MetricNamestringMetric NameNo
UnitNamestringUnit NameNo
StrategyIDintAlarm Record Triggered Alarm Strategy IdNo
RuleIDintAlarm Record Triggered Alarm Rule IdNo
Tagarray[string]Alert TagNo
ValueintAlert Current ValueNo
ThresholdCompareintAlert Threshold CompareNo
ThresholdValueintAlert Threshold ValueNo
ShieldRuleIDintAlarm shielding rule id (if a shielding rule is configured and conditions are met)No
LevelstringAlarm LevelNo
StatusstringAlarm StatusNo
StartAtintAlarm Trigger TimeNo
EndAtintAlarm Recovery TimeNo

Example

Request Example

https://api.surfercloud.com/?Action=ListAlertRecord &Region=cn-zj &Zone=cn-zj-01 &ProjectId=lHbpbCJv &RecordID=1 &StartAt=4 &EndAt=7 &Fuzzy=hAVEfaDE &RecordID=6 &StartAt=5 &EndAt=8 &Fuzzy=jVymouaW &Fuzzy=WYjEKfyo &Filter.ProductTypes.N=6 &Filter.Levels.N=lxexxlZh &Filter.Status.N=wakzNxlZ &OrderType=JXKKXtZY &Limit=3 &Offset=3

Response Example

{ "Action": "ListAlertRecordResponse", "Data": [ { "IsShield": false, "Level": "P2", "MetricID": 13333, "MetricName": "CPU使用率", "ProductName": "云主机", "ProductType": 1, "ProjectID": 23332, "RecordID": 1111, "Region": "cn-bj2", "ResourceID": "uhost-xxx", "RuleID": 1234, "ShieldRuleID": 0, "StartAt": 1755104487, "Status": "firing", "StrategyID": 3333, "StrategyName": "资源组告警", "Tag": [], "ThresholdCompare": 1, "ThresholdValue": 0, "UnitName": "%", "Value": 0, "Zone": "cn-bj2-05" } ], "RetCode": 0, "TotalCount": 1, "TraceId": "217e6c67-9c34-4c48-8c0e-c4ab7380e51c" }