調用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。 |
返回資料
名稱 |
類型 |
樣本值 |
描述 |
| PageSize | Integer | 10 | 每頁行數。 |
| RequestId | String | 871C7C53-34A4-45AA-8C14-4B72FA6A**** | 請求ID。 |
| PageNumber | Integer | 1 | 當前頁碼。 |
| TotalCount | Integer | 2 | 警示任務的總數。 |
| AlarmList | Array of Alarm | 警示任務的列表。 |
|
| Alarm | |||
| AlarmTaskId | String | asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1**** | 警示任務ID。 |
| MetricName | String | CpuUtilization | 監控項名稱。可能值:
更多資訊,請參見系統監控警示任務。 |
| EvaluationCount | Integer | 3 | 觸發執行伸縮規則需要滿足閾值運算式的次數,例如,CPU使用率平均值3次的統計結果均大於等於80%。 |
| State | String | ALARM | 警示任務的狀態。可能值:
|
| Period | Integer | 300 | 統計監控項資料的周期,單位為秒。可能值:
說明 僅ECS類型的伸縮組支援設定15秒的統計周期。 |
| ScalingGroupId | String | asg-bp18p2yfxow2dloq**** | 警示任務關聯的伸縮組的ID。 |
| ComparisonOperator | String | >= | 監控項統計值與閾值的比較符,用於指定監控項統計值與閾值在什麼關係下滿足條件。可能值:
|
| Effective | String | * * * * * ? | 指定警示任務的生效時間段。 |
| Description | String | Test alarm task. | 警示任務的描述。 |
| MetricType | String | system | 監控項類型。可能值:
|
| Name | String | TestAlarmTask | 警示任務的名稱。 |
| Threshold | Float | 80.0 | 監控指標的閾值,滿足閾值運算式達到指定次數即觸發執行伸縮規則。 |
| Enable | Boolean | true | 警示任務是否啟用。可能值:
|
| Statistics | String | Average | 統計監控項資料的方法。可能值:
|
| Dimensions | Array of Dimension | 監控項關聯的維度資訊。 |
|
| Dimension | |||
| DimensionKey | String | device | 監控項關聯的維度資訊鍵,可能值:
|
| DimensionValue | String | eth0 | 監控項關聯的維度資訊值,可能值由維度資訊鍵決定。
-
|
| AlarmActions | Array of String | ari:acs:ess:cn-hangzhou:1406926474****:scalingrule/asr-bp163l21e07uh**** | 警示任務關聯伸縮規則的唯一識別碼的列表。 |
| Expressions | Array of Expression | 多指標警示規則的相關資訊。 |
|
| Expression | |||
| MetricName | String | CpuUtilization | 多指標警示規則的監控指標名稱。可能值:
更多資訊,請參見系統監控警示任務。 |
| ComparisonOperator | String | >= | 多指標警示規則的監控項統計值與閾值的比較符,用於指定監控項統計值與閾值在什麼關係下滿足條件。可能值:
預設值:>=。 |
| Period | Integer | 900 | 多指標警示規則中統計監控項資料的周期,單位為秒。可能值:
說明 僅ECS類型的伸縮組支援設定15秒的統計周期。 |
| Statistics | String | Average | 多指標警示規則中統計監控項資料的方法。可能值:
|
| Threshold | Float | 40.0 | 多指標警示規則中監控指標的閾值,滿足閾值運算式達到指定次數即觸發執行伸縮規則。 |
| ExpressionsLogicOperator | String | && | 多指標警示條件之間的關係。可能值:
|
樣本
請求樣本
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" : "&&"
} ]
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。