Sha256: a51935aef17edfeb8aa063cef367cea66b54bba9f55c123d492e90fc13d3aef3

Contents?: true

Size: 857 Bytes

Versions: 19

Compression:

Stored size: 857 Bytes

Contents

require "mcollective/util/choria"

module MCollective
  module Util
    class Playbook
      class Nodes
        class PqlNodes
          def initialize
            @query = nil
          end

          def prepare; end

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

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

          # Initialize the nodes source from a hash
          #
          # @param data [Hash] input data matching nodes.json schema
          # @return [PqlNodes]
          def from_hash(data)
            @query = data["query"]

            self
          end

          # Performs the PQL query and extracts certnames
          def discover
            choria.pql_query(@query, true)
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
choria-mcorpc-support-2.26.4 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.26.3 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.26.2 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.26.1 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.26.0 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.25.3 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.25.2 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.25.1 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.25.0 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.24.4 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.24.3 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.24.2 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.24.1 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.24.0 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.23.3 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.23.2 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.23.1 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.23.0 lib/mcollective/util/playbook/nodes/pql_nodes.rb
choria-mcorpc-support-2.23.0.pre lib/mcollective/util/playbook/nodes/pql_nodes.rb