Module: Fog::HuaweiCloud::Core
- Included in:
- Baremetal::HuaweiCloud::Real, Compute::HuaweiCloud::Mock, Compute::HuaweiCloud::Real, ContainerInfra::HuaweiCloud::Real, DNS::HuaweiCloud::V1::Real, DNS::HuaweiCloud::V2::Real, Event::HuaweiCloud::Real, Planning::Real, Identity::HuaweiCloud::Real, Identity::HuaweiCloud::V3::Mock, Image::HuaweiCloud::V1::Real, Image::HuaweiCloud::V2::Real, Introspection::HuaweiCloud::Mock, Introspection::HuaweiCloud::Real, KeyManager::HuaweiCloud::Real, Metering::HuaweiCloud::Real, Metric::HuaweiCloud::Real, Monitoring::HuaweiCloud::Real, NFV::HuaweiCloud::Mock, NFV::HuaweiCloud::Real, Network::HuaweiCloud::Mock, Network::HuaweiCloud::Real, Orchestration::HuaweiCloud::Real, SharedFileSystem::HuaweiCloud::Real, Storage::HuaweiCloud::Real, Volume::HuaweiCloud::V1::Real, Volume::HuaweiCloud::V2::Real, Workflow::HuaweiCloud::V2::Mock, Workflow::HuaweiCloud::V2::Real
- Defined in:
- lib/fog/huaweicloud/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.
-
#huaweicloud_cache_ttl ⇒ Object
readonly
Returns the value of attribute huaweicloud_cache_ttl.
-
#huaweicloud_domain_id ⇒ Object
readonly
Returns the value of attribute huaweicloud_domain_id.
-
#huaweicloud_domain_name ⇒ Object
readonly
Returns the value of attribute huaweicloud_domain_name.
-
#huaweicloud_identity_prefix ⇒ Object
readonly
Returns the value of attribute huaweicloud_identity_prefix.
-
#huaweicloud_path ⇒ Object
readonly
Returns the value of attribute huaweicloud_path.
-
#huaweicloud_project_domain ⇒ Object
readonly
Returns the value of attribute huaweicloud_project_domain.
-
#huaweicloud_project_domain_id ⇒ Object
readonly
Returns the value of attribute huaweicloud_project_domain_id.
-
#huaweicloud_project_id ⇒ Object
readonly
Returns the value of attribute huaweicloud_project_id.
-
#huaweicloud_user_domain ⇒ Object
readonly
Returns the value of attribute huaweicloud_user_domain.
-
#huaweicloud_user_domain_id ⇒ Object
readonly
Returns the value of attribute huaweicloud_user_domain_id.
-
#unscoped_token ⇒ Object
readonly
Returns the value of attribute unscoped_token.
Class Method Summary collapse
-
.not_found_class ⇒ Object
fallback.
Instance Method Summary collapse
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
4 5 6 |
# File 'lib/fog/huaweicloud/core.rb', line 4 def auth_token @auth_token end |
#auth_token_expiration ⇒ Object (readonly)
Returns the value of attribute auth_token_expiration.
7 8 9 |
# File 'lib/fog/huaweicloud/core.rb', line 7 def auth_token_expiration @auth_token_expiration end |
#current_tenant ⇒ Object (readonly)
Returns the value of attribute current_tenant.
10 11 12 |
# File 'lib/fog/huaweicloud/core.rb', line 10 def current_tenant @current_tenant end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
8 9 10 |
# File 'lib/fog/huaweicloud/core.rb', line 8 def current_user @current_user end |
#current_user_id ⇒ Object (readonly)
Returns the value of attribute current_user_id.
9 10 11 |
# File 'lib/fog/huaweicloud/core.rb', line 9 def current_user_id @current_user_id end |
#huaweicloud_cache_ttl ⇒ Object (readonly)
Returns the value of attribute huaweicloud_cache_ttl.
6 7 8 |
# File 'lib/fog/huaweicloud/core.rb', line 6 def huaweicloud_cache_ttl @huaweicloud_cache_ttl end |
#huaweicloud_domain_id ⇒ Object (readonly)
Returns the value of attribute huaweicloud_domain_id.
14 15 16 |
# File 'lib/fog/huaweicloud/core.rb', line 14 def huaweicloud_domain_id @huaweicloud_domain_id end |
#huaweicloud_domain_name ⇒ Object (readonly)
Returns the value of attribute huaweicloud_domain_name.
11 12 13 |
# File 'lib/fog/huaweicloud/core.rb', line 11 def huaweicloud_domain_name @huaweicloud_domain_name end |
#huaweicloud_identity_prefix ⇒ Object (readonly)
Returns the value of attribute huaweicloud_identity_prefix.
18 19 20 |
# File 'lib/fog/huaweicloud/core.rb', line 18 def huaweicloud_identity_prefix @huaweicloud_identity_prefix end |
#huaweicloud_path ⇒ Object (readonly)
Returns the value of attribute huaweicloud_path.
19 20 21 |
# File 'lib/fog/huaweicloud/core.rb', line 19 def huaweicloud_path @huaweicloud_path end |
#huaweicloud_project_domain ⇒ Object (readonly)
Returns the value of attribute huaweicloud_project_domain.
13 14 15 |
# File 'lib/fog/huaweicloud/core.rb', line 13 def huaweicloud_project_domain @huaweicloud_project_domain end |
#huaweicloud_project_domain_id ⇒ Object (readonly)
Returns the value of attribute huaweicloud_project_domain_id.
17 18 19 |
# File 'lib/fog/huaweicloud/core.rb', line 17 def huaweicloud_project_domain_id @huaweicloud_project_domain_id end |
#huaweicloud_project_id ⇒ Object (readonly)
Returns the value of attribute huaweicloud_project_id.
16 17 18 |
# File 'lib/fog/huaweicloud/core.rb', line 16 def huaweicloud_project_id @huaweicloud_project_id end |
#huaweicloud_user_domain ⇒ Object (readonly)
Returns the value of attribute huaweicloud_user_domain.
12 13 14 |
# File 'lib/fog/huaweicloud/core.rb', line 12 def huaweicloud_user_domain @huaweicloud_user_domain end |
#huaweicloud_user_domain_id ⇒ Object (readonly)
Returns the value of attribute huaweicloud_user_domain_id.
15 16 17 |
# File 'lib/fog/huaweicloud/core.rb', line 15 def huaweicloud_user_domain_id @huaweicloud_user_domain_id end |
#unscoped_token ⇒ Object (readonly)
Returns the value of attribute unscoped_token.
5 6 7 |
# File 'lib/fog/huaweicloud/core.rb', line 5 def unscoped_token @unscoped_token end |
Class Method Details
.not_found_class ⇒ Object
fallback
22 23 24 |
# File 'lib/fog/huaweicloud/core.rb', line 22 def self.not_found_class Fog::Compute::HuaweiCloud::NotFound end |
Instance Method Details
#credentials ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/fog/huaweicloud/core.rb', line 59 def credentials = { :provider => 'huaweicloud', :huaweicloud_auth_url => @huaweicloud_auth_uri.to_s, :huaweicloud_auth_token => @auth_token, :huaweicloud_identity_endpoint => @huaweicloud_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
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/fog/huaweicloud/core.rb', line 26 def initialize_identity() # Create @huaweicloud_* instance variables from all :huaweicloud_* options .select { |x| x.to_s.start_with? 'huaweicloud' }.each do |huaweicloud_param, value| instance_variable_set "@#{huaweicloud_param}".to_sym, value end @auth_token ||= [:huaweicloud_auth_token] @huaweicloud_identity_public_endpoint = [:huaweicloud_identity_endpoint] @huaweicloud_auth_uri = URI.parse([:huaweicloud_auth_url]) @huaweicloud_must_reauthenticate = false @huaweicloud_endpoint_type = [:huaweicloud_endpoint_type] || 'publicURL' @huaweicloud_cache_ttl = [:huaweicloud_cache_ttl] || 0 if @auth_token @huaweicloud_can_reauthenticate = false else missing_credentials = [] missing_credentials << :huaweicloud_api_key unless @huaweicloud_api_key unless @huaweicloud_username || @huaweicloud_userid missing_credentials << 'huaweicloud_username or huaweicloud_userid' end raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty? @huaweicloud_can_reauthenticate = true end @current_user = [:current_user] @current_user_id = [:current_user_id] @current_tenant = [:current_tenant] end |
#reload ⇒ Object
73 74 75 |
# File 'lib/fog/huaweicloud/core.rb', line 73 def reload @connection.reset end |