Module: Fog::Proxmox::Core

Included in:
Fog::Proxmox::Compute::Real, Identity::Real, Network::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.



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

def deadline
  @deadline
end

#principalObject (readonly)

Returns the value of attribute principal.



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

def principal
  @principal
end

#pve_csrftokenObject (readonly)

Returns the value of attribute pve_csrftoken.



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

def pve_csrftoken
  @pve_csrftoken
end

#pve_ticketObject

Returns the value of attribute pve_ticket.



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

def pve_ticket
  @pve_ticket
end

#pve_usernameObject (readonly)

Returns the value of attribute pve_username.



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

def pve_username
  @pve_username
end

Class Method Details

.not_found_classObject

fallback



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

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

Instance Method Details

#credentialsObject



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

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)


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

def initialize_identity(options)
  @principal = nil
  @pve_ticket = nil
  Fog::Proxmox::Variables.to_variables(self, options, 'pve')
  @pve_uri = URI.parse(@pve_url)
  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



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

def reload
  @connection.reset
end