mirror of https://github.com/MISP/PyMISP
chg: Pass all parameters to the search API.
parent
8ead1bea5e
commit
5de57816dd
|
@ -1231,12 +1231,14 @@ class PyMISP(object):
|
||||||
query['event_timestamp'] = kwargs.pop('event_timestamp', None)
|
query['event_timestamp'] = kwargs.pop('event_timestamp', None)
|
||||||
query['includeProposals'] = kwargs.pop('includeProposals', None)
|
query['includeProposals'] = kwargs.pop('includeProposals', None)
|
||||||
|
|
||||||
|
if kwargs:
|
||||||
|
self.logger.info('Some unknown parameters are in kwargs. appending as-is: {}'.format(', '.join(kwargs.keys())))
|
||||||
|
# Add all other keys as-is.
|
||||||
|
query.update({k: v for k, v in kwargs.items()})
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
query = {k: v for k, v in query.items() if v is not None}
|
query = {k: v for k, v in query.items() if v is not None}
|
||||||
|
|
||||||
if kwargs:
|
|
||||||
raise SearchError('Unused parameter: {}'.format(', '.join(kwargs.keys())))
|
|
||||||
|
|
||||||
# Create a session, make it async if and only if we have a callback
|
# Create a session, make it async if and only if we have a callback
|
||||||
return self.__query('restSearch/download', query, controller, async_callback)
|
return self.__query('restSearch/download', query, controller, async_callback)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue