Skip to content

Commit

Permalink
Added the nparent attribute when searching for rows. This returns par…
Browse files Browse the repository at this point in the history
…ent objects such as cases. (#244)
  • Loading branch information
chriswalkerc authored Apr 9, 2022
1 parent 9cd129f commit 8e3ecc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion thehive4py/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def __find_rows(self, find_url, **attributes):
sort (Array): List of fields to sort the result with. Prefix the field name with `-` for descending order
and `+` for ascending order
range (str): A range describing the number of rows to be returned
nparent (int): Number of parent objects for a record to return. E.g. parent case(s) for a task or observable. The default used by TheHive when searching for these items is 10.
Returns:
response (requests.Response): Response object including a JSON array representing the list of searched records.
Expand All @@ -107,7 +108,8 @@ def __find_rows(self, find_url, **attributes):
# Add range and sort parameters
params = {
"range": attributes.get("range", "all"),
"sort": attributes.get("sort", [])
"sort": attributes.get("sort", []),
"nparent": attributes.get("nparent", 0)
}

# Add body
Expand Down

0 comments on commit 8e3ecc7

Please sign in to comment.