2011-06-16 17:14:19 -04:00
|
|
|
class HP < Fog::Bin
|
|
|
|
class << self
|
|
|
|
|
|
|
|
def class_for(key)
|
|
|
|
case key
|
2013-01-14 17:51:41 -05:00
|
|
|
when :block_storage
|
|
|
|
Fog::HP::BlockStorage
|
2011-06-16 17:14:19 -04:00
|
|
|
when :cdn
|
2011-10-17 15:25:07 -04:00
|
|
|
Fog::CDN::HP
|
2011-06-16 17:14:19 -04:00
|
|
|
when :compute
|
2011-10-17 15:25:07 -04:00
|
|
|
Fog::Compute::HP
|
2011-06-16 17:14:19 -04:00
|
|
|
when :storage
|
2011-10-17 15:25:07 -04:00
|
|
|
Fog::Storage::HP
|
2011-06-16 17:14:19 -04:00
|
|
|
else
|
2011-06-15 02:10:54 -04:00
|
|
|
raise ArgumentError, "Unrecognized service: #{key}"
|
2011-06-16 17:14:19 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def [](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
|
|
|
hash[key] = case key
|
2013-01-14 17:51:41 -05:00
|
|
|
when :block_storage
|
|
|
|
Fog::HP::BlockStorage.new
|
2011-06-16 17:14:19 -04:00
|
|
|
when :cdn
|
2011-10-17 15:25:07 -04:00
|
|
|
Fog::Logger.warning("HP[:cdn] is deprecated, use CDN[:hp] instead")
|
2011-06-16 17:14:19 -04:00
|
|
|
Fog::CDN.new(:provider => 'HP')
|
|
|
|
when :compute
|
2011-10-17 15:25:07 -04:00
|
|
|
Fog::Logger.warning("HP[:compute] is deprecated, use Compute[:hp] instead")
|
2011-06-16 17:14:19 -04:00
|
|
|
Fog::Compute.new(:provider => 'HP')
|
|
|
|
when :storage
|
2011-10-17 15:25:07 -04:00
|
|
|
Fog::Logger.warning("HP[:storage] is deprecated, use Storage[:hp] instead")
|
2011-06-16 17:14:19 -04:00
|
|
|
Fog::Storage.new(:provider => 'HP')
|
|
|
|
else
|
|
|
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@@connections[service]
|
|
|
|
end
|
|
|
|
|
|
|
|
def services
|
|
|
|
Fog::HP.services
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|