Class: Nexpose::EnginePoolSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/scan_engine.rb

Overview

A summary of an engine pool.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, scope = 'silo') ⇒ EnginePoolSummary

Returns a new instance of EnginePoolSummary.



299
300
301
302
303
# File 'lib/nexpose/scan_engine.rb', line 299

def initialize(id, name, scope = 'silo')
  @id = id
  @name = name
  @scope = scope
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



295
296
297
# File 'lib/nexpose/scan_engine.rb', line 295

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



296
297
298
# File 'lib/nexpose/scan_engine.rb', line 296

def name
  @name
end

#scopeObject (readonly)

Returns the value of attribute scope.



297
298
299
# File 'lib/nexpose/scan_engine.rb', line 297

def scope
  @scope
end

Class Method Details

.listing(connection) ⇒ Object

Returns a summary list of all engine pools.



310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/nexpose/scan_engine.rb', line 310

def self.listing(connection)
  xml = '<EnginePoolListingRequest session-id="' + connection.session_id + '" />'
  r = connection.execute(xml, '1.2')
  if r.success
    list = []
    r.res.elements.each('EnginePoolListingResponse/EnginePoolSummary') do |eps|
      list << EnginePoolSummary.new(eps.attributes['id'], eps.attributes['name'], eps.attributes['scope'])
    end
    list
  else
    @error = true
    @error_msg = 'EnginePoolListingResponse Parse Error'
  end
end

Instance Method Details

#to_sObject



305
306
307
# File 'lib/nexpose/scan_engine.rb', line 305

def to_s
  "Engine Pool: #{@name} [ID: #{@id}], scope: #{@scope}"
end