Merge pull request #241 from cipherlock/master

new:Add the ability to add Other attributes via the API
pull/247/head
Raphaël Vinot 2018-06-20 22:46:24 +08:00 committed by GitHub
commit ae97941484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ examples/feed-generator/output/*.json
build/*
dist/*
pymisp.egg-info/*
.idea

View File

@ -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 #########
# ##################################################