调用API DescribeAlarms查询报警任务信息,及时了解已有报警任务的配置和监控项数据的变化趋势,帮助您实时发现系统资源异常,确保系统的稳定性和可靠性。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 |
类型 |
是否必选 |
示例值 |
描述 |
名称 |
类型 |
是否必选 |
示例值 |
描述 |
Action | String | 是 | DescribeAlarms | 系统规定参数。取值:DescribeAlarms。 |
RegionId | String | 是 | cn-qingdao | 报警任务所属地域的ID。 |
ScalingGroupId | String | 否 | asg-bp18p2yfxow2dloq**** | 报警任务关联的伸缩组的ID。 |
AlarmTaskId | String | 否 | asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1**** | 报警任务ID。 |
State | String | 否 | OK | 报警任务的状态。取值范围:
|
IsEnable | Boolean | 否 | true | 报警任务是否启用。取值范围:
|
MetricType | String | 否 | system | 监控项类型。取值范围:
|
MetricName | String | 否 | CpuUtilization | 监控项名称。 |
PageSize | Integer | 否 | 10 | 分页查询时设置的每页行数。最大值:50。 默认值:10。 |
PageNumber | Integer | 否 | 1 | 报警任务列表的页码。起始值:1。 默认值:1。 |
返回数据
示例
请求示例
http(s)://ess.aliyuncs.com/?Action=DescribeAlarms
&RegionId=cn-qingdao
&ScalingGroupId=asg-bp18p2yfxow2dloq****
&AlarmTaskId=asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****
&State=OK
&IsEnable=true
&MetricType=system
&MetricName=CpuUtilization
&PageSize=10
&PageNumber=1
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeAlarmsResponse>
<PageSize>10</PageSize>
<RequestId>871C7C53-34A4-45AA-8C14-4B72FA6A****</RequestId>
<PageNumber>1</PageNumber>
<TotalCount>2</TotalCount>
<AlarmList>
<AlarmTaskId>asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****</AlarmTaskId>
<MetricName>CpuUtilization</MetricName>
<EvaluationCount>3</EvaluationCount>
<State>ALARM</State>
<Period>300</Period>
<ScalingGroupId>asg-bp18p2yfxow2dloq****</ScalingGroupId>
<ComparisonOperator>>=</ComparisonOperator>
<Effective>* * * * * ?</Effective>
<Description>Test alarm task.</Description>
<MetricType>system</MetricType>
<Name>TestAlarmTask</Name>
<Threshold>80</Threshold>
<Enable>true</Enable>
<Statistics>Average</Statistics>
<Dimensions>
<DimensionKey>device</DimensionKey>
<DimensionValue>eth0</DimensionValue>
</Dimensions>
<AlarmActions>ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****</AlarmActions>
<Expressions>
<MetricName>CpuUtilization</MetricName>
<ComparisonOperator>>=</ComparisonOperator>
<Period>900</Period>
<Statistics>Average</Statistics>
<Threshold>40</Threshold>
</Expressions>
<ExpressionsLogicOperator>&&</ExpressionsLogicOperator>
</AlarmList>
</DescribeAlarmsResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"PageSize" : 10,
"RequestId" : "871C7C53-34A4-45AA-8C14-4B72FA6A****",
"PageNumber" : 1,
"TotalCount" : 2,
"AlarmList" : [ {
"AlarmTaskId" : "asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****",
"MetricName" : "CpuUtilization",
"EvaluationCount" : 3,
"State" : "ALARM",
"Period" : 300,
"ScalingGroupId" : "asg-bp18p2yfxow2dloq****",
"ComparisonOperator" : ">=",
"Effective" : "* * * * * ?",
"Description" : "Test alarm task.",
"MetricType" : "system",
"Name" : "TestAlarmTask",
"Threshold" : 80,
"Enable" : true,
"Statistics" : "Average",
"Dimensions" : [ {
"DimensionKey" : "device",
"DimensionValue" : "eth0"
} ],
"AlarmActions" : [ "ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh****" ],
"Expressions" : [ {
"MetricName" : "CpuUtilization",
"ComparisonOperator" : ">=",
"Period" : 900,
"Statistics" : "Average",
"Threshold" : 40
} ],
"ExpressionsLogicOperator" : "&&"
} ]
}
错误码
访问错误中心查看更多错误码。
该文章对您有帮助吗?
- 本页导读 (1)
- 调试
- 请求参数
- 返回数据
- 示例
- 错误码