new: Exclude decayed attributes in search

Fix #753
pull/760/head
Raphaël Vinot 2021-06-08 10:09:11 -07:00
parent 7dbaf665d9
commit fcb4d41d63
1 changed files with 3 additions and 0 deletions

View File

@ -2317,6 +2317,7 @@ class PyMISP:
include_correlations: Optional[bool] = None, includeCorrelations: Optional[bool] = None, include_correlations: Optional[bool] = None, includeCorrelations: Optional[bool] = None,
include_decay_score: Optional[bool] = None, includeDecayScore: Optional[bool] = None, include_decay_score: Optional[bool] = None, includeDecayScore: Optional[bool] = None,
object_name: Optional[str] = None, object_name: Optional[str] = None,
exclude_decayed: Optional[bool] = None,
pythonify: Optional[bool] = False, pythonify: Optional[bool] = False,
**kwargs) -> Union[Dict, str, List[Union[MISPEvent, MISPAttribute, MISPObject]]]: **kwargs) -> Union[Dict, str, List[Union[MISPEvent, MISPAttribute, MISPObject]]]:
'''Search in the MISP instance '''Search in the MISP instance
@ -2356,6 +2357,7 @@ class PyMISP:
:param include_decay_score: Include the decay score at attribute level. :param include_decay_score: Include the decay score at attribute level.
:param include_correlations: [JSON Only - attribute] Include the correlations of the matching attributes. :param include_correlations: [JSON Only - attribute] Include the correlations of the matching attributes.
:param object_name: [objects controller only] Search for objects with that name :param object_name: [objects controller only] Search for objects with that name
:param exclude_decayed: [attributes controller only] Exclude the decayed attributes from the response
:param pythonify: Returns a list of PyMISP Objects instead of the plain json output. Warning: it might use a lot of RAM :param pythonify: Returns a list of PyMISP Objects instead of the plain json output. Warning: it might use a lot of RAM
Deprecated: Deprecated:
@ -2455,6 +2457,7 @@ class PyMISP:
query['includeDecayScore'] = self._make_misp_bool(include_decay_score) query['includeDecayScore'] = self._make_misp_bool(include_decay_score)
query['includeCorrelations'] = self._make_misp_bool(include_correlations) query['includeCorrelations'] = self._make_misp_bool(include_correlations)
query['object_name'] = object_name query['object_name'] = object_name
query['excludeDecayed'] = self._make_misp_bool(exclude_decayed)
url = urljoin(self.root_url, f'{controller}/restSearch') url = urljoin(self.root_url, f'{controller}/restSearch')
if return_format == 'stix-xml': if return_format == 'stix-xml':
response = self._prepare_request('POST', url, data=query, output_type='xml') response = self._prepare_request('POST', url, data=query, output_type='xml')