Class: OvirtSDK4::HostDevice

Inherits:
Identified show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ HostDevice

Creates a new instance of the OvirtSDK4::HostDevice class.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :capability (String)

    The value of attribute capability.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :driver (String)

    The value of attribute driver.

  • :host (Host, Hash)

    The value of attribute host.

  • :id (String)

    The value of attribute id.

  • :iommu_group (Integer)

    The value of attribute iommu_group.

  • :m_dev_types (Array<MDevType>, Array<Hash>)

    The values of attribute m_dev_types.

  • :name (String)

    The value of attribute name.

  • :parent_device (HostDevice, Hash)

    The value of attribute parent_device.

  • :physical_function (HostDevice, Hash)

    The value of attribute physical_function.

  • :placeholder (Boolean)

    The value of attribute placeholder.

  • :product (Product, Hash)

    The value of attribute product.

  • :vendor (Vendor, Hash)

    The value of attribute vendor.

  • :virtual_functions (Integer)

    The value of attribute virtual_functions.

  • :vm (Vm, Hash)

    The value of attribute vm.



46705
46706
46707
46708
46709
46710
46711
46712
46713
46714
46715
46716
46717
46718
46719
# File 'lib/ovirtsdk4/types.rb', line 46705

def initialize(opts = {})
  super(opts)
  self.capability = opts[:capability]
  self.driver = opts[:driver]
  self.host = opts[:host]
  self.iommu_group = opts[:iommu_group]
  self.m_dev_types = opts[:m_dev_types]
  self.parent_device = opts[:parent_device]
  self.physical_function = opts[:physical_function]
  self.placeholder = opts[:placeholder]
  self.product = opts[:product]
  self.vendor = opts[:vendor]
  self.virtual_functions = opts[:virtual_functions]
  self.vm = opts[:vm]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



46724
46725
46726
46727
46728
46729
46730
46731
46732
46733
46734
46735
46736
46737
46738
# File 'lib/ovirtsdk4/types.rb', line 46724

def ==(other)
  super &&
  @capability == other.capability &&
  @driver == other.driver &&
  @host == other.host &&
  @iommu_group == other.iommu_group &&
  @m_dev_types == other.m_dev_types &&
  @parent_device == other.parent_device &&
  @physical_function == other.physical_function &&
  @placeholder == other.placeholder &&
  @product == other.product &&
  @vendor == other.vendor &&
  @virtual_functions == other.virtual_functions &&
  @vm == other.vm
end

#capabilityString

Returns the value of the capability attribute.

Returns:

  • (String)


46332
46333
46334
# File 'lib/ovirtsdk4/types.rb', line 46332

def capability
  @capability
end

#capability=(value) ⇒ Object

Sets the value of the capability attribute.

Parameters:

  • value (String)


46341
46342
46343
# File 'lib/ovirtsdk4/types.rb', line 46341

def capability=(value)
  @capability = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


46350
46351
46352
# File 'lib/ovirtsdk4/types.rb', line 46350

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


46359
46360
46361
# File 'lib/ovirtsdk4/types.rb', line 46359

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


46368
46369
46370
# File 'lib/ovirtsdk4/types.rb', line 46368

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


46377
46378
46379
# File 'lib/ovirtsdk4/types.rb', line 46377

def description=(value)
  @description = value
end

#driverString

Returns the value of the driver attribute.

Returns:

  • (String)


46386
46387
46388
# File 'lib/ovirtsdk4/types.rb', line 46386

def driver
  @driver
end

#driver=(value) ⇒ Object

Sets the value of the driver attribute.

Parameters:

  • value (String)


46395
46396
46397
# File 'lib/ovirtsdk4/types.rb', line 46395

def driver=(value)
  @driver = value
end

#hashObject

Generates a hash value for this object.



46743
46744
46745
46746
46747
46748
46749
46750
46751
46752
46753
46754
46755
46756
46757
# File 'lib/ovirtsdk4/types.rb', line 46743

def hash
  super +
  @capability.hash +
  @driver.hash +
  @host.hash +
  @iommu_group.hash +
  @m_dev_types.hash +
  @parent_device.hash +
  @physical_function.hash +
  @placeholder.hash +
  @product.hash +
  @vendor.hash +
  @virtual_functions.hash +
  @vm.hash
end

#hostHost

Returns the value of the host attribute.

Returns:



46404
46405
46406
# File 'lib/ovirtsdk4/types.rb', line 46404

def host
  @host
end

#host=(value) ⇒ Object

Sets the value of the host attribute.

The value parameter can be an instance of OvirtSDK4::Host or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Host, Hash)


46417
46418
46419
46420
46421
46422
# File 'lib/ovirtsdk4/types.rb', line 46417

def host=(value)
  if value.is_a?(Hash)
    value = Host.new(value)
  end
  @host = value
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


46429
46430
46431
# File 'lib/ovirtsdk4/types.rb', line 46429

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


46438
46439
46440
# File 'lib/ovirtsdk4/types.rb', line 46438

