From e956860449d89ba6bfed3518e2943e5898e9cff3 Mon Sep 17 00:00:00 2001 From: Paul Stark Date: Wed, 20 Jun 2018 09:54:00 -0400 Subject: [PATCH] new:Add the ability to add Other attributes via the API --- .gitignore | 1 + pymisp/api.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index 39eab06..d9fd1f1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ examples/feed-generator/output/*.json build/* dist/* pymisp.egg-info/* +.idea diff --git a/pymisp/api.py b/pymisp/api.py index 96b0c38..3754eb2 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -816,6 +816,20 @@ class PyMISP(object): """Add an internal reference (type other)""" return self.add_named_attribute(event, 'other', reference, category, to_ids, comment, distribution, proposal, **kwargs) + # ##### Other attributes ##### + + def add_other_comment(self, event, reference, category='Other', to_ids=False, comment=None, distribution=None, proposal=False, **kwargs): + """Add other comment""" + return self.add_named_attribute(event, 'comment', reference, category, to_ids, comment, distribution, proposal, **kwargs) + + def add_other_counter(self, event, reference, category='Other', to_ids=False, comment=None, distribution=None, proposal=False, **kwargs): + """Add other counter""" + return self.add_named_attribute(event, 'counter', reference, category, to_ids, comment, distribution, proposal, **kwargs) + + def add_other_text(self, event, reference, category='Other', to_ids=False, comment=None, distribution=None, proposal=False, **kwargs): + """Add other text""" + return self.add_named_attribute(event, 'text', reference, category, to_ids, comment, distribution, proposal, **kwargs) + # ################################################## # ######### Upload samples through the API ######### # ##################################################