Module: Resource::Exports
- Included in:
- NessusClient
- Defined in:
- lib/modules/exports.rb
Overview
Namespace for Exports resource.
Instance Method Summary collapse
-
#export_download(scan_id, file_id) ⇒ JSON
Download exported scan.
-
#export_request(scan_id, format = 'nessus') ⇒ JSON
Export the given scan.
-
#export_status(scan_id, file_id) ⇒ JSON
Check the file status of an exported scan.
Instance Method Details
#export_download(scan_id, file_id) ⇒ JSON
Download exported scan.
34 35 36 |
# File 'lib/modules/exports.rb', line 34 def export_download(scan_id, file_id) request.get({ path: "/scans/#{scan_id}/export/#{file_id}/download", headers: headers }) end |
#export_request(scan_id, format = 'nessus') ⇒ JSON
Export the given scan. Once requested, the file can be downloaded using the Resource::Tokens.token_download method upon receiving a “ready” status from the Resource::Tokens#token_status method. You can also use the older Resource::Exports#export_status and Resource::Exports#export_download methods.
9 10 11 12 |
# File 'lib/modules/exports.rb', line 9 def export_request(scan_id, format = 'nessus') payload = { format: format } request.post({ path: "/scans/#{scan_id}/export", payload: payload, headers: headers }) end |
#export_status(scan_id, file_id) ⇒ JSON
Check the file status of an exported scan. When an export has been requested, it is necessary to poll this resource until a “ready” status is returned, at which point the file is complete and can be downloaded using the export download resource.
21 22 23 |
# File 'lib/modules/exports.rb', line 21 def export_status(scan_id, file_id) request.get({ path: "/scans/#{scan_id}/export/#{file_id}/status", headers: headers }) end |