2012-02-10 23:10:49 +08:00
|
|
|
class Joyent < Fog::Bin
|
|
|
|
class << self
|
|
|
|
|
|
|
|
def class_for(key)
|
|
|
|
case key
|
|
|
|
when :compute
|
|
|
|
Fog::Compute::Joyent
|
2014-01-03 14:25:59 -05:00
|
|
|
when :analytics
|
|
|
|
Fog::Joyent::Analytics
|
2012-02-10 23:10:49 +08:00
|
|
|
else
|
|
|
|
raise ArgumentError, "Unrecognized service: #{key}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def [](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
|
|
|
hash[key] = case key
|
|
|
|
when :compute
|
|
|
|
Fog::Logger.warning("Joyent[:compute] is not recommended, use Compute[:joyent] for portability")
|
|
|
|
Fog::Compute.new(:provider => 'Joyent')
|
2014-01-03 14:25:59 -05:00
|
|
|
when :analytics
|
|
|
|
Fog::Joyent::Analytics.new
|
2012-02-10 23:10:49 +08:00
|
|
|
else
|
|
|
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@@connections[service]
|
|
|
|
end
|
|
|
|
|
|
|
|
def services
|
|
|
|
Fog::Joyent.services
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|