Class: Nexpose::EnginePoolSummary
- Inherits:
-
Object
- Object
- Nexpose::EnginePoolSummary
- Defined in:
- lib/nexpose/scan_engine.rb
Overview
A summary of an engine pool.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Class Method Summary collapse
-
.listing(connection) ⇒ Object
Returns a summary list of all engine pools.
Instance Method Summary collapse
-
#initialize(id, name, scope = 'silo') ⇒ EnginePoolSummary
constructor
A new instance of EnginePoolSummary.
- #to_s ⇒ Object
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
295 296 297 |
# File 'lib/nexpose/scan_engine.rb', line 295 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
296 297 298 |
# File 'lib/nexpose/scan_engine.rb', line 296 def name @name end |
#scope ⇒ Object (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_s ⇒ Object
305 306 307 |
# File 'lib/nexpose/scan_engine.rb', line 305 def to_s "Engine Pool: #{@name} [ID: #{@id}], scope: #{@scope}" end |