def addGestData(self, name, data): ''' Ingest data according to a previously registered ingest format. Example: data = getDataFromThing() # use the foo:bar ingest iapi.addGestData('foo:bar', data) ''' gest = self._gest_cache.get(name) if gest is None: raise s_common.NoSuchTufo(prop='syn:ingest', valu=name) gest.ingest(self._gest_core, data=data)
def addGestData(self, name, data): ''' Ingest data according to a previously registered ingest format. Example: data = getDataFromThing() # use the foo:bar ingest iapi.addGestData('foo:bar', data) ''' func = self._gest_funcs.get(name) if func is not None: with self._gest_core.getCoreXact() as xact: return func(data) gest = self._gest_cache.get(name) if gest is None: raise s_common.NoSuchTufo(prop='syn:ingest', valu=name) gest.ingest(self._gest_core, data=data)