導出事件
更新時間 2025-04-23 15:02:54
最近更新時間: 2025-04-23 15:02:54
分享文章
本節主要介紹如何使用API導出事件。
此操作用來導出HBlock事件信息。
請求語法
GET /rest/v1/system/event/file?number=numebr&type=type HTTP/1.1
Date: date
Host: ip:port
Authorization: authorization請求參數
| 參數 | 類型 | 描述 | 是否必須 |
|---|---|---|---|
| number | Integer | 指定導出最近HBlock事件的個數。 說明 如果不指定,默認導出系統記錄的所有HBlock事件,系統記錄至少6個月的HBlock事件信息。 取值:[1, 10000]。 | 否 |
| type | String | 指定事件的類型。 取值:
默認值為user。 | 否 |
響應頭
| 名稱 | 類型 | 描述 |
|---|---|---|
| Content-Disposition | String | 響應內容的顯示形式。 |
| Transfer-Encoding | String | 實體傳輸給用戶的編碼形式。 |
請求示例1
導出HBlock用戶事件。
GET /rest/v1/system/event/file?number=3 HTTP/1.1
Date: Mon, 21 Mar 2022 01:53:48 GMT
Authorization: HBlock userName:signature
Host:192.168.0.121:1443響應示例1
HTTP/1.1 200 OK
x-hblock-request-id: 9fd643aa73bd4b60ab59a29e2904ab49
Connection: keep-alive
Date: Mon, 21 Mar 2022 01: 53: 48 GMT
Content-Disposition: attachment;filename=events_20220321095348.csv
Transfer-Encoding: chunked
Server: HBlock
eventId,eventTime,module,name,requestId,requesterIP,method,URL,body,statusCode,errorCode,errorMessage
a3830830-7f8a-40b2-a764-8ebfa6083f33,
2022-03-21 09: 53: 28,LUN,ExpandLUN,
5929bcbd0cf54e7f8a50b41f8bdd549b,
111.198.231.68,PUT,http: //218.78.41.185:1443/rest/v1/block/lun/lunName1/expand,"{
""capacity"": 200000
}
",400,LessThanCurrentCapacity,Value 200000 at 'capacity' failed to satisfy constraint: Argument must be greater than 200000.
79a4c7b3-5b5c-46da-9725-f14237d462be,
2022-03-21 09: 53: 21,LUN,SwitchLUN,a9be97449f434964960dbc8b48c05818,
111.198.231.68,PUT,http: //218.78.41.185:1443/rest/v1/block/lun/Lun1/switch,,200,-,-
9481763e-da71-4354-8a77-bff1c2d3effd,
2022-03-21 09: 53: 09,LUN,SetLUN,
9718a304ab1f4f03b9530ebeef3b51fc,
111.198.231.68,PUT,http: //218.78.41.185:1443/rest/v1/block/lun/Lun1,"{
""config"": {
""writePolicy"": ""WriteThrough""
}
}
",200,-,-請求示例2
導出HBlock系統事件。
GET /rest/v1/system/event/file?number=3&type=system HTTP/1.1
Date: Thu, 4 Aug 2022 09:28:28 GMT
Authorization: HBlock userName:signature
Host:192.168.0.121:1443響應示例2
HTTP/1.1 200 OK
x-hblock-request-id: 0de4cbbd38104d8aaeae7700e6af9bae
Connection: keep-alive
Date: Thu, 4 Aug 2022 09: 28: 28 GMT
Content-Disposition: attachment;filename=events_20220321095348.csv
Transfer-Encoding: chunked
Server: HBlock
eventId,eventTime,module,name,instanceId,details
19cb57dd-5210-45af-a930-3d4cc70fe299,
2022-08-01 16: 44: 57,System,DataResumed,
null,
{}
1843075f-1281-4abc-af22-05a95c3a00ac,
2022-08-01 16: 44: 57,System,DataLowRedundancy,
null,
"{""percent"": ""0%""}"
6b6d9ec4-4a20-44d2-b00c-f3f154373a11,
2022-08-01 16: 44: 55,Disk,PathRemoved,hblock_2:/mnt/storage02,
{}