Method: HP::Cloud::Connection#service_type_name
- Defined in:
- lib/hpcloud/connection.rb
#service_type_name(account_name, name) ⇒ Object
lets identify the real service type name create support for account config to have a section called :service_catalog This section will identify mappings for keys like : object_storage, compute, block_storage, cdn
networking, dns, and load_balancer
The values can be the real names of the offerings. This enables private cloud implementations to have service catalog names that make more sense for there implementation.
287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
# File 'lib/hpcloud/connection.rb', line 287 def service_type_name(account_name, name) map_opts = get_acct_catalog_map(account_name) case map_opts[:provider] when "hp" service_name = name unless map_opts[:catalog].nil? service_catalog_key = name.to_s.downcase.gsub(' ','_').to_sym service_name = map_opts[:catalog][service_catalog_key] if map_opts[:catalog].has_key?(service_catalog_key) end return service_name else return name end end |