exposing more feeds functions (for which _isRest() is available) to the API

pull/98/head
raw-data 2017-07-03 21:56:44 +01:00
parent 8b90a85254
commit 6139caae2f
1 changed files with 42 additions and 0 deletions

View File

@ -1501,6 +1501,48 @@ class PyMISP(object):
response = session.get(url)
return self._check_response(response)
def view_feeds(self):
session = self.__prepare_session()
url = urljoin(self.root_url, 'feeds')
response = session.get(url)
return self._check_response(response)
def view_feed(self, feed_ids):
session = self.__prepare_session()
url = urljoin(self.root_url, 'feeds/view/{}'.format(feed_ids))
response = session.get(url)
return self._check_response(response)
def cache_feeds_all(self):
session = self.__prepare_session()
url = urljoin(self.root_url, 'feeds/cacheFeeds/all')
response = session.get(url)
return self._check_response(response)
def cache_feed(self, feed_id):
session = self.__prepare_session()
url = urljoin(self.root_url, 'feeds/cacheFeeds/{}'.format(feed_id))
response = session.get(url)
return self._check_response(response)
def cache_feeds_freetext(self):
session = self.__prepare_session()
url = urljoin(self.root_url, 'feeds/cacheFeeds/freetext')
response = session.get(url)
return self._check_response(response)
def cache_feeds_misp(self):
session = self.__prepare_session()
url = urljoin(self.root_url, 'feeds/cacheFeeds/misp')
response = session.get(url)
return self._check_response(response)
def compare_feeds(self):
session = self.__prepare_session()
url = urljoin(self.root_url, 'feeds/compareFeeds')
response = session.get(url)
return self._check_response(response)
# ###########################
# ####### Deprecated ########
# ###########################