Add publish method

pull/2/merge v1.9
Raphaël Vinot 2015-09-17 00:51:45 +02:00
parent f731b88fde
commit 5fea22600e
2 changed files with 9 additions and 1 deletions

View File

@ -256,6 +256,14 @@ class PyMISP(object):
response = self.add_event(data)
return response.json()
def publish(self, event):
if event['Event']['published']:
return {'message': 'Already published'}
event = self._prepare_update(event)
event['Event']['published'] = True
response = self.update_event(event['Event']['id'], event)
return response.json()
# ##### File attributes #####
def _send_attributes(self, event, attributes):

View File

@ -4,7 +4,7 @@ from setuptools import setup
setup(
name='pymisp',
version='1.8.2',
version='1.9',
author='Raphaël Vinot',
author_email='raphael.vinot@circl.lu',
maintainer='Raphaël Vinot',