def id=(value)
  @id = value
end

#iommu_groupInteger

Returns the value of the iommu_group attribute.

Returns:

  • (Integer)


46447
46448
46449
# File 'lib/ovirtsdk4/types.rb', line 46447

def iommu_group
  @iommu_group
end

#iommu_group=(value) ⇒ Object

Sets the value of the iommu_group attribute.

Parameters:

  • value (Integer)


46456
46457
46458
# File 'lib/ovirtsdk4/types.rb', line 46456

def iommu_group=(value)
  @iommu_group = value
end

#m_dev_typesArray<MDevType>

Returns the value of the m_dev_types attribute.

Returns:



46465
46466
46467
# File 'lib/ovirtsdk4/types.rb', line 46465

def m_dev_types
  @m_dev_types
end

#m_dev_types=(list) ⇒ Object

Sets the value of the m_dev_types attribute.

Parameters:



46474
46475
46476
46477
46478
46479
46480
46481
46482
46483
46484
# File 'lib/ovirtsdk4/types.rb', line 46474

def m_dev_types=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = MDevType.new(value)
      end
    end
  end
  @m_dev_types = list
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


46491
46492
46493
# File 'lib/ovirtsdk4/types.rb', line 46491

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


46500
46501
46502
# File 'lib/ovirtsdk4/types.rb', line 46500

def name=(value)
  @name = value
end

#parent_deviceHostDevice

Returns the value of the parent_device attribute.

Returns:



46509
46510
46511
# File 'lib/ovirtsdk4/types.rb', line 46509

def parent_device
  @parent_device
end

#parent_device=(value) ⇒ Object

Sets the value of the parent_device attribute.

The value parameter can be an instance of OvirtSDK4::HostDevice or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



46522
46523
46524
46525
46526
46527
# File 'lib/ovirtsdk4/types.rb', line 46522

def parent_device=(value)
  if value.is_a?(Hash)
    value = HostDevice.new(value)
  end
  @parent_device = value
end

#physical_functionHostDevice

Returns the value of the physical_function attribute.

Returns:



46534
46535
46536
# File 'lib/ovirtsdk4/types.rb', line 46534

def physical_function
  @physical_function
end

#physical_function=(value) ⇒ Object

Sets the value of the physical_function attribute.

The value parameter can be an instance of OvirtSDK4::HostDevice or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



46547
46548
46549
46550
46551
46552
# File 'lib/ovirtsdk4/types.rb', line 46547

def physical_function=(value)
  if value.is_a?(Hash)
    value = HostDevice.new(value)
  end
  @physical_function = value
end

#placeholderBoolean

Returns the value of the placeholder attribute.

Returns:

  • (Boolean)


46559
46560
46561
# File 'lib/ovirtsdk4/types.rb', line 46559

def placeholder
  @placeholder
end

#placeholder=(value) ⇒ Object

Sets the value of the placeholder attribute.

Parameters:

  • value (Boolean)


46568
46569
46570
# File 'lib/ovirtsdk4/types.rb', line 46568

def placeholder=(value)
  @placeholder = value
end

#productProduct

Returns the value of the product attribute.

Returns:



46577
46578
46579
# File 'lib/ovirtsdk4/types.rb', line 46577

def product
  @product
end

#product=(value) ⇒ Object

Sets the value of the product attribute.

The value parameter can be an instance of Product or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



46590
46591
46592
46593
46594
46595
# File 'lib/ovirtsdk4/types.rb', line 46590

def product=(value)
  if value.is_a?(Hash)
    value = Product.new(value)
  end
  @product = value
end

#vendorVendor

Returns the value of the vendor attribute.

Returns:



46602
46603
46604
# File 'lib/ovirtsdk4/types.rb', line 46602

def vendor
  @vendor
end

#vendor=(value) ⇒ Object

Sets the value of the vendor attribute.

The value parameter can be an instance of Vendor or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



46615
46616
46617
46618
46619
46620
# File 'lib/ovirtsdk4/types.rb', line 46615

def vendor=(value)
  if value.is_a?(Hash)
    value = Vendor.new(value)
  end
  @vendor = value
end

#virtual_functionsInteger

Returns the value of the virtual_functions attribute.

Returns:

  • (Integer)


46627
46628
46629
# File 'lib/ovirtsdk4/types.rb', line 46627

def virtual_functions
  @virtual_functions
end

#virtual_functions=(value) ⇒ Object

Sets the value of the virtual_functions attribute.

Parameters:

  • value (Integer)


46636
46637
46638
# File 'lib/ovirtsdk4/types.rb', line 46636

def virtual_functions=(value)
  @virtual_functions = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



46645
46646
46647
# File 'lib/ovirtsdk4/types.rb', line 46645

def vm
  @vm
end

#vm=(value) ⇒ Object

Sets the value of the vm attribute.

The value parameter can be an instance of Vm or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Vm, Hash)


46658
46659
46660
46661
46662
46663
# File 'lib/ovirtsdk4/types.rb', line 46658

def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end