Class: ScoutScout::Descriptor
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- ScoutScout::Descriptor
- Defined in:
- lib/scout_scout/descriptor.rb
Instance Attribute Summary collapse
-
#plugin ⇒ Object
Returns the value of attribute plugin.
-
#server ⇒ Object
Returns the value of attribute server.
Class Method Summary collapse
-
.all(options = {}) ⇒ Array
Search for descriptors by matching name and hostname.
Instance Method Summary collapse
Instance Attribute Details
#plugin ⇒ Object
Returns the value of attribute plugin.
2 3 4 |
# File 'lib/scout_scout/descriptor.rb', line 2 def plugin @plugin end |
#server ⇒ Object
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
12 13 14 15 |
# File 'lib/scout_scout/descriptor.rb', line 12 def self.all( = {}) response = ScoutScout.get("/#{ScoutScout.account}/descriptors.xml?descriptor=#{CGI.escape([:descriptor] || String.new)}&host=#{[:host]}") response['ar_descriptors'] ? response['ar_descriptors'].map { |descriptor| ScoutScout::Descriptor.new(descriptor) } : Array.new end |
Instance Method Details
#average(opts = {}) ⇒ ScoutScout::Metric
18 19 20 |
# File 'lib/scout_scout/descriptor.rb', line 18 def average(opts = {}) ScoutScout::Cluster.average(name, (opts)) end |
#maximum(opts = {}) ⇒ ScoutScout::Metric
23 24 25 |
# File 'lib/scout_scout/descriptor.rb', line 23 def maximum(opts = {}) ScoutScout::Cluster.maximum(name, (opts)) end |