調(diào)用GetEmonGrafanaAlerts,獲取Grafana報警列表。
調(diào)試
您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。
請求頭
該接口使用公共請求頭,無特殊請求頭。請參見公共請求參數(shù)文檔。
請求語法
GET /openapi/emon/projects/{ProjectId}/grafana/proxy/api/alerts HTTP/1.1
請求參數(shù)
名稱 | 類型 | 位置 | 是否必選 | 示例值 | 描述 |
---|---|---|---|---|---|
ProjectId | String | Path | 是 | es-133071096032**** |
監(jiān)控報警項目ID,格式為es-<yourUID>。 |
String | Body | 否 | 空 |
請求體,無需填寫。 |
返回數(shù)據(jù)
名稱 | 類型 | 示例值 | 描述 |
---|---|---|---|
Code | String | 200 |
響應(yīng)碼。 |
Message | String | "" |
響應(yīng)消息。 |
RequestId | String | 08FA74C7-5654-4309-9729-D555AF587B7F |
請求ID。 |
Success | Boolean | true |
是否成功獲取Grafana報警列表:
|
示例
請求示例
GET /openapi/emon/projects/es-133071096032****/grafana/proxy/api/alerts HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json
正常返回示例
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"Success" : true,
"Code" : "200",
"Message" : "",
"Result" : {
"data" : [ {
"id" : 5492,
"dashboardId" : 10981,
"dashboardUid" : "zl-template",
"dashboardSlug" : "esman-ri-zhi-bao-jing",
"panelId" : 10,
"name" : "zl慢查詢測試",
"state" : "ok",
"newStateDate" : "2021-05-27T19:02:24+08:00",
"evalDate" : "0001-01-01T00:00:00Z",
"evalData" : { },
"executionError" : "",
"url" : "/d/zl-template/esman-ri-zhi-bao-jing"
}, {
"id" : 5127,
"dashboardId" : 10372,
"dashboardUid" : "log-alarm-template",
"dashboardSlug" : "ri-zhi-bao-jing-mo-ban-zuo-ce-hao-importci-da-pan-jsonke-fu-zhi-mo-ren-bao-jing-gui-ze",
"panelId" : 10,
"name" : "慢查詢條數(shù)報警模板",
"state" : "paused",
"newStateDate" : "2021-05-19T02:59:36+08:00",
"evalDate" : "0001-01-01T00:00:00Z",
"evalData" : { },
"executionError" : "",
"url" : "/d/log-alarm-template/ri-zhi-bao-jing-mo-ban-zuo-ce-hao-importci-da-pan-jsonke-fu-zhi-mo-ren-bao-jing-gui-ze"
}, {
"id" : 5491,
"dashboardId" : 10981,
"dashboardUid" : "zl-template",
"dashboardSlug" : "esman-ri-zhi-bao-jing",
"panelId" : 2,
"name" : "慢查詢耗時報警",
"state" : "ok",
"newStateDate" : "2021-05-27T12:04:48+08:00",
"evalDate" : "0001-01-01T00:00:00Z",
"evalData" : { },
"executionError" : "",
"url" : "/d/zl-template/esman-ri-zhi-bao-jing"
}, {
"id" : 5126,
"dashboardId" : 10372,
"dashboardUid" : "log-alarm-template",
"dashboardSlug" : "ri-zhi-bao-jing-mo-ban-zuo-ce-hao-importci-da-pan-jsonke-fu-zhi-mo-ren-bao-jing-gui-ze",
"panelId" : 2,
"name" : "慢查詢耗時超閾值條數(shù)報警模板",
"state" : "paused",
"newStateDate" : "2021-05-19T02:59:36+08:00",
"evalDate" : "0001-01-01T00:00:00Z",
"evalData" : { },
"executionError" : "",
"url" : "/d/log-alarm-template/ri-zhi-bao-jing-mo-ban-zuo-ce-hao-importci-da-pan-jsonke-fu-zhi-mo-ren-bao-jing-gui-ze"
} ]
},
"RequestId" : "DA48E81F-B556-4EE0-BC5D-A280A919CEFB"
}
錯誤碼
HttpCode | 錯誤碼 | 錯誤信息 | 描述 |
---|---|---|---|
400 | InstanceActivating | Instance is activating. | 實例目前處于生效中。 |
400 | InstanceNotFound | The instanceId provided does not exist. | 實例找不到,請核對實例狀態(tài)。 |
訪問錯誤中心查看更多錯誤碼。