diff --git a/assemblyline_client/v4_client/module/search/facet.py b/assemblyline_client/v4_client/module/search/facet.py index bd378e8..e45cd77 100644 --- a/assemblyline_client/v4_client/module/search/facet.py +++ b/assemblyline_client/v4_client/module/search/facet.py @@ -22,7 +22,7 @@ def _do_facet(self, index, field, **kwargs): path = api_path('search', 'facet', index, field, **kwargs) return self._connection.get(path) - def alert(self, field, query=None, mincount=None, filters=None, timeout=None): + def alert(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the alert collection. @@ -34,12 +34,13 @@ def alert(self, field, query=None, mincount=None, filters=None, timeout=None): filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('alert', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('alert', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) - def badlist(self, field, query=None, mincount=None, filters=None, timeout=None): + def badlist(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the badlist collection. @@ -51,12 +52,13 @@ def badlist(self, field, query=None, mincount=None, filters=None, timeout=None): filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('badlist', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('badlist', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) - def file(self, field, query=None, mincount=None, filters=None, timeout=None): + def file(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the file collection. @@ -68,12 +70,13 @@ def file(self, field, query=None, mincount=None, filters=None, timeout=None): filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('file', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('file', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) - def heuristic(self, field, query=None, mincount=None, filters=None, timeout=None): + def heuristic(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the heuristic collection. @@ -85,12 +88,13 @@ def heuristic(self, field, query=None, mincount=None, filters=None, timeout=None filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('heuristic', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('heuristic', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) - def result(self, field, query=None, mincount=None, filters=None, timeout=None): + def result(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the result collection. @@ -102,12 +106,13 @@ def result(self, field, query=None, mincount=None, filters=None, timeout=None): filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('result', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('result', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) - def safelist(self, field, query=None, mincount=None, filters=None, timeout=None): + def safelist(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the safelist collection. @@ -119,12 +124,13 @@ def safelist(self, field, query=None, mincount=None, filters=None, timeout=None) filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('safelist', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('safelist', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) - def signature(self, field, query=None, mincount=None, filters=None, timeout=None): + def signature(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the signature collection. @@ -136,12 +142,13 @@ def signature(self, field, query=None, mincount=None, filters=None, timeout=None filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('signature', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('signature', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) - def submission(self, field, query=None, mincount=None, filters=None, timeout=None): + def submission(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the submission collection. @@ -153,12 +160,13 @@ def submission(self, field, query=None, mincount=None, filters=None, timeout=Non filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('submission', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('submission', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) - def workflow(self, field, query=None, mincount=None, filters=None, timeout=None): + def workflow(self, field, query=None, mincount=None, filters=None, timeout=None, size=None): """\ List most frequent value for a field in the workflow collection. @@ -170,7 +178,8 @@ def workflow(self, field, query=None, mincount=None, filters=None, timeout=None) filters : Additional lucene queries used to filter the data (list of strings) mincount : Minimum amount of hits for the value to be returned timeout : Maximum execution time in milliseconds (integer) +size : Maxium number of facets to return (integer) Returns all results. """ - return self._do_facet('workflow', field, query=query, mincount=mincount, filters=filters, timeout=timeout) + return self._do_facet('workflow', field, query=query, mincount=mincount, filters=filters, timeout=timeout, size=size) diff --git a/test/test_submit.py b/test/test_submit.py index ec7302d..1bb2bb5 100644 --- a/test/test_submit.py +++ b/test/test_submit.py @@ -105,7 +105,7 @@ def test_submit_dynamic(datastore, client): assert res == datastore.submission.get(res['sid'], as_obj=False) assert 'Dynamic Analysis' in res['params']['services']['selected'] for k, v in submission_data['params'].items(): - if k not in ['submitter', 'services', 'description', 'quota_item']: + if k not in ['submitter', 'services', 'description', 'quota_item', 'priority']: assert res['params'].get(k) == v