Allow to get the list of known types out of MISPEvent again

pull/111/head
Raphaël Vinot 2017-09-14 14:34:53 +02:00
parent b3c15da967
commit 6dfaa78722
1 changed files with 5 additions and 0 deletions

View File

@ -255,6 +255,8 @@ class MISPEvent(AbstractMISP):
t = json.load(f) t = json.load(f)
describe_types = t['result'] describe_types = t['result']
self.__types = describe_types['types']
self._reinitialize_event() self._reinitialize_event()
def _reinitialize_event(self): def _reinitialize_event(self):
@ -288,6 +290,9 @@ class MISPEvent(AbstractMISP):
self.Galaxy = None self.Galaxy = None
self.Object = None self.Object = None
def get_known_types(self):
return self.__types
def _serialize(self): def _serialize(self):
return '{date}{threat_level_id}{info}{uuid}{analysis}{timestamp}'.format( return '{date}{threat_level_id}{info}{uuid}{analysis}{timestamp}'.format(
date=self.date, threat_level_id=self.threat_level_id, info=self.info, date=self.date, threat_level_id=self.threat_level_id, info=self.info,