Class: Ploy::MetaOracle
- Inherits:
-
Object
- Object
- Ploy::MetaOracle
- Defined in:
- lib/ploy/metaoracle.rb
Instance Method Summary collapse
-
#initialize(stack) ⇒ MetaOracle
constructor
A new instance of MetaOracle.
- #meta(instance) ⇒ Object
- #oracle_uri(instance) ⇒ Object
- #query ⇒ Object
Constructor Details
#initialize(stack) ⇒ MetaOracle
Returns a new instance of MetaOracle.
6 7 8 |
# File 'lib/ploy/metaoracle.rb', line 6 def initialize(stack) @stack = stack end |
Instance Method Details
#meta(instance) ⇒ Object
20 21 22 |
# File 'lib/ploy/metaoracle.rb', line 20 def (instance) JSON.parse(Net::HTTP.get(oracle_uri(instance))) end |
#oracle_uri(instance) ⇒ Object
24 25 26 |
# File 'lib/ploy/metaoracle.rb', line 24 def oracle_uri(instance) URI("http://#{instance.private_ip_address}:9876/") end |
#query ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/ploy/metaoracle.rb', line 10 def query r = {} puts "query" AWS::EC2.new.instances.tagged_values(@stack).each do |i| puts "asking #{i.private_ip_address}" r[i.private_ip_address] = (i) end return r end |