2010-11-08 07:21:31 -05:00
|
|
|
class Brightbox < Fog::Bin
|
|
|
|
class << self
|
|
|
|
|
2010-12-06 22:49:58 -05:00
|
|
|
def class_for(key)
|
|
|
|
case key
|
|
|
|
when :compute
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute::Brightbox
|
2010-12-06 22:49:58 -05:00
|
|
|
else
|
|
|
|
raise ArgumentError, "Unrecognized service: #{key}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-11-08 07:21:31 -05:00
|
|
|
def [](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
2011-01-14 13:41:12 -05:00
|
|
|
hash[key] = case key
|
2011-01-12 20:55:24 -05:00
|
|
|
when :compute
|
2011-06-29 04:10:33 -04:00
|
|
|
Formatador.display_line("[yellow][WARN] Brightbox[:compute] is deprecated, use Compute[:brightbox] instead[/]")
|
2011-01-12 20:55:24 -05:00
|
|
|
Fog::Compute.new(:provider => 'Brightbox')
|
|
|
|
else
|
2011-02-04 11:17:30 -05:00
|
|
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
2011-01-12 20:55:24 -05:00
|
|
|
end
|
2010-11-08 07:21:31 -05:00
|
|
|
end
|
|
|
|
@@connections[service]
|
|
|
|
end
|
|
|
|
|
|
|
|
def account
|
|
|
|
@@connections[:compute].account
|
|
|
|
end
|
|
|
|
|
2011-02-04 11:17:30 -05:00
|
|
|
def services
|
|
|
|
Fog::Brightbox.services
|
|
|
|
end
|
|
|
|
|
2010-11-08 07:21:31 -05:00
|
|
|
end
|
|
|
|
end
|