def run_evaluation(self, host: int): req = pb.Request() req.command = pb.RUNEVALUATION req.runevaluation.host = host res = self._send_and_check(req, pb.RUNEVALUATION) return None
def getversion(self, thisone: int) -> str: req = pb.Request() req.command = pb.GETVERSION req.getversion.data = thisone res = self._send_and_check(req, pb.GETVERSION) return res.getversion.data
def consume(self, from_event1: int, to_event1: int, from_event2: int, to_event2: int) -> (int,int): req = pb.Request() req.command = pb.CONSUME req.consume.from1 = from_event1 req.consume.to1 = to_event1 req.consume.from2 = from_event2 req.consume.to2 = to_event2 res = self._send_and_check(req, pb.CONSUME) return (res.consume.events1, res.consume.events2)
def get_pair_states_count(self, host: int) -> (): req = pb.Request() req.command = pb.GETPAIRSTATESCOUNT req.getpairstatescount.host = host res = self._send_and_check(req, pb.GETPAIRSTATESCOUNT) return (res.getpairstatescount.same_ident, res.getpairstatescount.same_sym, res.getpairstatescount.same_asym, res.getpairstatescount.fuz_ident, res.getpairstatescount.fuz_sym, res.getpairstatescount.fuz_asym, res.getpairstatescount.unique)
def connect(self, model: str, database_url1: str, host1: int, database_url2: str, host2: int) -> (int,int): req = pb.Request() req.command = pb.CONNECT req.connect.model = model req.connect.urldb1 = database_url1 req.connect.hostid1 = host1 req.connect.urldb2 = database_url2 req.connect.hostid2 = host2 res = self._send_and_check(req, pb.CONNECT) return (res.connect.events1, res.connect.events2)
def get_pairs(self, host: int, intypes: list): req = pb.Request() req.command = pb.GETPAIRS req.getpairs.host = host for thisone in intypes: item = req.getpairs.type.append(thisone) res = self._send_and_check(req, pb.GETPAIRS) result = [] for item in res.getpairs.entry: result.append( (item.eventid, item.type, item.total_prefixes, item.unique_prefixes, item.hash_dist, item.parent, item.child, item.execs) ) print('API: get_pairs: got:', len(result)) return result
def reinit(self): req = pb.Request() req.command = pb.REINIT res = self._send_and_check(req, pb.REINIT) return None