Class: Fog::Identity::OpenStack::Real

Inherits:
Object
  • Object
show all
Includes:
OpenStack::Core
Defined in:
lib/fog/identity/openstack.rb

Direct Known Subclasses

V2::Real, V3::Real

Constant Summary collapse

DEFAULT_SERVICE_TYPE_V3 =
%w(identity_v3 identityv3 identity).collect(&:freeze).freeze
DEFAULT_SERVICE_TYPE =
%w(identity).collect(&:freeze).freeze

Instance Attribute Summary

Attributes included from OpenStack::Core

#auth_token, #auth_token_expiration, #current_tenant, #current_user, #current_user_id, #openstack_cache_ttl, #openstack_domain_id, #openstack_domain_name, #openstack_identity_prefix, #openstack_project_domain, #openstack_project_domain_id, #openstack_project_id, #openstack_user_domain, #openstack_user_domain_id, #unscoped_token

Class Method Summary collapse

Instance Method Summary collapse

Methods included from OpenStack::Core

#credentials, #initialize_identity, #reload

Constructor Details

#initialize(options = {}) ⇒ Real

Returns a new instance of Real.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/fog/identity/openstack.rb', line 54

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

Class Method Details

.not_found_classObject



50
51
52
# File 'lib/fog/identity/openstack.rb', line 50

def self.not_found_class
  Fog::Identity::OpenStack::NotFound
end

Instance Method Details

#configObject



84
85
86
# File 'lib/fog/identity/openstack.rb', line 84

def config
  self
end

#config_service?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/fog/identity/openstack.rb', line 80

def config_service?
  true
end