12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- from common.utils import call_api, save_json
- class EventClientApi:
- def accept_event(self, event_id):
- """
- 受理事件。
- """
- endpoint = f"/event/client/accept/{event_id}"
- params = {"_openCLIENT": "RIIL"}
- return call_api(endpoint, method="GET", params=params)
- def query_event_list(self, view_type, isPageing=0, pageIndex=1, pageSize=20):
- """
- 查询事件列表。
- """
- params = {
- "viewType": view_type,
- "_openCLIENT": "RIIL",
- "isPageing": isPageing,
- "pageSize": pageSize,
- "pageIndex": pageIndex
- }
- return call_api("/event/client/getEventList", method="POST", params=params)
- def get_log_alarm_list(self):
- """
- 获取日志事件列表。
- """
- params = {
- # "isPageing": "1",
- # "pageSize": "20",
- # "pageIndex": "1",
- "_openCLIENT": "RIIL"
- }
- return call_api("/event/client/getLogAlarmList", method="POST", params=params)
- # if __name__ == '__main__':
- # api = EventClientApi()
- # unaccepted_event_list = api.query_event_list("unaccepted_event_view")
- # accepted_event_list = api.query_event_list("accepted_event_view")
- # event_list = api.get_log_alarm_list()
- #
- # save_json(unaccepted_event_list, "result/event/unaccepted_event_list.json")
- # save_json(accepted_event_list, "result/event/accepted_event_list.json")
- # save_json(event_list, "result/event/event_list.json")
- #
|