Class: Fog::Compute::Proxmox::ServerConfig

Inherits:
Proxmox::Model show all
Defined in:
lib/fog/compute/proxmox/models/server_config.rb

Overview

ServerConfig model

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Proxmox::Model

#create, #destroy, #inspect, #to_s, #update

Constructor Details

#initialize(attributes = {}) ⇒ ServerConfig

Returns a new instance of ServerConfig.


58
59
60
61
62
63
# File 'lib/fog/compute/proxmox/models/server_config.rb', line 58

def initialize(attributes = {})
  prepare_service_value(attributes)
  compute_nets(attributes)
  compute_disks(attributes)
  super(attributes)
end

Instance Attribute Details

#disksObject (readonly)

Returns the value of attribute disks


69
70
71
# File 'lib/fog/compute/proxmox/models/server_config.rb', line 69

def disks
  @disks
end

#interfacesObject (readonly)

Returns the value of attribute interfaces


71
72
73
# File 'lib/fog/compute/proxmox/models/server_config.rb', line 71

def interfaces
  @interfaces
end

Instance Method Details

#mac_addressesObject


65
66
67
# File 'lib/fog/compute/proxmox/models/server_config.rb', line 65

def mac_addresses
  Fog::Proxmox::NicHelper.to_mac_adresses_array(interfaces)
end

#type_consoleObject


73
74
75
76
77
78
# File 'lib/fog/compute/proxmox/models/server_config.rb', line 73

def type_console
  console = 'vnc' if %w[std cirrus vmware].include?(vga)
  console = 'spice' if %w[qxl qxl2 qxl3 qxl4].include?(vga)
  console = 'term' if %w[serial0 serial1 serial2 serial3].include?(vga)
  console
end