class Fog::Identity::OpenStack::Real
Constants
- DEFAULT_SERVICE_TYPE
- DEFAULT_SERVICE_TYPE_V3
Public Class Methods
new(options = {})
click to toggle source
# File lib/fog/openstack/identity.rb, line 53 def initialize(options = {}) if options.respond_to?(:config_service?) && options.config_service? configure(options) return end initialize_identity(options) @openstack_service_type = options[:openstack_service_type] || default_service_type(options) @openstack_service_name = options[:openstack_service_name] @connection_options = options[:connection_options] || {} @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL' initialize_endpoint_path_matches(options) authenticate if options[:openstack_identity_prefix] @path = "/#{options[:openstack_identity_prefix]}/#{@path}" end @persistent = options[:persistent] || false @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) end
not_found_class()
click to toggle source
# File lib/fog/openstack/identity.rb, line 48 def self.not_found_class Fog::Identity::OpenStack::NotFound end
Public Instance Methods
config()
click to toggle source
# File lib/fog/openstack/identity.rb, line 83 def config self end
config_service?()
click to toggle source
# File lib/fog/openstack/identity.rb, line 79 def config_service? true end
Private Instance Methods
configure(source)
click to toggle source
# File lib/fog/openstack/identity.rb, line 105 def configure(source) source.instance_variables.each do |v| instance_variable_set(v, source.instance_variable_get(v)) end end
default_service_type(options)
click to toggle source
# File lib/fog/openstack/identity.rb, line 89 def default_service_type(options) unless options[:openstack_identity_prefix] if @openstack_auth_uri.path =~ %r{/v3} || (options[:openstack_endpoint_path_matches] && options[:openstack_endpoint_path_matches] =~ '/v3') return DEFAULT_SERVICE_TYPE_V3 end end DEFAULT_SERVICE_TYPE end
initialize_endpoint_path_matches(options)
click to toggle source
# File lib/fog/openstack/identity.rb, line 99 def initialize_endpoint_path_matches(options) if options[:openstack_endpoint_path_matches] @openstack_endpoint_path_matches = options[:openstack_endpoint_path_matches] end end