1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

change service catalog lookup to be type based

This commit is contained in:
Mike Hagedorn 2014-08-11 16:06:43 -04:00
parent b9b5b23197
commit 3753b5f1a1
6 changed files with 15 additions and 7 deletions

View file

@ -96,7 +96,7 @@ module Fog
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
auth_version = options[:hp_auth_version] || :v2
### Pass the service name for block storage to the authentication call
options[:hp_service_type] ||= "Block Storage"
options[:hp_service_type] ||= "volume"
@hp_tenant_id = options[:hp_tenant_id]
@hp_avl_zone = options[:hp_avl_zone]

View file

@ -244,7 +244,7 @@ module Fog
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
auth_version = options[:hp_auth_version] || :v2
### Pass the service name for compute via the options hash
options[:hp_service_type] ||= "Compute"
options[:hp_service_type] ||= "compute"
@hp_tenant_id = options[:hp_tenant_id]
### Make the authentication call

View file

@ -67,7 +67,7 @@ module Fog
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
auth_version = options[:hp_auth_version] || :v2
### Pass the service name for object storage to the authentication call
options[:hp_service_type] ||= "DNS"
options[:hp_service_type] ||= "hpext:dns"
@hp_tenant_id = options[:hp_tenant_id]
@hp_avl_zone = options[:hp_avl_zone]

View file

@ -101,7 +101,7 @@ module Fog
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
auth_version = options[:hp_auth_version] || :v2
### Pass the service name for object storage to the authentication call
options[:hp_service_type] ||= "Load Balancer"
options[:hp_service_type] ||= "hpext:lbaas"
@hp_tenant_id = options[:hp_tenant_id]
@hp_avl_zone = options[:hp_avl_zone]

View file

@ -125,7 +125,7 @@ module Fog
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
auth_version = options[:hp_auth_version] || :v2
### Pass the service name for network to the authentication call
options[:hp_service_type] ||= "Networking"
options[:hp_service_type] ||= "network"
@hp_tenant_id = options[:hp_tenant_id]
@hp_avl_zone = options[:hp_avl_zone]
@ -134,6 +134,7 @@ module Fog
# Call the control services authentication
credentials = Fog::HP.authenticate_v2(options, @connection_options)
# the CS service catalog returns the network endpoint
@hp_network_uri = credentials[:endpoint_url]
@credentials = credentials
else
@ -152,6 +153,7 @@ module Fog
@port = uri.port
@scheme = uri.scheme
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end
@ -161,13 +163,19 @@ module Fog
def request(params, parse_json = true, &block)
begin
if @path == "/"
#helion network @path is "/"
@calculated_path = "v2.0/#{params[:path]}"
else
@calculated_path = "#{@path}/v2.0/#{params[:path]}"
end
response = @connection.request(params.merge!({
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:path => "#{@path}/v2.0/#{params[:path]}"
:path => @calculated_path
}), &block)
rescue Excon::Errors::HTTPStatusError => error
raise case error

View file

@ -326,7 +326,7 @@ module Fog
auth_version = auth_version.to_s.downcase.to_sym
### Pass the service name for object storage to the authentication call
options[:hp_service_type] ||= "Object Storage"
options[:hp_service_type] ||= " object-store"
@hp_tenant_id = options[:hp_tenant_id]
@hp_avl_zone = options[:hp_avl_zone]