Module: Fog::Proxmox::Core

Included in:
Compute::Proxmox::Real, Identity::Proxmox::Real, Network::Proxmox::Real
Defined in:
lib/fog/proxmox/core.rb

Overview

Core module

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#deadlineObject (readonly)

Returns the value of attribute deadline


30
31
32
# File 'lib/fog/proxmox/core.rb', line 30

def deadline
  @deadline
end

#principalObject (readonly)

Returns the value of attribute principal


31
32
33
# File 'lib/fog/proxmox/core.rb', line 31

def principal
  @principal
end

#pve_csrftokenObject (readonly)

Returns the value of attribute pve_csrftoken


28
29
30
# File 'lib/fog/proxmox/core.rb', line 28

def pve_csrftoken
  @pve_csrftoken
end

#pve_ticketObject

Returns the value of attribute pve_ticket


27
28
29
# File 'lib/fog/proxmox/core.rb', line 27

def pve_ticket
  @pve_ticket
end

#pve_usernameObject (readonly)

Returns the value of attribute pve_username


29
30
31
# File 'lib/fog/proxmox/core.rb', line 29

def pve_username
  @pve_username
end

Class Method Details

.not_found_classObject

fallback


34
35
36
# File 'lib/fog/proxmox/core.rb', line 34

def self.not_found_class
  Fog::Compute::Proxmox::NotFound
end

Instance Method Details

#credentialsObject


55
56
57
58
59
60
61
62
63
64
# File 'lib/fog/proxmox/core.rb', line 55

def credentials
  options = {
    provider: 'proxmox',
    pve_url: @pve_uri.to_s,
    pve_ticket: @pve_ticket,
    pve_csrftoken: @pve_csrftoken,
    pve_username: @pve_username
  }
  pve_options.merge options
end

#initialize_identity(options) ⇒ Object

Raises:

  • (ArgumentError)

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fog/proxmox/core.rb', line 38

def initialize_identity(options)
  @principal = nil
  @pve_must_reauthenticate = true
  @pve_ticket = nil
  Fog::Proxmox::Variables.to_variables(self, options, 'pve')
  @pve_uri = URI.parse(@pve_url)
  @pve_must_reauthenticate = true unless @pve_ticket
  missing_credentials = []
  missing_credentials << :pve_username unless @pve_username

  unless @pve_ticket
    missing_credentials << :pve_password unless @pve_password
  end

  raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty?
end

#reloadObject


66
67
68
# File 'lib/fog/proxmox/core.rb', line 66

def reload
  @connection.reset
end