Add Attribute by named category and type

pull/21/head
KevTheHermit 2016-05-05 10:05:59 +01:00
parent f9ce3999e9
commit 12fa199202
1 changed files with 9 additions and 0 deletions

View File

@ -385,6 +385,15 @@ class PyMISP(object):
response = self.update_event(event['Event']['id'], event, 'json')
return self._check_response(response)
def add_named_attribute(self, event, category, type_value, value, to_ids=False, comment=None, distribution=None, proposal=False):
attributes = []
if value and category and type:
try:
attributes.append(self._prepare_full_attribute(category, type_value, value, to_ids, comment, distribution))
except NewAttributeError as e:
return e
return self._send_attributes(event, attributes, proposal)
def add_hashes(self, event, category='Artifacts dropped', filename=None, md5=None, sha1=None, sha256=None, ssdeep=None, comment=None, to_ids=True, distribution=None, proposal=False):
attributes = []