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.



318
319
320
321
322
# File 'lib/nexpose/scan_engine.rb', line 318

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



314
315
316
# File 'lib/nexpose/scan_engine.rb', line 314

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



315
316
317
# File 'lib/nexpose/scan_engine.rb', line 315

def name
  @name
end

#scopeObject (readonly)

Returns the value of attribute scope.



316
317
318
# File 'lib/nexpose/scan_engine.rb', line 316

def scope
  @scope
end

Class Method Details

.listing(connection) ⇒ Object

Returns a summary list of all engine pools.



329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/nexpose/scan_engine.rb', line 329

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



324
325
326
# File 'lib/nexpose/scan_engine.rb', line 324

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