調用DescribeAlertLogList介面查詢警示歷史。
介面說明
該介面只能查詢到最近一年的警示歷史。
本文將提供一個樣本,從雲產品product維度查詢Elastic Compute Service 的警示歷史。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cms:DescribeAlertLogList |
get |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| StartTime |
integer |
否 |
查詢警示歷史的開始時間戳。 單位:毫秒。 您只能查詢最近一年的警示歷史,如果查詢時間大於一年,則參數 說明
開始時間( |
1609988009694 |
| EndTime |
integer |
否 |
查詢警示歷史的結束時間戳記。 單位:毫秒。 您只能查詢最近一年的警示歷史,如果查詢時間大於一年,則參數 說明
開始時間( |
1610074409694 |
| PageNumber |
integer |
否 |
頁碼。 預設值:1。 |
1 |
| PageSize |
integer |
否 |
分頁大小。 預設值:10。 |
10 |
| SearchKey |
string |
否 |
查詢警示歷史的搜尋索引鍵。 |
alert |
| GroupId |
string |
否 |
應用分組 ID。 |
7301**** |
| Namespace |
string |
否 |
雲產品的命名空間。 說明
關於雲產品的命名空間,請參見雲產品監控項。 |
acs_ecs_dashboard |
| Product |
string |
否 |
雲產品名稱縮寫。 關於如何擷取雲產品名稱縮寫,請參見 DescribeProductsOfActiveMetricRule 。 |
ECS |
| Level |
string |
否 |
警示的層級和通知方式。取值:
|
P4 |
| SendStatus |
string |
否 |
警示狀態。取值:
當警示狀態為 0 時,如果 Level 的取值為 P4,則發生警示;如果 Level 的取值為 OK,則警示恢複正常。 |
0 |
| ContactGroup |
string |
否 |
警示連絡人群組。 |
ECS_Group |
| RuleName |
string |
否 |
警示規則名稱。 |
test123 |
| MetricName |
string |
否 |
監控項名稱。 說明
關於雲產品的監控項,請參見雲產品監控項。 |
IntranetInRate |
| LastMin |
string |
否 |
擷取日誌的周期。單位:分鐘。 |
360 |
| GroupBy |
string |
否 |
對資料進行空間維度彙總,相當於 SQL 中的 Group By。取值:
|
product |
| RuleId |
string |
否 |
警示規則 ID。 關於如何查詢警示規則 ID,請參見 DescribeMetricRuleList 。 |
bc369e8_30f87e517ed2fc**** |
| SourceType |
string |
否 |
警示規則類型。取值:METRIC,表示時序指標警示規則。 |
METRIC |
| EventType |
string |
否 |
警示類型。取值:
|
TRIGGERED |
關於公用請求參數的詳情,請參見公用參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
無。 |
||
| RequestId |
string |
請求 ID。 |
1C4A3709-BF52-42EE-87B5-7435F0929585 |
| Success |
boolean |
操作是否成功。取值:
|
true |
| Code |
string |
狀態代碼。 說明
200 表示成功。 |
200 |
| Message |
string |
錯誤資訊。 |
The specified resource is not found. |
| PageNumber |
integer |
頁碼。 |
1 |
| PageSize |
integer |
每頁顯示記錄條數。 |
10 |
| AlertLogList |
array<object> |
警示歷史列表。 |
|
|
array<object> |
無。 |
||
| MetricName |
string |
監控項名稱。 |
cpu_total |
| EventName |
string |
事件名稱。 |
IOHang |
| Product |
string |
雲產品標識。取值:
|
ECS |
| BlackListUUID |
string |
命中的警示黑名單 UUID。 |
8410dbbd-7d30-41c5-94cb-**** |
| Message |
string |
警示相關資訊,為一個 JSON 串。 |
{"alertName":"e47aa0ac-4076-44db-a47d-d1083968****_Availability"} |
| Namespace |
string |
雲產品的命名空間。 |
acs_ecs_dashboard |
| LevelChange |
string |
警示層級的變更。取值:
|
P4->OK |
| InstanceId |
string |
資源 ID。 |
i-m5e1qg6uo38rztr4**** |
| RuleName |
string |
警示規則名稱。 |
CPU使用率 |
| RuleId |
string |
警示規則 ID。 |
d582b9e9-b1c1-4f17-9279-0fe7333a****_ResponseTime |
| BlackListName |
string |
命中的警示黑名單名稱。 |
Black_Test |
| GroupName |
string |
應用分組名稱。 |
ECS_Instances |
| GroupId |
string |
應用分組 ID。 |
7301**** |
| AlertTime |
string |
發生警示的時間戳記。 單位:毫秒。 |
1610043776621 |
| InstanceName |
string |
資源名稱。 |
portalHost |
| BlackListDetail |
string |
命中的警示黑名單詳情。 |
{"id":12****,"metricProject":"acs_ecs_dashboard","userId":173651113438****,"uuid":"8410dbbd-7d30-41c5-94cb-****","name":"alert-****","productCategory":"ecs","instances":[{"instanceId":"i-m5e1qg6uo38rztr4****"}],"metrics":null,"scopeType":"USER","scopeValue":"","startTime":"0001-01-01T00:00:00Z","endTime":"9999-12-31T23:59:59.999999999+08:00","effectiveTime":null,"isEnable":true,"status":1,"gmtCreate":"2021-11-02T16:35:59+08:00","gmtModified":"2021-11-02T16:35:59+08:00","loadTime":"2021-11-02T16:36:15.213072177+08:00"} |
| Level |
string |
警示層級和警示通知方式。取值:
|
P4 |
| SendStatus |
string |
警示狀態。取值:
當警示狀態為 0 時,如果 Level 的取值為 P4,則發生警示;如果 Level 的取值為 OK,則警示恢複正常。 |
0 |
| ExtendedInfo |
array<object> |
警示的擴充資訊。 |
|
|
object |
無。 |
||
| Name |
string |
擴充欄位名稱。 |
userId |
| Value |
string |
擴充欄位值。 |
100931896542**** |
| Dimensions |
array<object> |
警示資源的維度。 |
|
|
object |
無。 |
||
| Key |
string |
警示資源的 Key。 |
instanceId |
| Value |
string |
警示資源的 Value。 |
i-m5e1qg6uo38rztr4**** |
| WebhookList |
array<object> |
警示回調的 URL 地址清單。 |
|
|
object |
無。 |
||
| code |
string |
警示回調的狀態代碼。 |
200 |
| url |
string |
警示回調的 URL 地址。 |
https://www.aliyun.com/webhook.html |
| message |
string |
警示回調的返回資訊。 |
success |
| DingdingWebhookList |
array |
警示連絡人的 webhook 地址清單。 |
|
|
string |
警示連絡人的 Webhook 地址清單。 |
https://oapi.dingtalk.com/robot/send?access_token=b7ff24032da1a5f86659ecda46797e13cc1d4e4da6903d7b014ea1d1488b**** |
|
| ContactOnCallList |
array |
警示連絡人的電話通知清單。 |
|
|
string |
警示連絡人的電話通知清單。 說明
該參數僅適用於中國站。 |
1368888**** |
|
| ContactMailList |
array |
警示連絡人的郵件清單。 |
|
|
string |
警示連絡人的郵件清單。 |
username@example.com |
|
| ContactGroups |
array |
警示連絡人群組的列表。 |
|
|
string |
警示連絡人群組。 |
ECS_Group |
|
| ContactALIIWWList |
array |
WangWang警示連絡人清單。 |
|
|
string |
警示連絡人的WangWang列表。 說明
該參數僅適用於中國站。 |
Alice |
|
| ContactSMSList |
array |
警示連絡人的簡訊通知清單。 |
|
|
string |
警示連絡人的簡訊通知清單。 說明
該參數僅適用於中國站。 |
1368888**** |
|
| ContactDingList |
array |
警示連絡人的DingTalk列表。 |
|
|
string |
警示連絡人的DingTalk列表。 |
CloudMonitor |
|
| SendDetail |
object |
警示推送結果詳情。 |
|
| ResultCode |
string |
警示資訊推送狀態。
|
success |
| ChannelResultList |
array<object> |
按警示渠道推送的警示結果清單。 |
|
|
array<object> |
按警示渠道推送的警示結果。 |
||
| Channel |
string |
警示推送渠道。取值:
|
|
| ResultList |
array<object> |
CloudMonitor向警示渠道發送的警示資訊結果清單。 |
|
|
object |
CloudMonitor向警示渠道發送的警示資訊結果。 |
||
| Code |
string |
狀態代碼。
|
200 |
| RequestId |
string |
調用其他雲產品返回的請求 ID。 |
0BDAF8A8-04DC-5F0C-90E4-724D42C4**** |
| Success |
boolean |
調用目標的結果
|
true |
| Detail |
string |
返回結果詳情。 |
{ } |
| notifyTargetList |
array |
渠道通知清單。 |
|
|
string |
渠道通知清單。 |
|
|
| Escalation |
object |
觸發警示的規則。 |
|
| Expression |
string |
觸發警示的規則描述。 說明
警示規則的主體,當監控資料滿足警示條件時,觸發警示規則。 |
$Average<90 |
| Times |
integer |
警示重試次數。 |
1 |
| Level |
string |
警示層級和警示通知方式。取值:
|
P4 |
| SendResultList |
array<object> |
警示的發送結果清單。 |
|
|
object |
警示的發送結果清單。 |
||
| Key |
string |
發送警示渠道。取值:
|
|
| Value |
array |
警示渠道對應的通知對象。 |
|
|
string |
警示渠道對應的通知對象。 |
username@example.com |
|
| LogId |
string |
日誌 ID。 |
7510****::e8a472a0-46ae-4ac0-84b1-e46be368**** |
樣本
正常返回樣本
JSON格式
{
"RequestId": "1C4A3709-BF52-42EE-87B5-7435F0929585",
"Success": true,
"Code": "200",
"Message": "The specified resource is not found.",
"PageNumber": 1,
"PageSize": 10,
"AlertLogList": [
{
"MetricName": "cpu_total",
"EventName": "IOHang",
"Product": "ECS",
"BlackListUUID": "8410dbbd-7d30-41c5-94cb-****",
"Message": "{\"alertName\":\"e47aa0ac-4076-44db-a47d-d1083968****_Availability\"}",
"Namespace": "acs_ecs_dashboard",
"LevelChange": "P4->OK",
"InstanceId": "i-m5e1qg6uo38rztr4****",
"RuleName": "CPU使用率",
"RuleId": "d582b9e9-b1c1-4f17-9279-0fe7333a****_ResponseTime",
"BlackListName": "Black_Test",
"GroupName": "ECS_Instances",
"GroupId": "7301****",
"AlertTime": "1610043776621",
"InstanceName": "portalHost",
"BlackListDetail": "{\"id\":12****,\"metricProject\":\"acs_ecs_dashboard\",\"userId\":173651113438****,\"uuid\":\"8410dbbd-7d30-41c5-94cb-****\",\"name\":\"alert-****\",\"productCategory\":\"ecs\",\"instances\":[{\"instanceId\":\"i-m5e1qg6uo38rztr4****\"}],\"metrics\":null,\"scopeType\":\"USER\",\"scopeValue\":\"\",\"startTime\":\"0001-01-01T00:00:00Z\",\"endTime\":\"9999-12-31T23:59:59.999999999+08:00\",\"effectiveTime\":null,\"isEnable\":true,\"status\":1,\"gmtCreate\":\"2021-11-02T16:35:59+08:00\",\"gmtModified\":\"2021-11-02T16:35:59+08:00\",\"loadTime\":\"2021-11-02T16:36:15.213072177+08:00\"}",
"Level": "P4",
"SendStatus": "0",
"ExtendedInfo": [
{
"Name": "userId",
"Value": "100931896542****"
}
],
"Dimensions": [
{
"Key": "instanceId",
"Value": "i-m5e1qg6uo38rztr4****"
}
],
"WebhookList": [
{
"code": "200",
"url": "https://www.aliyun.com/webhook.html",
"message": "success"
}
],
"DingdingWebhookList": [
"https://oapi.dingtalk.com/robot/send?access_token=b7ff24032da1a5f86659ecda46797e13cc1d4e4da6903d7b014ea1d1488b****"
],
"ContactOnCallList": [
"1368888****"
],
"ContactMailList": [
"username@example.com"
],
"ContactGroups": [
"ECS_Group"
],
"ContactALIIWWList": [
"Alice"
],
"ContactSMSList": [
"1368888****"
],
"ContactDingList": [
"CloudMonitor"
],
"SendDetail": {
"ResultCode": "success",
"ChannelResultList": [
{
"Channel": "MAIL",
"ResultList": [
{
"Code": "200",
"RequestId": "0BDAF8A8-04DC-5F0C-90E4-724D42C4****",
"Success": true,
"Detail": "{ }",
"notifyTargetList": [
"MAIL"
]
}
]
}
]
},
"Escalation": {
"Expression": "$Average<90",
"Times": 1,
"Level": "P4"
},
"SendResultList": [
{
"Key": "MAIL",
"Value": [
"username@example.com"
]
}
],
"LogId": "7510****::e8a472a0-46ae-4ac0-84b1-e46be368****"
}
]
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | ParameterInvalid | Parameter invalid. | 非法參數 |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | |
| 404 | ResourceNotFound | The specified resource is not found. | 未找到指定資源。 |
| 409 | ResourceConflict | Concurrent modification of resources. | |
| 409 | ResourceExist | Resources already exist. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。