|
@@ -1,7 +1,6 @@
|
|
|
from common.ext_database import init_db
|
|
|
-from common.utils import save_json
|
|
|
-from common.logger import logger
|
|
|
-from util.riil_api import RiilApi
|
|
|
+from api.riil.utils import save_json
|
|
|
+from api.riil_api import RiilApi
|
|
|
|
|
|
|
|
|
class Main:
|
|
@@ -21,7 +20,7 @@ class Main:
|
|
|
for i in range(1, 2):
|
|
|
unaccepted_event_list = self.api.query_event_list("accepted_event_view", pageIndex=i)
|
|
|
all_accepted_event_list.extend(unaccepted_event_list.get('eventList'))
|
|
|
- save_json(all_accepted_event_list, "result/event/accepted_event_list.json")
|
|
|
+ save_json(all_accepted_event_list, "result/rill/event/accepted_event_list.json")
|
|
|
|
|
|
# event_list = self.api.get_log_alarm_list()
|
|
|
# save_json(event_list, "result/event/event_list.json")
|
|
@@ -33,7 +32,7 @@ class Main:
|
|
|
for res_id in res_id_set:
|
|
|
res = self.api.get_res_instance_by_id(res_id)
|
|
|
all_res_list.append(res)
|
|
|
- save_json(all_res_list, "result/res/res.json")
|
|
|
+ save_json(all_res_list, "result/rill/res/res.json")
|
|
|
|
|
|
def get_resources(self):
|
|
|
# 获取主资源列表
|
|
@@ -46,7 +45,7 @@ class Main:
|
|
|
page_index += 1
|
|
|
res = res_dict.get('resList', [])
|
|
|
res_list.extend(res)
|
|
|
- save_json(res_list, "result/res/res_list.json")
|
|
|
+ save_json(res_list, "result/rill/res/res_list.json")
|
|
|
|
|
|
|
|
|
def get_ip_all_segment(self):
|
|
@@ -58,14 +57,14 @@ class Main:
|
|
|
|
|
|
def get_room(self):
|
|
|
res = self.api.get_all_room()
|
|
|
- save_json(res, "result/room/room_list.json")
|
|
|
+ save_json(res, "result/rill/room/room_list.json")
|
|
|
event_from_room = []
|
|
|
for room in res.get("roomVOList", []):
|
|
|
room_id = room.get("id")
|
|
|
res = self.api.get_element_by_room_id(room_id)
|
|
|
event_from_room.extend(res.get('elementPojoList', []))
|
|
|
|
|
|
- save_json(event_from_room, "result/room/event_from_room.json")
|
|
|
+ save_json(event_from_room, "result/rill/room/event_from_room.json")
|
|
|
|
|
|
|
|
|
def run(self):
|