File tree 4 files changed +36
-0
lines changed
4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -3805,6 +3805,7 @@ def get_tasks(
3805
3805
trash : Optional [bool ] = None ,
3806
3806
details : Optional [bool ] = None ,
3807
3807
schedules_only : Optional [bool ] = None ,
3808
+ ignore_pagination : Optional [bool ] = None ,
3808
3809
) -> T :
3809
3810
"""Request a list of tasks
3810
3811
@@ -3815,6 +3816,8 @@ def get_tasks(
3815
3816
details: Whether to include full task details
3816
3817
schedules_only: Whether to only include id, name and schedule
3817
3818
details
3819
+ ignore_pagination: Whether to ignore pagination settings (filter
3820
+ terms "first" and "rows"). Default is False.
3818
3821
"""
3819
3822
return self ._send_and_transform_command (
3820
3823
Tasks .get_tasks (
@@ -3823,6 +3826,7 @@ def get_tasks(
3823
3826
trash = trash ,
3824
3827
details = details ,
3825
3828
schedules_only = schedules_only ,
3829
+ ignore_pagination = ignore_pagination ,
3826
3830
)
3827
3831
)
3828
3832
Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ def get_tasks(
200
200
trash : Optional [bool ] = None ,
201
201
details : Optional [bool ] = None ,
202
202
schedules_only : Optional [bool ] = None ,
203
+ ignore_pagination : Optional [bool ] = None ,
203
204
) -> Request :
204
205
"""Request a list of tasks
205
206
@@ -210,6 +211,8 @@ def get_tasks(
210
211
details: Whether to include full task details
211
212
schedules_only: Whether to only include id, name and schedule
212
213
details
214
+ ignore_pagination: Whether to ignore pagination settings (filter
215
+ terms "first" and "rows"). Default is False.
213
216
"""
214
217
cmd = XmlCommand ("get_tasks" )
215
218
cmd .set_attribute ("usage_type" , "scan" )
@@ -225,6 +228,9 @@ def get_tasks(
225
228
if schedules_only is not None :
226
229
cmd .set_attribute ("schedules_only" , to_bool (schedules_only ))
227
230
231
+ if ignore_pagination is not None :
232
+ cmd .set_attribute ("ignore_pagination" , to_bool (ignore_pagination ))
233
+
228
234
return cmd
229
235
230
236
@classmethod
Original file line number Diff line number Diff line change @@ -453,6 +453,19 @@ def test_get_tasks_with_schedules_only(self):
453
453
b'<get_tasks usage_type="scan" schedules_only="0"/>' ,
454
454
)
455
455
456
+ def test_get_tasks_with_ignore_pagination (self ):
457
+ request = Tasks ().get_tasks (ignore_pagination = True )
458
+ self .assertEqual (
459
+ bytes (request ),
460
+ b'<get_tasks usage_type="scan" ignore_pagination="1"/>' ,
461
+ )
462
+
463
+ request = Tasks ().get_tasks (ignore_pagination = False )
464
+ self .assertEqual (
465
+ bytes (request ),
466
+ b'<get_tasks usage_type="scan" ignore_pagination="0"/>' ,
467
+ )
468
+
456
469
def test_get_task (self ):
457
470
request = Tasks ().get_task ("task_id" )
458
471
self .assertEqual (
Original file line number Diff line number Diff line change @@ -53,3 +53,16 @@ def test_get_tasks_with_schedules_only(self):
53
53
self .connection .send .has_been_called_with (
54
54
b'<get_tasks usage_type="scan" schedules_only="1"/>'
55
55
)
56
+
57
+ def test_get_tasks_with_ignore_pagination (self ):
58
+ self .gmp .get_tasks (ignore_pagination = True )
59
+
60
+ self .connection .send .has_been_called_with (
61
+ b'<get_tasks usage_type="scan" ignore_pagination="1"/>'
62
+ )
63
+
64
+ self .gmp .get_tasks (ignore_pagination = False )
65
+
66
+ self .connection .send .has_been_called_with (
67
+ b'<get_tasks usage_type="scan" ignore_pagination="0"/>'
68
+ )
You can’t perform that action at this time.
0 commit comments