呼叫 DescribeSystemEventCount 介面查詢當前帳號下各雲端服務發生事件的數量。
介面說明
背景資訊
您可以呼叫 DescribeSystemEventMetaList ,取得雲端監控支援的各雲端服務及其系統事件。
使用說明
本文將提供一個示例,查詢當前帳號雲端伺服器ECS發生事件的數量,返回結果顯示,發生事件的數量共 3 條。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cms:DescribeSystemEventCount |
get |
*All Resource
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Product |
string |
否 |
雲端服務名稱。 呼叫 DescribeSystemEventMetaList 介面,取得返回參數 |
ECS |
| EventType |
string |
否 |
事件類型。 呼叫 DescribeSystemEventMetaList 介面,取得返回參數 |
StatusNotification |
| Name |
string |
否 |
事件名稱。 呼叫 DescribeSystemEventMetaList 介面,取得返回參數 |
Instance:StateChange |
| Level |
string |
否 |
事件級別。取值:
呼叫 DescribeSystemEventMetaList 介面,取得返回參數 |
Info |
| Status |
string |
否 |
事件狀態。 呼叫 DescribeSystemEventMetaList 介面,取得返回參數 |
Normal |
| GroupId |
string |
否 |
應用分組 ID。 |
17285**** |
| SearchKeywords |
string |
否 |
搜尋事件內容包含的關鍵字。取值:
|
ECS |
| StartTime |
string |
否 |
查詢事件開始的時間戳記。單位:毫秒。 |
1635993541000 |
| EndTime |
string |
否 |
查詢事件結束的時間戳記。單位:毫秒。 |
1635993921000 |
關於公共請求參數的詳情,請參見公共參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| Code |
string |
狀態碼。 說明
200 表示成功。 |
200 |
| Message |
string |
返回資訊。 當請求成功時,返回成功資訊;當請求失敗時,返回失敗原因。 |
success |
| RequestId |
string |
請求 ID。 |
C7A7B776-0ACE-5A93-9B07-DE8008D9CCDF |
| Success |
string |
操作是否成功。取值:
|
true |
| SystemEventCounts |
object |
||
| SystemEventCount |
array<object> |
事件詳情。 |
|
|
object |
事件詳情。 |
||
| Status |
string |
事件狀態。 |
Normal |
| Time |
integer |
事件發生的時間戳記。單位:毫秒。 |
1635993751000 |
| GroupId |
string |
應用分組 ID。 |
17285**** |
| Product |
string |
事件的雲端服務名稱。 |
ECS |
| InstanceName |
string |
執行個體名稱。 |
ECS-test |
| Num |
integer |
發生事件的數量。 |
3 |
| ResourceId |
string |
資源 ID。 |
i-rj99xc6cptkk64ml**** |
| Name |
string |
事件名稱。 |
Instance:StateChange |
| Content |
string |
事件描述。 |
Instance status change notification |
| Level |
string |
事件層級。取值:
|
Info |
| RegionId |
string |
地區 ID。 |
cn-hangzhou |
樣本
正常返回樣本
JSON格式
{
"Code": "200",
"Message": "success",
"RequestId": "C7A7B776-0ACE-5A93-9B07-DE8008D9CCDF",
"Success": "true",
"SystemEventCounts": {
"SystemEventCount": [
{
"Status": "Normal",
"Time": 1635993751000,
"GroupId": "17285****",
"Product": "ECS",
"InstanceName": "ECS-test",
"Num": 3,
"ResourceId": "i-rj99xc6cptkk64ml****",
"Name": "Instance:StateChange",
"Content": "Instance status change notification",
"Level": "Info",
"RegionId": "cn-hangzhou"
}
]
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 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. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。