new: Update warninglists

pull/280/head
Raphaël Vinot 2018-09-25 10:32:32 -04:00
parent da0f6ef7d2
commit b95fdf9218
2 changed files with 7 additions and 2 deletions

View File

@ -1224,7 +1224,7 @@ class PyMISP(object):
def download_samples(self, sample_hash=None, event_id=None, all_samples=False, unzip=True):
"""Download samples, by hash or event ID. If there are multiple samples in one event, use the all_samples switch
:param sample_hash: hash of sample
:param event_id: ID of event
:param all_samples: download all samples
@ -1697,6 +1697,11 @@ class PyMISP(object):
response = self._prepare_request('GET', url)
return self._check_response(response)
def update_warninglists(self):
url = urljoin(self.root_url, '/warninglists/update')
response = self._prepare_request('POST', url)
return self._check_response(response)
# ############## Galaxies/Clusters ##################
def get_galaxies(self):

View File

@ -580,8 +580,8 @@ class TestComprehensive(unittest.TestCase):
# self.assertEqual(len(events), 1)
# warninglist
self.admin_misp_connector.update_warninglists()
response = self.admin_misp_connector.toggle_warninglist(warninglist_name='%dns resolv%', force_enable=True) # enable ipv4 DNS.
# response = self.admin_misp_connector.toggle_warninglist(warninglist_id=[17], force_enable=True) # enable ipv4 DNS.
self.assertDictEqual(response, {'saved': True, 'success': '3 warninglist(s) enabled'})
second.add_attribute('ip-src', '9.9.9.9')
second = self.user_misp_connector.update_event(second)