Class: Nexpose::EnginePoolSummary

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

Overview

A summary of an engine pool.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of EnginePoolSummary.



38
39
40
41
42
# File 'lib/nexpose/pool.rb', line 38

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

Instance Attribute Details

#idObject (readonly)

Unique identifier of the engine pool.



32
33
34
# File 'lib/nexpose/pool.rb', line 32

def id
  @id
end

#nameObject (readonly)

Name of the engine pool.



34
35
36
# File 'lib/nexpose/pool.rb', line 34

def name
  @name
end

#scopeObject (readonly)

Whether the engine pool has global or silo scope.



36
37
38
# File 'lib/nexpose/pool.rb', line 36

def scope
  @scope
end

Instance Method Details

#as_xmlObject



55
56
57
58
59
60
# File 'lib/nexpose/pool.rb', line 55

def as_xml
  xml = REXML::Element.new('EnginePool')
  xml.add_attribute('name', @name)
  xml.add_attribute('scope', @scope)
  xml
end

#delete(conn) ⇒ Object

Deletes an engine pool

Parameters:

  • conn (Connection)

    Connection to console where site exists.



48
49
50
51
52
53
# File 'lib/nexpose/pool.rb', line 48

def delete(conn)
  xml = conn.make_xml('EnginePoolDeleteRequest')
  xml.add_element(as_xml)
  result = conn.execute(xml, '1.2')
  result.success
end