Skip to Content
Cloud Monitor(CloudWatch)ListAlertStrategy

Get the list of alarm strategies - ListAlertStrategy

Overview

Get the list of alarm strategies

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is ListAlertStrategy.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
FuzzystringFuzzy query (supports fuzzy search of alarm strategy names)No
Filter.ProductTypes.NintProductID, SeeProduct IntroduceNo
Filter.AlertStrategyIDs.NintAlarm strategy id, get the alarm strategy list based on strategy idNo
Filter.Status.NintAlarm strategy status, accurately search for the corresponding alarm strategy based on the alarm strategy status, The enumeration values are: 0-diable,1-enableNo
Resources.NstringResource id collection, return the bound alarm strategy list according to the resource idNo
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[AlertStrategy]alarm strategy setNo
TotalCountintTotal number of alarm strategyNo
TraceIdstringtrace IDNo

Data Model

AlertStrategy

Field NameTypeDescription InformationRequired
RuleSetarray[AlertRule]Alarm Rule SetNo
AlertStrategyIDintAlert Strategy IdNo
NamestringAlarm Strategy NameNo
ProductTypeintResource TypeNo
ProductKeystringResource Type NameNo
ConfigModeintAlarm rule configuration type (based on template configuration, based on manual configuration)No
TemplateIdintTemplate IdNo
NotifyTypestringNotification Method (Notification Group: group, Notified Person: user)No
NotifyUserIDsarray[int]Notifier User ID CollectionNo
NotifyGroupIDsarray[int]Notification group ID collectionNo
NotifyChannelDsarray[string]Notification Channels (‘email’, ‘sms’, ‘webhook’)No
CallbackLanguagestringCallback Language (cn, en)No
CallbackUrlsarray[string]Callback URLNo
StatusintAlarm Strategy StatusNo
RemarkstringAlarm Strategy RemarksNo
CreatedBystringCreatorNo
UpdatedBystringUpdaterNo
CreatedAtintCreation TimeNo
UpdatedAtintUpdate TimeNo

AlertRule

Field NameTypeDescription InformationRequired
RuleIDintRule IDNo
MetricIDintRule Metric ID. Refer to the list of metrics returned under this type of product GetProductMetricsNo
MetricNamestringMetric NameNo
ThresholdCompareintThreshold comparison method.
Enumeration value comparison method:
1->=
2-<=
3->
4-<
5-==
6-!=
No
ThresholdValuefloatAlert Rule ThresholdValueNo
TriggerCountintTrigger CountNo
SendPeriodTypestringTrigger Cycle. Enum values: continuous Continuous, exponent Exponential, single Non-repetitiveNo
SendIntervalintSend IntervalNo
LevelstringAlarm LevelNo
StatusintAlarm Status(0:off 1on)No
UnitIDintUnit IDNo
UnitNamestringUnit NameNo

Example

Request Example

https://api.surfercloud.com/?Action=ListAlertStrategy &Region=cn-zj &Zone=cn-zj-01 &ProjectId=tDITIKFv &Fuzzy=lDkAENja &Filter.ProductTypes.N=9 &Filter.Status.N=5 &Limit=7 &Offset=3 &Resources.N=DuWSrHhi &Filter.AlertStrategyIDs.N=7

Response Example

{ "Action": "ListAlertStrategyResponse", "Data": [ { "AlertStrategyID": 111, "CallbackLanguage": "cn", "CallbackUrls": [ "https://www.test.com/callback" ], "CompanyID": 111, "ConfigMode": 1, "CreatedAt": 1755104421, "CreatedBy": "creator@test.com", "Name": "资源组告警", "NotifyChannelDs": [ "webhook" ], "NotifyGroupIDs": [], "NotifyType": "group", "NotifyUserIDs": [], "ObjectType": 2, "ProductKey": "uhost", "ProductType": 1, "ProjectID": 12333, "Remark": "", "ResourceGroupIDs": [], "Resources": [], "RuleSet": [ { "Level": "P2", "MetricID": 123312, "MetricName": "CPU使用率", "RuleID": 2223, "SendInterval": 2, "SendPeriodType": "continuous", "Status": 1, "ThresholdCompare": 1, "ThresholdValue": 0, "TriggerCount": 1, "UnitID": 32, "UnitName": "%" } ], "Status": 0, "StrategyType": 1, "Tags": [], "TemplateId": 0, "UpdatedAt": 1755142910, "UpdatedBy": "creator@test.com" } ], "RetCode": 0, "TotalCount": 1, "TraceId": "a1c26582-571a-49db-a841-d4b738472008" }