2010-05-24 17:29:01 +00:00
|
|
|
module Bluebox
|
|
|
|
class << self
|
2010-05-24 18:03:52 +00:00
|
|
|
|
2010-05-24 17:29:01 +00:00
|
|
|
if Fog.credentials[:bluebox_api_key]
|
|
|
|
|
|
|
|
def initialized?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def [](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
|
|
|
hash[key] = case key
|
2010-05-24 18:03:52 +00:00
|
|
|
when :blocks
|
2010-09-02 20:39:01 +00:00
|
|
|
Fog::Bluebox.new
|
2010-05-24 17:29:01 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
@@connections[service]
|
|
|
|
end
|
|
|
|
|
|
|
|
def flavors
|
2010-05-24 18:03:52 +00:00
|
|
|
self[:blocks].flavors
|
2010-05-24 17:29:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def images
|
2010-05-24 18:03:52 +00:00
|
|
|
self[:blocks].images
|
2010-05-24 17:29:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def servers
|
2010-05-24 18:03:52 +00:00
|
|
|
self[:blocks].servers
|
2010-05-24 17:29:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
def initialized?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|