From a67a90d1d31faccc8cdaee64f3fc1365e03c7df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Larinier?= Date: Wed, 9 Mar 2016 18:37:27 +0100 Subject: [PATCH] add method to export txt all attributes by type --- pymisp/api.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index 8c95c25..023ddcb 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -202,7 +202,7 @@ class PyMISP(object): url = urljoin(self.root_url, 'events/index') if filters is not None: filters = json.dumps(filters) - print filters + print(filters) return session.post(url, data=filters) else: return session.get(url) @@ -862,9 +862,15 @@ class PyMISP(object): return {'version': '{}.{}.{}'.format(master_version['major'], master_version['minor'], master_version['hotfix'])} else: return {'error': 'Impossible to retrieve the version of the master branch.'} + # ############## Export Attributes in text #################################### + def get_all_attributes_txt(self, type_attr): + + session = self.__prepare_session('txt') + url = urljoin(self.root_url,'attributes/text/download/%s' % type_attr) + response = session.get(url) + return response # ############## Deprecated (Pure XML API should not be used) ################## - @deprecated def download_all(self): """