diff --git a/examples/cache_all.py b/examples/cache_all.py new file mode 100644 index 0000000..00e3eea --- /dev/null +++ b/examples/cache_all.py @@ -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() \ No newline at end of file diff --git a/pymisp/api.py b/pymisp/api.py index af091f8..162d0b6 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -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 ######## # ###########################