Module: Fog::OpenStack::Core
- Included in:
- Baremetal::OpenStack::Real, Compute::OpenStack::Mock, Compute::OpenStack::Real, Identity::OpenStack::Common, Identity::OpenStack::V3::Mock, Image::OpenStack::Real, Metering::OpenStack::Real, Network::OpenStack::Mock, Network::OpenStack::Real, Fog::Openstack::Planning::Real, Fog::Orchestration::OpenStack::Real, Storage::OpenStack::Real, Volume::OpenStack::Real
- Defined in:
- lib/fog/openstack/core.rb
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#auth_token_expiration ⇒ Object
readonly
Returns the value of attribute auth_token_expiration.
-
#current_tenant ⇒ Object
readonly
Returns the value of attribute current_tenant.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#current_user_id ⇒ Object
readonly
Returns the value of attribute current_user_id.
-
#openstack_domain_id ⇒ Object
readonly
Returns the value of attribute openstack_domain_id.
-
#openstack_domain_name ⇒ Object
readonly
Returns the value of attribute openstack_domain_name.
-
#openstack_project_domain ⇒ Object
readonly
Returns the value of attribute openstack_project_domain.
-
#openstack_project_domain_id ⇒ Object
readonly
Returns the value of attribute openstack_project_domain_id.
-
#openstack_user_domain ⇒ Object
readonly
Returns the value of attribute openstack_user_domain.
-
#openstack_user_domain_id ⇒ Object
readonly
Returns the value of attribute openstack_user_domain_id.
Instance Method Summary collapse
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
59 60 61 |
# File 'lib/fog/openstack/core.rb', line 59 def auth_token @auth_token end |
#auth_token_expiration ⇒ Object (readonly)
Returns the value of attribute auth_token_expiration.
60 61 62 |
# File 'lib/fog/openstack/core.rb', line 60 def auth_token_expiration @auth_token_expiration end |
#current_tenant ⇒ Object (readonly)
Returns the value of attribute current_tenant.
63 64 65 |
# File 'lib/fog/openstack/core.rb', line 63 def current_tenant @current_tenant end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
61 62 63 |
# File 'lib/fog/openstack/core.rb', line 61 def current_user @current_user end |
#current_user_id ⇒ Object (readonly)
Returns the value of attribute current_user_id.
62 63 64 |
# File 'lib/fog/openstack/core.rb', line 62 def current_user_id @current_user_id end |
#openstack_domain_id ⇒ Object (readonly)
Returns the value of attribute openstack_domain_id.
67 68 69 |
# File 'lib/fog/openstack/core.rb', line 67 def openstack_domain_id @openstack_domain_id end |
#openstack_domain_name ⇒ Object (readonly)
Returns the value of attribute openstack_domain_name.
64 65 66 |
# File 'lib/fog/openstack/core.rb', line 64 def openstack_domain_name @openstack_domain_name end |
#openstack_project_domain ⇒ Object (readonly)
Returns the value of attribute openstack_project_domain.
66 67 68 |
# File 'lib/fog/openstack/core.rb', line 66 def openstack_project_domain @openstack_project_domain end |
#openstack_project_domain_id ⇒ Object (readonly)
Returns the value of attribute openstack_project_domain_id.
69 70 71 |
# File 'lib/fog/openstack/core.rb', line 69 def openstack_project_domain_id @openstack_project_domain_id end |
#openstack_user_domain ⇒ Object (readonly)
Returns the value of attribute openstack_user_domain.
65 66 67 |
# File 'lib/fog/openstack/core.rb', line 65 def openstack_user_domain @openstack_user_domain end |
#openstack_user_domain_id ⇒ Object (readonly)
Returns the value of attribute openstack_user_domain_id.
68 69 70 |
# File 'lib/fog/openstack/core.rb', line 68 def openstack_user_domain_id @openstack_user_domain_id end |
Instance Method Details
#credentials ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/fog/openstack/core.rb', line 100 def credentials = { :provider => 'openstack', :openstack_auth_url => @openstack_auth_uri.to_s, :openstack_auth_token => @auth_token, :openstack_identity_endpoint => @openstack_identity_public_endpoint, :current_user => @current_user, :current_user_id => @current_user_id, :current_tenant => @current_tenant, :unscoped_token => @unscoped_token} .merge end |
#initialize_identity(options) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/fog/openstack/core.rb', line 71 def initialize_identity # Create @openstack_* instance variables from all :openstack_* options .select{|x|x.to_s.start_with? 'openstack'}.each do |openstack_param, value| instance_variable_set "@#{openstack_param}".to_sym, value end @auth_token ||= [:openstack_auth_token] @openstack_identity_public_endpoint = [:openstack_identity_endpoint] @openstack_auth_uri = URI.parse([:openstack_auth_url]) @openstack_must_reauthenticate = false @openstack_endpoint_type = [:openstack_endpoint_type] || 'publicURL' unless @auth_token missing_credentials = Array.new missing_credentials << :openstack_api_key unless @openstack_api_key unless @openstack_username || @openstack_userid missing_credentials << 'openstack_username or openstack_userid' end raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty? end @current_user = [:current_user] @current_user_id = [:current_user_id] @current_tenant = [:current_tenant] end |
#reload ⇒ Object
113 114 115 |
# File 'lib/fog/openstack/core.rb', line 113 def reload @connection.reset end |