Module: FogExtensions::Proxmox::Server
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/fog_extensions/proxmox/server.rb
Instance Attribute Summary collapse
-
#image_id ⇒ Object
Returns the value of attribute image_id.
-
#templated ⇒ Object
Returns the value of attribute templated.
Instance Method Summary collapse
- #config_attributes=(attrs) ⇒ Object
- #description ⇒ Object
- #disks ⇒ Object
- #interfaces ⇒ Object
- #interfaces_attributes=(attrs) ⇒ Object
- #mac ⇒ Object
- #memory ⇒ Object
- #persisted? ⇒ Boolean
- #reboot ⇒ Object
- #reset ⇒ Object
- #select_nic(fog_nics, nic) ⇒ Object
- #start ⇒ Object
- #state ⇒ Object
- #stop ⇒ Object
- #templated? ⇒ Boolean
- #to_s ⇒ Object
- #vga ⇒ Object
- #vm_description ⇒ Object
- #volumes ⇒ Object
- #volumes_attributes=(attrs) ⇒ Object
Instance Attribute Details
#image_id ⇒ Object
Returns the value of attribute image_id.
24 25 26 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 24 def image_id @image_id end |
#templated ⇒ Object
Returns the value of attribute templated.
24 25 26 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 24 def templated @templated end |
Instance Method Details
#config_attributes=(attrs) ⇒ Object
76 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 76 def config_attributes=(attrs); end |
#description ⇒ Object
53 54 55 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 53 def description config.description end |
#disks ⇒ Object
68 69 70 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 68 def disks config.disks.collect { |disk| disk.id+': '+disk.volid } end |
#interfaces ⇒ Object
62 63 64 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 62 def interfaces config.interfaces end |
#interfaces_attributes=(attrs) ⇒ Object
74 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 74 def interfaces_attributes=(attrs); end |
#mac ⇒ Object
44 45 46 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 44 def mac config.mac_addresses.first end |
#memory ⇒ Object
47 48 49 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 47 def memory config.memory * 1024 * 1024 end |
#persisted? ⇒ Boolean
28 29 30 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 28 def persisted? !!identity && !!uptime end |
#reboot ⇒ Object
37 38 39 40 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 37 def reboot stop start end |
#reset ⇒ Object
41 42 43 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 41 def reset reboot end |
#select_nic(fog_nics, nic) ⇒ Object
59 60 61 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 59 def select_nic(fog_nics, nic) fog_nics.find {|fog_nic| fog_nic.identity.to_s == nic.identifier} end |
#start ⇒ Object
31 32 33 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 31 def start action('start') end |
#state ⇒ Object
50 51 52 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 50 def state qmpstatus end |
#stop ⇒ Object
34 35 36 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 34 def stop action('stop') end |
#templated? ⇒ Boolean
77 78 79 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 77 def templated? volumes.any? { |volume| volume.templated? } end |
#to_s ⇒ Object
25 26 27 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 25 def to_s name end |
#vga ⇒ Object
71 72 73 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 71 def vga config.vga end |
#vm_description ⇒ Object
56 57 58 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 56 def vm_description "Name=#{name}, vmid=#{vmid}" end |
#volumes ⇒ Object
65 66 67 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 65 def volumes config.disks.reject { |disk| disk.cdrom? } end |
#volumes_attributes=(attrs) ⇒ Object
75 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 75 def volumes_attributes=(attrs); end |