Allow to update an event by UUID, syntax fixes.

pull/41/head
Raphaël Vinot 2017-01-16 14:41:32 -05:00
parent 7c8cde0afd
commit 748136f3f1
3 changed files with 13 additions and 8 deletions

View File

@ -327,6 +327,9 @@ class PyMISP(object):
return self.get_stix_event(**kwargs)
def update(self, event):
if event['Event'].get('uuid'):
eid = event['Event']['uuid']
else:
eid = event['Event']['id']
return self.update_event(eid, event)
@ -450,6 +453,7 @@ class PyMISP(object):
# Send it on its way
return self.add_named_attribute(event, 'attachment', filename, category, to_ids, comment, distribution, proposal, data=encodedData)
def add_regkey(self, event, regkey, rvalue=None, category='Artifacts dropped', to_ids=True, comment=None, distribution=None, proposal=False):
if rvalue:
type_value = 'regkey|value'

View File

@ -78,6 +78,7 @@ class MISPAttribute(object):
self.SharingGroup = []
self.ShadowAttribute = []
self.disable_correlation = False
self.RelatedAttribute = []
def _serialize(self):
return '{type}{category}{to_ids}{uuid}{timestamp}{comment}{deleted}{value}'.format(