diff --git a/lib/Net/Nessus/REST.pm b/lib/Net/Nessus/REST.pm index 5648d6e..143e220 100644 --- a/lib/Net/Nessus/REST.pm +++ b/lib/Net/Nessus/REST.pm @@ -136,6 +136,16 @@ sub get_scan_details { return $result; } +sub stop_scan { + my ($self, %params) = @_; + + croak "missing scan_id parameter" unless $params{scan_id}; + + my $scan_id = delete $params{scan_id}; + my $result = $self->_get("/scans/$scan_id/stop", %params); + return $result; +} + sub set_scan_read_status { my ($self, %params) = @_; @@ -296,7 +306,11 @@ sub list_scanners { my ($self) = @_; my $result = $self->_get("/scanners"); - return $result->{scanner} ? @{$result->{scanner}} : (); + # I think that this may have changed in the Nessus API, because an array ref is returned + # the elements of that array being hash refs + # return $result->{scanner} ? @{$result->{scanner}} : (); + $result = [] unless ($result); + return wantarray ? @{$result} : $result; } sub list_folders { @@ -654,6 +668,12 @@ returns the details about a plugin family See L for details. +=head2 $nessus->stop_scan(scan_id => $scan_id ) + +Returns details for the given scan. + +See L for details. + =head1 LICENSE This program is free software: you can redistribute it and/or modify