Class: ScoutScout::Descriptor

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/scout_scout/descriptor.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pluginObject

Returns the value of attribute plugin.



2
3
4
# File 'lib/scout_scout/descriptor.rb', line 2

def plugin
  @plugin
end

#serverObject

Returns the value of attribute server.



2
3
4
# File 'lib/scout_scout/descriptor.rb', line 2

def server
  @server
end

Class Method Details

.all(options = {}) ⇒ Array

Search for descriptors by matching name and hostname.

Options:

  • :descriptor => The descriptor name to match

  • :host => The host name to match

Returns:

  • (Array)

    An array of ScoutScout::Descriptor objects



12
13
14
15
# File 'lib/scout_scout/descriptor.rb', line 12

def self.all(options = {})
  response = ScoutScout.get("/#{ScoutScout.}/descriptors.xml?descriptor=#{CGI.escape(options[:descriptor] || String.new)}&host=#{options[:host]}")
  response['ar_descriptors'] ? response['ar_descriptors'].map { |descriptor| ScoutScout::Descriptor.new(descriptor) } : Array.new
end

Instance Method Details

#average(opts = {}) ⇒ ScoutScout::Metric

Returns:



18
19
20
# File 'lib/scout_scout/descriptor.rb', line 18

def average(opts = {})
  ScoutScout::Cluster.average(name, options_for_relationship(opts))
end

#maximum(opts = {}) ⇒ ScoutScout::Metric

Returns:



23
24
25
# File 'lib/scout_scout/descriptor.rb', line 23

def maximum(opts = {})
  ScoutScout::Cluster.maximum(name, options_for_relationship(opts))
end