From 0097c7846ff5285cb4219f33218f360ee28117ed Mon Sep 17 00:00:00 2001 From: pablo-schmeiser Date: Fri, 24 Jul 2026 13:19:41 +0200 Subject: [PATCH] feat: Add fetchFromAllFeeds --- pymisp/api.py | 5 +++++ tests/testlive_comprehensive.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pymisp/api.py b/pymisp/api.py index f2f85ad4..97cbb5be 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -2135,6 +2135,11 @@ def fetch_feed(self, feed: MISPFeed | int | str | UUID) -> dict[str, Any] | list response = self._prepare_request('GET', f'feeds/fetchFromFeed/{feed_id}') return self._check_json_response(response) + def fetch_all_feeds(self) -> dict[str, Any] | list[dict[str, Any]]: + """ Fetch all the feeds: https://www.misp-project.org/openapi/#tag/Feeds/operation/fetchFromAllFeeds""" + response = self._prepare_request('GET', f'feeds/fetchFromAllFeeds') + return self._check_json_response(response) + def cache_all_feeds(self) -> dict[str, Any] | list[dict[str, Any]]: """ Cache all the feeds: https://www.misp-project.org/openapi/#tag/Feeds/operation/cacheFeeds""" response = self._prepare_request('GET', 'feeds/cacheFeeds/all') diff --git a/tests/testlive_comprehensive.py b/tests/testlive_comprehensive.py index 19e8bb14..ce37bc11 100644 --- a/tests/testlive_comprehensive.py +++ b/tests/testlive_comprehensive.py @@ -2519,6 +2519,9 @@ def test_feeds(self) -> None: # Cache all enabled feeds r = self.admin_misp_connector.cache_all_feeds() self.assertEqual(r['message'], 'Feed caching job initiated.') + # Fetch all enabled feeds + # Cannot test that, it fetches all the events. + # r = self.admin_misp_connector.fetch_all_feeds() # Compare all enabled feeds r = self.admin_misp_connector.compare_feeds() # FIXME: https://github.com/MISP/MISP/issues/4834#issuecomment-511890466 @@ -3508,7 +3511,6 @@ def missing_methods(self) -> None: "favouriteTags/getToggleField", # TODO "feeds/feedCoverage", "feeds/importFeeds", - "feeds/fetchFromAllFeeds", "feeds/getEvent", "feeds/previewIndex", # TODO "feeds/previewEvent", # TODO