Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit d102a22

Browse files
authored
[clien] Implement get all on intrusion sets (#586)
1 parent 48e0797 commit d102a22

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

pycti/entities/opencti_intrusion_set.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,33 @@ def list(self, **kwargs):
286286
"orderMode": order_mode,
287287
},
288288
)
289-
return self.opencti.process_multiple(
290-
result["data"]["intrusionSets"], with_pagination
291-
)
289+
if get_all:
290+
final_data = []
291+
data = self.opencti.process_multiple(result["data"]["intrusionSets"])
292+
final_data = final_data + data
293+
while result["data"]["intrusionSets"]["pageInfo"]["hasNextPage"]:
294+
after = result["data"]["intrusionSets"]["pageInfo"]["endCursor"]
295+
self.opencti.app_logger.info(
296+
"Listing Intrusion-Sets", {"after": after}
297+
)
298+
result = self.opencti.query(
299+
query,
300+
{
301+
"filters": filters,
302+
"search": search,
303+
"first": first,
304+
"after": after,
305+
"orderBy": order_by,
306+
"orderMode": order_mode,
307+
},
308+
)
309+
data = self.opencti.process_multiple(result["data"]["intrusionSets"])
310+
final_data = final_data + data
311+
return final_data
312+
else:
313+
return self.opencti.process_multiple(
314+
result["data"]["intrusionSets"], with_pagination
315+
)
292316

293317
"""
294318
Read a Intrusion-Set object

0 commit comments

Comments
 (0)