mirror of https://github.com/MISP/PyMISP
Merge pull request #95 from obsidianpentesting/master
Create cache feeds function in PyMISPpull/98/head
commit
1b87403c0f
|
@ -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()
|
|
@ -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 ########
|
||||
# ###########################
|
||||
|
|
Loading…
Reference in New Issue