此操作用来导出HBlock事件信息。
请求语法
GET /rest/v1/system/event/file?number=numebr&type=type HTTP/1.1
Date: date
Host: ip:port
Authorization: authorization
请求参数
参数 描述 是否必须 number 指定导出最近HBlock事件的个数。
说明如果不指定,默认导出系统记录的所有HBlock事件,系统记录至少6个月的HBlock事件信息。
类型:整型
取值:[1, 10000]。
否 type 指定事件的类型。
类型:字符串
取值:
user:用户事件。
system:系统事件。
默认值为user。
否
响应头
名称 描述 Content-Disposition 响应内容的显示形式。 Transfer-Encoding 实体传输给用户的编码形式。
请求示例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,
{}