Skip to content

Commit 333600a

Browse files
Update advanced search to also support JSON queries
1 parent cffff4d commit 333600a

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

ReversingLabs/SDK/a1000.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ def advanced_search_v3(self, query_string, ticloud=False, start_search_date=None
18131813
Query string example:
18141814
'av-count:5 available:TRUE'
18151815
1816-
:param query_string: search query
1816+
:param query_string: search query; can be a string or a dict
18171817
:type query_string: str or dict
18181818
:param ticloud: show only cloud results
18191819
:type ticloud: bool
@@ -1886,7 +1886,7 @@ def advanced_search_v3_aggregated(self, query_string, ticloud=False, start_searc
18861886
Query string example:
18871887
'av-count:5 available:TRUE'
18881888
1889-
:param query_string: search query
1889+
:param query_string: search query; can be a string or a dict
18901890
:type query_string: str or dict
18911891
:param ticloud: show only cloud results
18921892
:type ticloud: bool

ReversingLabs/SDK/ticloud.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,8 @@ def search(self, query_string, sorting_criteria=None, sorting_order="desc", page
11311131
11321132
'av-count:5 available:TRUE'
11331133
1134-
:param query_string: query string
1135-
:type query_string: str
1134+
:param query_string: search query; can be a string or a dict
1135+
:type query_string: str or dict
11361136
:param sorting_criteria: define the criteria used in sorting; possible values are 'sha1', 'firstseen',
11371137
'threatname', 'sampletype', 'filecount', 'size'
11381138
:type sorting_criteria: str
@@ -1145,9 +1145,6 @@ def search(self, query_string, sorting_criteria=None, sorting_order="desc", page
11451145
:returns: response
11461146
:rtype: requests.Response
11471147
"""
1148-
if not isinstance(query_string, str):
1149-
raise WrongInputError("The search query must be a string.")
1150-
11511148
if not isinstance(records_per_page, int) or not 1 <= records_per_page <= 10000:
11521149
raise WrongInputError("records_per_page parameter must be integer "
11531150
"with value between 1 and 10000 (included).")
@@ -1186,8 +1183,8 @@ def search_aggregated(self, query_string, sorting_criteria=None, sorting_order="
11861183
Query string example:
11871184
'av-count:5 available:TRUE'
11881185
1189-
:param query_string: search query - see API documentation for details on writing search queries
1190-
:type query_string: str
1186+
:param query_string: search query; can be a string or a dict
1187+
:type query_string: str or dict
11911188
:param sorting_criteria: define the criteria used in sorting; possible values are 'sha1', 'firstseen',
11921189
'threatname', 'sampletype', 'filecount', 'size'
11931190
:type sorting_criteria: str

0 commit comments

Comments
 (0)