Esempio n. 1
0
 def get(self):
     try:
         data_res = HostsController.get_list()
     except Exception as e:
         raise ModelsDBError(str(e))
     resp = {'data': data_res}
     return resp
Esempio n. 2
0
 def get(self, category):
     try:
         if category == 'node':
             data_res = HostsController.get_list()
         else:
             data_res = HostsController.get_list()
     except Exception as e:
         raise ModelsDBError(str(e))
     resp = {'data': data_res}
     return resp
Esempio n. 3
0
 def get(self, category, key):
     _abort_if_host_id_doesnt_exist_hostspool(key)
     try:
         item_list = MonitorController.get_monitor_item(category)
     except Exception as e:
         raise ModelsDBError(str(e))
     try:
         data_res = MonitorController.monitor_title(item_list, category,
                                                    key, '123')
     except Exception as e:
         raise MonitorError(str(e))
     if data_res:
         status = 'success'
     else:
         status = 'failed'
     return {'data': data_res, 'status': status}
Esempio n. 4
0
 def get(self):
     try:
         data_res = AlertManager.get_alert_history_list()
     except Exception as e:
         raise ModelsDBError(str(e))
     return {'data': data_res}
Esempio n. 5
0
 def get(self, alert_rules_id):
     try:
         data_res = AlertManager.get_alert_rules_dict(alert_rules_id)
     except Exception as e:
         raise ModelsDBError(str(e))
     return {'data': data_res}
Esempio n. 6
0
 def get(self, service_name):
     try:
         data_res = AlertManager.get_alert_rules_dict(service_name)
     except Exception as e:
         raise ModelsDBError(str(e))
     return {'service':service_name, 'names': data_res}