Merge pull request #95 from obsidianpentesting/master

Create cache feeds function in PyMISP
pull/98/head
Raphaël Vinot 2017-07-07 09:45:01 +02:00 committed by GitHub
commit 1b87403c0f
2 changed files with 24 additions and 0 deletions

14
examples/cache_all.py Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from keys import misp_url, misp_key, misp_verifycert
from pymisp import PyMISP
def init(url, key):
return PyMISP(url, key, misp_verifycert, 'json')
if __name__ == '__main__':
misp = init(misp_url, misp_key)
misp.cache_all_feeds()

View File

@ -1501,6 +1501,16 @@ class PyMISP(object):
response = session.get(url)
return self._check_response(response)
# ###########################
# ### Cache All Feeds ###
# ###########################
def cache_all_feeds(self):
session = self.__prepare_session()
url = urljoin(self.root_url, 'feeds/cacheFeeds/all')
response = session.post(url)
return self._check_response(response)
# ###########################
# ####### Deprecated ########
# ###########################