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.
-
#ostemplate_file ⇒ Object
Returns the value of attribute ostemplate_file.
-
#ostemplate_storage ⇒ Object
Returns the value of attribute ostemplate_storage.
-
#password ⇒ Object
Returns the value of attribute password.
-
#start_after_create ⇒ Object
Returns the value of attribute start_after_create.
-
#templated ⇒ Object
Returns the value of attribute templated.
Instance Method Summary collapse
- #config_attributes=(attrs) ⇒ Object
- #disks ⇒ Object
- #interfaces_attributes=(attrs) ⇒ Object
- #mac ⇒ Object
- #memory ⇒ Object
- #nics ⇒ Object
- #reboot ⇒ Object
- #reset ⇒ Object
- #select_nic(fog_nics, nic) ⇒ Object
- #start ⇒ Object
- #state ⇒ Object
- #stop ⇒ Object
- #templated? ⇒ Boolean
- #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 |
#ostemplate_file ⇒ Object
Returns the value of attribute ostemplate_file.
24 25 26 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 24 def ostemplate_file @ostemplate_file end |
#ostemplate_storage ⇒ Object
Returns the value of attribute ostemplate_storage.
24 25 26 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 24 def ostemplate_storage @ostemplate_storage end |
#password ⇒ Object
Returns the value of attribute password.
24 25 26 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 24 def password @password end |
#start_after_create ⇒ Object
Returns the value of attribute start_after_create.
24 25 26 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 24 def start_after_create @start_after_create 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
86 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 86 def config_attributes=(attrs); end |
#disks ⇒ Object
75 76 77 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 75 def disks config.disks.collect(&:to_s) end |
#interfaces_attributes=(attrs) ⇒ Object
82 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 82 def interfaces_attributes=(attrs); end |
#mac ⇒ Object
43 44 45 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 43 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 maxmem.to_i end |
#nics ⇒ Object
67 68 69 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 67 def nics config.interfaces.collect(&:to_s) end |
#reboot ⇒ Object
34 35 36 37 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 34 def reboot stop start end |
#reset ⇒ Object
39 40 41 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 39 def reset reboot end |
#select_nic(fog_nics, nic) ⇒ Object
61 62 63 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 61 def select_nic(fog_nics, nic) fog_nics.find { |fog_nic| fog_nic.identity.to_s == nic.identifier } end |
#start ⇒ Object
26 27 28 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 26 def start action('start') end |
#state ⇒ Object
51 52 53 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 51 def state qmpstatus end |
#stop ⇒ Object
30 31 32 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 30 def stop action('stop') end |
#templated? ⇒ Boolean
88 89 90 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 88 def templated? volumes.any?(&:templated?) end |
#vm_description ⇒ Object
57 58 59 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 57 def vm_description "Name=#{name}, vmid=#{vmid}" end |
#volumes ⇒ Object
71 72 73 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 71 def volumes config.disks.reject(&:cdrom?) end |
#volumes_attributes=(attrs) ⇒ Object
84 |
# File 'app/models/concerns/fog_extensions/proxmox/server.rb', line 84 def volumes_attributes=(attrs); end |