2010-06-03 21:32:59 -07:00
|
|
|
module Bluebox
|
|
|
|
|
|
|
|
def self.[](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
|
|
|
credentials = Fog.credentials.reject do |k,v|
|
|
|
|
![:bluebox_api_key, :bluebox_customer_id].include?(k)
|
|
|
|
end
|
|
|
|
hash[key] = case key
|
2010-09-09 17:50:38 -07:00
|
|
|
when :compute
|
|
|
|
Fog::Bluebox::Compute.new(credentials)
|
2010-06-03 21:32:59 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
@@connections[service]
|
|
|
|
end
|
|
|
|
|
2010-09-09 17:50:38 -07:00
|
|
|
module Compute
|
2010-06-03 21:32:59 -07:00
|
|
|
|
2010-09-09 17:50:38 -07:00
|
|
|
module Formats
|
|
|
|
|
|
|
|
PRODUCT = {
|
|
|
|
'cost' => Float,
|
|
|
|
'description' => String,
|
|
|
|
'id' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
end
|
2010-06-03 21:32:59 -07:00
|
|
|
|
|
|
|
end
|
|
|
|
|
2010-09-09 17:50:38 -07:00
|
|
|
end
|