2010-09-21 14:11:15 -04:00
|
|
|
class Rackspace < Fog::Bin
|
2010-02-12 00:41:37 -05:00
|
|
|
class << self
|
|
|
|
|
2010-09-21 14:11:15 -04:00
|
|
|
def [](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
|
|
|
hash[key] = case key
|
|
|
|
when :compute
|
|
|
|
Fog::Rackspace::Compute.new
|
|
|
|
when :files
|
|
|
|
location = caller.first
|
|
|
|
warning = "[yellow][WARN] Rackspace[:files] is deprecated, use Rackspace[:storage] instead[/]"
|
|
|
|
warning << " [light_black](" << location << ")[/] "
|
|
|
|
Formatador.display_line(warning)
|
|
|
|
Fog::Rackspace::Storage.new
|
|
|
|
when :servers
|
|
|
|
location = caller.first
|
|
|
|
warning = "[yellow][WARN] Rackspace[:servers] is deprecated, use Rackspace[:compute] instead[/]"
|
|
|
|
warning << " [light_black](" << location << ")[/] "
|
|
|
|
Formatador.display_line(warning)
|
|
|
|
Fog::Rackspace::Compute.new
|
|
|
|
when :storage
|
|
|
|
Fog::Rackspace::Storage.new
|
2010-02-12 00:41:37 -05:00
|
|
|
end
|
|
|
|
end
|
2010-09-21 14:11:15 -04:00
|
|
|
@@connections[service]
|
|
|
|
end
|
2010-02-12 00:41:37 -05:00
|
|
|
|
2010-09-21 14:11:15 -04:00
|
|
|
def services
|
|
|
|
[:compute, :storage]
|
2010-02-12 00:41:37 -05:00
|
|
|
end
|
2010-09-21 14:11:15 -04:00
|
|
|
|
2010-02-12 00:41:37 -05:00
|
|
|
end
|
2010-09-08 16:50:23 -04:00
|
|
|
end
|