Class: Nexpose::EngineListing
- Inherits:
-
Object
- Object
- Nexpose::EngineListing
- Defined in:
- lib/nexpose/scan_engine.rb
Overview
Description
Object that represents a listing of all of the scan engines available on to an NSC.
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
The last XML request sent by this object.
-
#engine_count ⇒ Object
readonly
The number of scan engines.
-
#engines ⇒ Object
readonly
Array containing (EngineSummary*).
-
#error ⇒ Object
readonly
true if an error condition exists; false otherwise.
-
#error_msg ⇒ Object
readonly
Error message string.
Instance Method Summary collapse
-
#initialize(connection) ⇒ EngineListing
constructor
Constructor EngineListing (connection).
Constructor Details
#initialize(connection) ⇒ EngineListing
Constructor EngineListing (connection)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/nexpose/scan_engine.rb', line 28 def initialize(connection) @connection = connection @engines = [] @engine_count = 0 @error = false r = @connection.execute('<EngineListingRequest session-id="' + @connection.session_id + '"/>', '1.2') if r.success r.res.elements.each('EngineListingResponse/EngineSummary') do |v| @engines.push(EngineSummary.new(v.attributes['id'], v.attributes['name'], v.attributes['address'], v.attributes['port'], v.attributes['status'])) end else @error = true @error_msg = 'EngineListingRequest Parse Error' end @engine_count = @engines.length end |
Instance Attribute Details
#connection ⇒ Object (readonly)
The last XML request sent by this object
20 21 22 |
# File 'lib/nexpose/scan_engine.rb', line 20 def connection @connection end |
#engine_count ⇒ Object (readonly)
The number of scan engines
24 25 26 |
# File 'lib/nexpose/scan_engine.rb', line 24 def engine_count @engine_count end |
#engines ⇒ Object (readonly)
Array containing (EngineSummary*)
22 23 24 |
# File 'lib/nexpose/scan_engine.rb', line 22 def engines @engines end |
#error ⇒ Object (readonly)
true if an error condition exists; false otherwise
16 17 18 |
# File 'lib/nexpose/scan_engine.rb', line 16 def error @error end |
#error_msg ⇒ Object (readonly)
Error message string
18 19 20 |
# File 'lib/nexpose/scan_engine.rb', line 18 def error_msg @error_msg end |