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.


44364
44365
44366
44367
44368
44369
44370
44371
44372
44373
44374
44375
44376
44377
44378
# File 'lib/ovirtsdk4/types.rb', line 44364

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.


44383
44384
44385
44386
44387
44388
44389
44390
44391
44392
44393
44394
44395
44396
44397
# File 'lib/ovirtsdk4/types.rb', line 44383

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)

43991
43992
43993
# File 'lib/ovirtsdk4/types.rb', line 43991

def capability
  @capability
end

#capability=(value) ⇒ Object

Sets the value of the capability attribute.

Parameters:

  • value (String)

44000
44001
44002
# File 'lib/ovirtsdk4/types.rb', line 44000

def capability=(value)
  @capability = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

44009
44010
44011
# File 'lib/ovirtsdk4/types.rb', line 44009

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

44018
44019
44020
# File 'lib/ovirtsdk4/types.rb', line 44018

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

44027
44028
44029
# File 'lib/ovirtsdk4/types.rb', line 44027

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

44036
44037
44038
# File 'lib/ovirtsdk4/types.rb', line 44036

def description=(value)
  @description = value
end

#driverString

Returns the value of the driver attribute.

Returns:

  • (String)

44045
44046
44047
# File 'lib/ovirtsdk4/types.rb', line 44045

def driver
  @driver
end

#driver=(value) ⇒ Object

Sets the value of the driver attribute.

Parameters:

  • value (String)

44054
44055
44056
# File 'lib/ovirtsdk4/types.rb', line 44054

def driver=(value)
  @driver = value
end

#hashObject

Generates a hash value for this object.


44402
44403
44404
44405
44406
44407
44408
44409
44410
44411
44412
44413
44414
44415
44416
# File 'lib/ovirtsdk4/types.rb', line 44402

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:


44063
44064
44065
# File 'lib/ovirtsdk4/types.rb', line 44063

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)

44076
44077
44078
44079
44080
44081
# File 'lib/ovirtsdk4/types.rb', line 44076

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)

44088
44089
44090
# File 'lib/ovirtsdk4/types.rb', line 44088

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

44097
44098
44099
# File 'lib/ovirtsdk4/types.rb', line 44097

def id=(value)
  @id = value
end

#iommu_groupInteger

Returns the value of the iommu_group attribute.

Returns:

  • (Integer)

44106
44107
44108
# File 'lib/ovirtsdk4/types.rb', line 44106

def iommu_group
  @iommu_group
end

#iommu_group=(value) ⇒ Object

Sets the value of the iommu_group attribute.

Parameters:

  • value (Integer)

44115
44116
44117
# File 'lib/ovirtsdk4/types.rb', line 44115

def iommu_group=(value)
  @iommu_group = value
end

#m_dev_typesArray<MDevType>

Returns the value of the m_dev_types attribute.

Returns:


44124
44125
44126
# File 'lib/ovirtsdk4/types.rb', line 44124

def m_dev_types
  @m_dev_types
end

#m_dev_types=(list) ⇒ Object

Sets the value of the m_dev_types attribute.

Parameters:


44133
44134
44135
44136
44137
44138
44139
44140
44141
44142
44143
# File 'lib/ovirtsdk4/types.rb', line 44133

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)

44150
44151
44152
# File 'lib/ovirtsdk4/types.rb', line 44150

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

44159
44160
44161
# File 'lib/ovirtsdk4/types.rb', line 44159

def name=(value)
  @name = value
end

#parent_deviceHostDevice

Returns the value of the parent_device attribute.

Returns:


44168
44169
44170
# File 'lib/ovirtsdk4/types.rb', line 44168

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:


44181
44182
44183
44184
44185
44186
# File 'lib/ovirtsdk4/types.rb', line 44181

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:


44193
44194
44195
# File 'lib/ovirtsdk4/types.rb', line 44193

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:


44206
44207
44208
44209
44210
44211
# File 'lib/ovirtsdk4/types.rb', line 44206

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)

44218
44219
44220
# File 'lib/ovirtsdk4/types.rb', line 44218

def placeholder
  @placeholder
end

#placeholder=(value) ⇒ Object

Sets the value of the placeholder attribute.

Parameters:

  • value (Boolean)

44227
44228
44229
# File 'lib/ovirtsdk4/types.rb', line 44227

def placeholder=(value)
  @placeholder = value
end

#productProduct

Returns the value of the product attribute.

Returns:


44236
44237
44238
# File 'lib/ovirtsdk4/types.rb', line 44236

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:


44249
44250
44251
44252
44253
44254
# File 'lib/ovirtsdk4/types.rb', line 44249

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:


44261
44262
44263
# File 'lib/ovirtsdk4/types.rb', line 44261

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:


44274
44275
44276
44277
44278
44279
# File 'lib/ovirtsdk4/types.rb', line 44274

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)

44286
44287
44288
# File 'lib/ovirtsdk4/types.rb', line 44286

def virtual_functions
  @virtual_functions
end

#virtual_functions=(value) ⇒ Object

Sets the value of the virtual_functions attribute.

Parameters:

  • value (Integer)

44295
44296
44297
# File 'lib/ovirtsdk4/types.rb', line 44295

def virtual_functions=(value)
  @virtual_functions = value
end

#vmVm

Returns the value of the vm attribute.

Returns:


44304
44305
44306
# File 'lib/ovirtsdk4/types.rb', line 44304

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)

44317
44318
44319
44320
44321
44322
# File 'lib/ovirtsdk4/types.rb', line 44317

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