Class: MCollective::Util::Playbook::Nodes::PqlNodes

Inherits:
Object
  • Object
show all
Defined in:
lib/mcollective/util/playbook/nodes/pql_nodes.rb

Instance Method Summary collapse

Constructor Details

#initializePqlNodes

Returns a new instance of PqlNodes.



8
9
10
# File 'lib/mcollective/util/playbook/nodes/pql_nodes.rb', line 8

def initialize
  @query = nil
end

Instance Method Details

#choriaObject



18
19
20
# File 'lib/mcollective/util/playbook/nodes/pql_nodes.rb', line 18

def choria
  @_choria ||= Util::Choria.new(false)
end

#discoverObject

Performs the PQL query and extracts certnames



33
34
35
# File 'lib/mcollective/util/playbook/nodes/pql_nodes.rb', line 33

def discover
  choria.pql_query(@query, true)
end

#from_hash(data) ⇒ PqlNodes

Initialize the nodes source from a hash

Parameters:

  • data (Hash)

    input data matching nodes.json schema

Returns:



26
27
28
29
30
# File 'lib/mcollective/util/playbook/nodes/pql_nodes.rb', line 26

def from_hash(data)
  @query = data["query"]

  self
end

#prepareObject



12
# File 'lib/mcollective/util/playbook/nodes/pql_nodes.rb', line 12

def prepare; end

#validate_configuration!Object



14
15
16
# File 'lib/mcollective/util/playbook/nodes/pql_nodes.rb', line 14

def validate_configuration!
  raise("No PQL query specified") unless @query
end