lib/nexpose/scan.rb
# Perform an ad hoc scan of a subset of devices for a site.
# Nexpose only allows devices from a single site to be submitted per
# request.
# Method is designed to take objects from a Device listing.
#
# For example:
#   devices = nsc.devices(5)
#   nsc.scan_devices(devices.take(10))
#
# @param [Array[Device]] devices List of devices to scan.
# @return [Scan] Scan launch information.
#
Perform an ad hoc scan of a subset of devices for a site.
Nexpose only allows devices from a single site to be submitted per
request.
Method is designed to take objects from a Device listing.


Perform an ad hoc scan of a subset of devices for a site . Nexpose only allows devices from a single site to be submitted per request . Method is designed to take objects from a Device listing .
def scan_devices(devices)
      site_id = devices.map { |d| d.site_id }.uniq.first
      xml = make_xml('SiteDevicesScanRequest', { 'site-id' => site_id })
      elem = REXML::Element.new('Devices')
      devices.each do |device|
        elem.add_element('device', { 'id' => "#{device.id}" })
      end
      xml.add_element(elem)
      _scan_ad_hoc(xml)
    end
def scan_devices ( devices ) site_id = devices . map { | d | d . site_id } . uniq . first xml = make_xml ( 'SiteDevicesScanRequest' , { 'site-id' => site_id } ) elem = REXML :: Element . new ( 'Devices' ) devices . each do | device | elem . add_element ( 'device' , { 'id' => "#{device.id}" } ) end xml . add_element ( elem ) _scan_ad_hoc ( xml ) end
Perform an ad hoc scan of a subset of devices for a site.
Perform an ad hoc scan of a subset of devices for a site .
Scan launch information.
Scan launch information .
Scan
devices
<not_specific>
]
<not_specific>
devices List of devices to scan.
devices List of devices to scan .