diff --git a/pymisp/api.py b/pymisp/api.py index a3a355c..8f8abeb 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -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 = []