Esempio n. 1
0
 def load_ground_truths(self):
     for host in self.hosts:
         if host['host_name'] == self.host_name:
             self.groundtruths = host['ground_truths']
     if not self.groundtruths:
         raise data_exceptions.DataNotFound(data_name=self.host_name,
                                            source_name='hosts')
     return True
Esempio n. 2
0
 def load_data_sources(self):
     for network in self.networks:
         if network['network_name'] == self.network_name:
             self.data_sources = network['data_sources']
     if not self.data_sources:
         raise data_exceptions.DataNotFound(data_name=self.network_name,
                                            source_name='networks')
     return True
Esempio n. 3
0
 def load_measurements(self):
     for host in self.hosts:
         if host['host_name'] == self.host_name:
             self.measurements = host['measurements']
     if not self.measurements:
         raise data_exceptions.DataNotFound(data_name=self.host_name,
                                            source_name='hosts')
     return True
Esempio n. 4
0
 def load_units(self):
     for measurement in self.measurements:
         if measurement['measurement_name'] == self.measurement_name:
             self.units = measurement['units']
     if not self.units:
         raise data_exceptions.DataNotFound(data_name=self.measurement_name,
                                            source_name='measurements')
     return True
Esempio n. 5
0
 def load_hosts(self):
     for database in self.databases:
         if database['database_name'] == self.database_name:
             self.hosts = database['hosts']
     if not self.hosts:
         raise data_exceptions.DataNotFound(data_name=self.database_name,
                                            source_name='databases')
     return True
Esempio n. 6
0
 def load_databases(self):
     for data_source in self.data_sources:
         if data_source['data_source_name'] == self.data_source_name:
             self.data_source_ip_port = data_source['data_source_ip_port']
             self.databases = data_source['databases']
     if not self.databases:
         raise data_exceptions.DataNotFound(data_name=self.data_source_name,
                                            source_name='data_sources')
     return True
Esempio n. 7
0
 def load_networks_map(self):
     if not self.json_path:
         self.json_path = 'diagnostics_map.json'
     diagnostics_map = load_json(self.json_path)
     for customer_data in diagnostics_map['customers']:
         if customer_data['customer_name'] == self.customer_name:
             self.networks = customer_data['networks']
     if not self.networks:
         raise data_exceptions.DataNotFound(data_name=self.customer_name,
                                            source_name='customers')
     return True