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
2013-05-16 16:08:50 -04:00
when :block_storage_v2
Fog :: HP :: BlockStorageV2
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
2013-08-30 16:00:11 -04:00
when :dns
Fog :: HP :: DNS
when :lb
Fog :: HP :: LB
2013-03-21 18:54:24 -04:00
when :network
Fog :: HP :: Network
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
2013-08-30 16:00:11 -04:00
Fog :: Logger . deprecation " HP Cloud Block Storage V1 service will be soon deprecated. Please use `Fog::HP::BlockStorageV2` provider to use latest HP Cloud Block Storage service. "
2013-01-14 17:51:41 -05:00
Fog :: HP :: BlockStorage . new
2013-05-16 16:08:50 -04:00
when :block_storage_v2
Fog :: HP :: BlockStorageV2 . 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' )
2013-08-30 16:00:11 -04:00
when :dns
Fog :: HP :: DNS . new
when :lb
Fog :: HP :: LB . new
2013-03-21 18:54:24 -04:00
when :network
Fog :: HP :: Network . new
2011-06-16 17:14:19 -04:00
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