Module: FogExtensions::Kubevirt::Server
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActionView::Helpers::NumberHelper
- Defined in:
- app/models/concerns/fog_extensions/kubevirt/server.rb
Instance Attribute Summary collapse
-
#image_id ⇒ Object
Returns the value of attribute image_id.
Instance Method Summary collapse
- #interfaces_attributes=(attrs) ⇒ Object
-
#ip_addresses ⇒ Object
TODO: Update once new API for reporting IP_ADRESSSES is set.
- #mac ⇒ Object
- #poweroff ⇒ Object
- #reset ⇒ Object
- #select_nic(fog_nics, _nic) ⇒ Object
- #state ⇒ Object
- #to_s ⇒ Object
- #uuid ⇒ Object
- #vm_description ⇒ Object
- #volumes_attributes=(attrs) ⇒ Object
Instance Attribute Details
#image_id ⇒ Object
Returns the value of attribute image_id.
8 9 10 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 8 def image_id @image_id end |
Instance Method Details
#interfaces_attributes=(attrs) ⇒ Object
18 19 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 18 def interfaces_attributes=(attrs) end |
#ip_addresses ⇒ Object
TODO: Update once new API for reporting IP_ADRESSSES is set
33 34 35 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 33 def ip_addresses [interfaces&.first&.ip_address] end |
#mac ⇒ Object
28 29 30 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 28 def mac interfaces.map(&:mac_address).compact.min end |
#poweroff ⇒ Object
37 38 39 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 37 def poweroff stop end |
#reset ⇒ Object
41 42 43 44 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 41 def reset stop start end |
#select_nic(fog_nics, _nic) ⇒ Object
50 51 52 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 50 def select_nic(fog_nics, _nic) fog_nics.find { |iface| !iface.mac.nil? } end |
#state ⇒ Object
14 15 16 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 14 def state status end |
#to_s ⇒ Object
10 11 12 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 10 def to_s name end |
#uuid ⇒ Object
24 25 26 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 24 def uuid name end |
#vm_description ⇒ Object
46 47 48 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 46 def vm_description _("%{cpu_cores} Cores and %{memory} memory") % { :cpu_cores => cpu_cores, :memory => number_to_human_size(memory.to_i) } end |
#volumes_attributes=(attrs) ⇒ Object
21 22 |
# File 'app/models/concerns/fog_extensions/kubevirt/server.rb', line 21 def volumes_attributes=(attrs) end |