class VirtualMachineDevice::Device
Device
Classes
Device
base class
@param id [Integer] The OpenNebula
resource id @param one_res [XMLElement] The OpenNebula
representation of the object @param vc_res [vCenter_class_specific] vCenter object representation
Public Class Methods
Source
# File lib/vm_device.rb, line 14 def initialize(id, one_res, vc_res) @id = id @one_res = one_res @vc_res = vc_res end
Public Instance Methods
Source
# File lib/vm_device.rb, line 69 def managed? raise_if_no_exists_in_one return unless @one_res !(@one_res['OPENNEBULA_MANAGED'] && @one_res['OPENNEBULA_MANAGED'].downcase == 'no') end
Source
# File lib/vm_device.rb, line 25 def one_item raise_if_no_exists_in_one @one_res end
Source
# File lib/vm_device.rb, line 44 def raise_if_no_exists_in_one raise 'OpenNebula device does not exist at the moment' unless one? end
Fails if the device is not present in OpenNebula
Source
# File lib/vm_device.rb, line 49 def raise_if_no_exists_in_vcenter raise 'vCenter device does not exist at the moment' unless exists? end
Fails if the device is not present in vCenter
Source
# File lib/vm_device.rb, line 30 def vc_item raise_if_no_exists_in_vcenter @vc_res end