Module: Fog::Proxmox::Core
- Included in:
- Fog::Proxmox::Compute::Real, Identity::Real, Network::Real, Storage::Real
- Defined in:
- lib/fog/proxmox/core.rb
Overview
Core module
Instance Attribute Summary collapse
-
#auth_method ⇒ Object
readonly
Returns the value of attribute auth_method.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#expires ⇒ Object
readonly
Returns the value of attribute expires.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
-
.not_found_class ⇒ Object
fallback.
Instance Method Summary collapse
- #credentials ⇒ Object
- #initialize(options = {}) ⇒ Object
- #reload ⇒ Object
- #setup(options) ⇒ Object
- #user_token? ⇒ Boolean
Instance Attribute Details
#auth_method ⇒ Object (readonly)
Returns the value of attribute auth_method.
29 30 31 |
# File 'lib/fog/proxmox/core.rb', line 29 def auth_method @auth_method end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
29 30 31 |
# File 'lib/fog/proxmox/core.rb', line 29 def current_user @current_user end |
#expires ⇒ Object (readonly)
Returns the value of attribute expires.
29 30 31 |
# File 'lib/fog/proxmox/core.rb', line 29 def expires @expires end |
#token ⇒ Object
Returns the value of attribute token.
28 29 30 |
# File 'lib/fog/proxmox/core.rb', line 28 def token @token end |
Class Method Details
Instance Method Details
#credentials ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/fog/proxmox/core.rb', line 68 def credentials = { provider: 'proxmox', proxmox_auth_method: @auth_method, proxmox_url: @proxmox_uri.to_s, current_user: @current_user } .merge end |
#initialize(options = {}) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/fog/proxmox/core.rb', line 40 def initialize( = {}) setup() authenticate @auth_token.missing_credentials() @connection = Fog::Core::Connection.new(@proxmox_url, @persistent, @connection_options) end |
#reload ⇒ Object
78 79 80 |
# File 'lib/fog/proxmox/core.rb', line 78 def reload @connection.reset end |
#setup(options) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/fog/proxmox/core.rb', line 47 def setup() if .respond_to?(:config_service?) && .config_service? configure() return end Fog::Proxmox::Variables.to_variables(self, , 'proxmox') @connection_options = [:connection_options] || {} @connection_options[:disable_proxy] = true if ENV['DISABLE_PROXY'] == 'true' @connection_options[:ssl_verify_peer] = false if ENV['SSL_VERIFY_PEER'] == 'false' @connection_options[:ignore_unexpected_eof] = true @proxmox_must_reauthenticate = true @persistent = [:persistent] || false @token ||= [:proxmox_token] @auth_method ||= [:proxmox_auth_method] @proxmox_can_reauthenticate = if @token false else true end end |
#user_token? ⇒ Boolean
31 32 33 |
# File 'lib/fog/proxmox/core.rb', line 31 def user_token? @auth_token == 'user_token' end |