Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add incomplete_assets method #93

Merged
merged 1 commit into from
Nov 17, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/nexpose/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ def completed_assets(scan_id)
end
end

# Retrieve a list of assets which are incomplete in a given scan. If called
# during a scan, this method returns currently incomplete assets which may
# be in progress.
#
# @param [Fixnum] scan_id Unique identifier of a scan.
# @return [Array[IncompleteAsset]] List of incomplete assets.
#
def incomplete_assets(scan_id)
uri = "/data/asset/scan/#{scan_id}/incomplete-assets"
AJAX.preserving_preference(self, 'scan-incomplete-assets') do
data = DataTable._get_json_table(self, uri, {}, 500, nil, false)
data.map(&IncompleteAsset.method(:parse_json))
end
end

def delete_device(device_id)
r = execute(make_xml('DeviceDeleteRequest', { 'device-id' => device_id }))
r.success
Expand Down Expand Up @@ -188,4 +203,9 @@ def self.parse_json(json)
end
end
end

# Summary object of an incomplete asset for a scan.
#
class IncompleteAsset < CompletedAsset
end
end