Class: OvirtSDK4::Nic

Inherits:
Device 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 = {}) ⇒ Nic

Creates a new instance of the OvirtSDK4::Nic 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):

  • :boot_protocol (BootProtocol)

    The value of attribute boot_protocol.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :instance_type (InstanceType, Hash)

    The value of attribute instance_type.

  • :interface (NicInterface)

    The value of attribute interface.

  • :linked (Boolean)

    The value of attribute linked.

  • :mac (Mac, Hash)

    The value of attribute mac.

  • :name (String)

    The value of attribute name.

  • :network (Network, Hash)

    The value of attribute network.

  • :network_attachments (Array<NetworkAttachment>, Array<Hash>)

    The values of attribute network_attachments.

  • :network_filter_parameters (Array<NetworkFilterParameter>, Array<Hash>)

    The values of attribute network_filter_parameters.

  • :network_labels (Array<NetworkLabel>, Array<Hash>)

    The values of attribute network_labels.

  • :on_boot (Boolean)

    The value of attribute on_boot.

  • :plugged (Boolean)

    The value of attribute plugged.

  • :reported_devices (Array<ReportedDevice>, Array<Hash>)

    The values of attribute reported_devices.

  • :statistics (Array<Statistic>, Array<Hash>)

    The values of attribute statistics.

  • :template (Template, Hash)

    The value of attribute template.

  • :virtual_function_allowed_labels (Array<NetworkLabel>, Array<Hash>)

    The values of attribute virtual_function_allowed_labels.

  • :virtual_function_allowed_networks (Array<Network>, Array<Hash>)

    The values of attribute virtual_function_allowed_networks.

  • :vm (Vm, Hash)

    The value of attribute vm.

  • :vms (Array<Vm>, Array<Hash>)

    The values of attribute vms.

  • :vnic_profile (VnicProfile, Hash)

    The value of attribute vnic_profile.



44738
44739
44740
44741
44742
44743
44744
44745
44746
44747
44748
44749
44750
44751
44752
44753
44754
44755
# File 'lib/ovirtsdk4/types.rb', line 44738

def initialize(opts = {})
  super(opts)
  self.boot_protocol = opts[:boot_protocol]
  self.interface = opts[:interface]
  self.linked = opts[:linked]
  self.mac = opts[:mac]
  self.network = opts[:network]
  self.network_attachments = opts[:network_attachments]
  self.network_filter_parameters = opts[:network_filter_parameters]
  self.network_labels = opts[:network_labels]
  self.on_boot = opts[:on_boot]
  self.plugged = opts[:plugged]
  self.reported_devices = opts[:reported_devices]
  self.statistics = opts[:statistics]
  self.virtual_function_allowed_labels = opts[:virtual_function_allowed_labels]
  self.virtual_function_allowed_networks = opts[:virtual_function_allowed_networks]
  self.vnic_profile = opts[:vnic_profile]
end

Instance Method Details

#==(other) ⇒ Object

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



44760
44761
44762
44763
44764
44765
44766
44767
44768
44769
44770
44771
44772
44773
44774
44775
44776
44777
# File 'lib/ovirtsdk4/types.rb', line 44760

def ==(other)
  super &&
  @boot_protocol == other.boot_protocol &&
  @interface == other.interface &&
  @linked == other.linked &&
  @mac == other.mac &&
  @network == other.network &&
  @network_attachments == other.network_attachments &&
  @network_filter_parameters == other.network_filter_parameters &&
  @network_labels == other.network_labels &&
  @on_boot == other.on_boot &&
  @plugged == other.plugged &&
  @reported_devices == other.reported_devices &&
  @statistics == other.statistics &&
  @virtual_function_allowed_labels == other.virtual_function_allowed_labels &&
  @virtual_function_allowed_networks == other.virtual_function_allowed_networks &&
  @vnic_profile == other.vnic_profile
end

#boot_protocolBootProtocol

Returns the value of the boot_protocol attribute.

Returns:



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

def boot_protocol
  @boot_protocol
end

#boot_protocol=(value) ⇒ Object

Sets the value of the boot_protocol attribute.

Parameters:



44178
44179
44180
# File 'lib/ovirtsdk4/types.rb', line 44178

def boot_protocol=(value)
  @boot_protocol = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


44187
44188
44189
# File 'lib/ovirtsdk4/types.rb', line 44187

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


44196
44197
44198
# File 'lib/ovirtsdk4/types.rb', line 44196

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


44205
44206
44207
# File 'lib/ovirtsdk4/types.rb', line 44205

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


44214
44215
44216
# File 'lib/ovirtsdk4/types.rb', line 44214

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



44782
44783
44784
44785
44786
44787
44788
44789
44790
44791
44792
44793
44794
44795
44796
44797
44798
44799
# File 'lib/ovirtsdk4/types.rb', line 44782

def hash
  super +
  @boot_protocol.hash +
  @interface.hash +
  @linked.hash +
  @mac.hash +
  @network.hash +
  @network_attachments.hash +
  @network_filter_parameters.hash +
  @network_labels.hash +
  @on_boot.hash +
  @plugged.hash +
  @reported_devices.hash +
  @statistics.hash +
  @virtual_function_allowed_labels.hash +
  @virtual_function_allowed_networks.hash +
  @vnic_profile.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


44223
44224
44225
# File 'lib/ovirtsdk4/types.rb', line 44223

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


44232
44233
44234
# File 'lib/ovirtsdk4/types.rb', line 44232

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:



44241
44242
44243
# File 'lib/ovirtsdk4/types.rb', line 44241

def instance_type
  @instance_type
end

#instance_type=(value) ⇒ Object

Sets the value of the instance_type attribute.

The value parameter can be an instance of InstanceType 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:



44254
44255
44256
44257
44258
44259
# File 'lib/ovirtsdk4/types.rb', line 44254

def instance_type=(value)
  if value.is_a?(Hash)
    value = InstanceType.new(value)
  end
  @instance_type = value
end

#interfaceNicInterface

Returns the value of the interface attribute.

Returns:



44266
44267
44268
# File 'lib/ovirtsdk4/types.rb', line 44266

def interface
  @interface
end

#interface=(value) ⇒ Object

Sets the value of the interface attribute.

Parameters:



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

def interface=(value)
  @interface = value
end

#linkedBoolean

Returns the value of the linked attribute.

Returns:

  • (Boolean)


44284
44285
44286
# File 'lib/ovirtsdk4/types.rb', line 44284

def linked
  @linked
end

#linked=(value) ⇒ Object

Sets the value of the linked attribute.

Parameters:

  • value (Boolean)


44293
44294
44295
# File 'lib/ovirtsdk4/types.rb', line 44293

def linked=(value)
  @linked = value
end

#macMac

Returns the value of the mac attribute.

Returns:



44302
44303
44304
# File 'lib/ovirtsdk4/types.rb', line 44302

def mac
  @mac
end

#mac=(value) ⇒ Object

Sets the value of the mac attribute.

The value parameter can be an instance of Mac 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 (Mac, Hash)


44315
44316
44317
44318
44319
44320
# File 'lib/ovirtsdk4/types.rb', line 44315

def mac=(value)
  if value.is_a?(Hash)
    value = Mac.new(value)
  end
  @mac = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


44327
44328
44329
# File 'lib/ovirtsdk4/types.rb', line 44327

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


44336
44337
44338
# File 'lib/ovirtsdk4/types.rb', line 44336

def name=(value)
  @name = value
end

#networkNetwork

Returns the value of the network attribute.

Returns:



44345
44346
44347
# File 'lib/ovirtsdk4/types.rb', line 44345

def network
  @network
end

#network=(value) ⇒ Object

Sets the value of the network attribute.

The value parameter can be an instance of OvirtSDK4::Network 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:



44358
44359
44360
44361
44362
44363
# File 'lib/ovirtsdk4/types.rb', line 44358

def network=(value)
  if value.is_a?(Hash)
    value = Network.new(value)
  end
  @network = value
end

#network_attachmentsArray<NetworkAttachment>

Returns the value of the network_attachments attribute.

Returns:



44370
44371
44372
# File 'lib/ovirtsdk4/types.rb', line 44370

def network_attachments
  @network_attachments
end

#network_attachments=(list) ⇒ Object

Sets the value of the network_attachments attribute.

Parameters:



44379
44380
44381
44382
44383
44384
44385
44386
44387
44388
44389
# File 'lib/ovirtsdk4/types.rb', line 44379

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

#network_filter_parametersArray<NetworkFilterParameter>

Returns the value of the network_filter_parameters attribute.

Returns:



44396
44397
44398
# File 'lib/ovirtsdk4/types.rb', line 44396

def network_filter_parameters
  @network_filter_parameters
end

#network_filter_parameters=(list) ⇒ Object

Sets the value of the network_filter_parameters attribute.

Parameters:



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

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

#network_labelsArray<NetworkLabel>

Returns the value of the network_labels attribute.

Returns:



44422
44423
44424
# File 'lib/ovirtsdk4/types.rb', line 44422

def network_labels
  @network_labels
end

#network_labels=(list) ⇒ Object

Sets the value of the network_labels attribute.

Parameters:



44431
44432
44433
44434
44435
44436
44437
44438
44439
44440
44441
# File 'lib/ovirtsdk4/types.rb', line 44431

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

#on_bootBoolean

Returns the value of the on_boot attribute.

Returns:

  • (Boolean)


44448
44449
44450
# File 'lib/ovirtsdk4/types.rb', line 44448

def on_boot
  @on_boot
end

#on_boot=(value) ⇒ Object

Sets the value of the on_boot attribute.

Parameters:

  • value (Boolean)


44457
44458
44459
# File 'lib/ovirtsdk4/types.rb', line 44457

def on_boot=(value)
  @on_boot = value
end

#pluggedBoolean

Returns the value of the plugged attribute.

Returns:

  • (Boolean)


44466
44467
44468
# File 'lib/ovirtsdk4/types.rb', line 44466

def plugged
  @plugged
end

#plugged=(value) ⇒ Object

Sets the value of the plugged attribute.

Parameters:

  • value (Boolean)


44475
44476
44477
# File 'lib/ovirtsdk4/types.rb', line 44475

def plugged=(value)
  @plugged = value
end

#reported_devicesArray<ReportedDevice>

Returns the value of the reported_devices attribute.

Returns:



44484
44485
44486
# File 'lib/ovirtsdk4/types.rb', line 44484

def reported_devices
  @reported_devices
end

#reported_devices=(list) ⇒ Object

Sets the value of the reported_devices attribute.

Parameters:



44493
44494
44495
44496
44497
44498
44499
44500
44501
44502
44503
# File 'lib/ovirtsdk4/types.rb', line 44493

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

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



44510
44511
44512
# File 'lib/ovirtsdk4/types.rb', line 44510

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



44519
44520
44521
44522
44523
44524
44525
44526
44527
44528
44529
# File 'lib/ovirtsdk4/types.rb', line 44519

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

#templateTemplate

Returns the value of the template attribute.

Returns:



44536
44537
44538
# File 'lib/ovirtsdk4/types.rb', line 44536

def template
  @template
end

#template=(value) ⇒ Object

Sets the value of the template attribute.

The value parameter can be an instance of Template 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:



44549
44550
44551
44552
44553
44554
# File 'lib/ovirtsdk4/types.rb', line 44549

def template=(value)
  if value.is_a?(Hash)
    value = Template.new(value)
  end
  @template = value
end

#virtual_function_allowed_labelsArray<NetworkLabel>

Returns the value of the virtual_function_allowed_labels attribute.

Returns:



44561
44562
44563
# File 'lib/ovirtsdk4/types.rb', line 44561

def virtual_function_allowed_labels
  @virtual_function_allowed_labels
end

#virtual_function_allowed_labels=(list) ⇒ Object

Sets the value of the virtual_function_allowed_labels attribute.

Parameters:



44570
44571
44572
44573
44574
44575
44576
44577
44578
44579
44580
# File 'lib/ovirtsdk4/types.rb', line 44570

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

#virtual_function_allowed_networksArray<Network>

Returns the value of the virtual_function_allowed_networks attribute.

Returns:



44587
44588
44589
# File 'lib/ovirtsdk4/types.rb', line 44587

def virtual_function_allowed_networks
  @virtual_function_allowed_networks
end

#virtual_function_allowed_networks=(list) ⇒ Object

Sets the value of the virtual_function_allowed_networks attribute.

Parameters:



44596
44597
44598
44599
44600
44601
44602
44603
44604
44605
44606
# File 'lib/ovirtsdk4/types.rb', line 44596

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

#vmVm

Returns the value of the vm attribute.

Returns:



44613
44614
44615
# File 'lib/ovirtsdk4/types.rb', line 44613

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)


44626
44627
44628
44629
44630
44631
# File 'lib/ovirtsdk4/types.rb', line 44626

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

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


44638
44639
44640
# File 'lib/ovirtsdk4/types.rb', line 44638

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


44647
44648
44649
44650
44651
44652
44653
44654
44655
44656
44657
# File 'lib/ovirtsdk4/types.rb', line 44647

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

#vnic_profileVnicProfile

Returns the value of the vnic_profile attribute.

Returns:



44664
44665
44666
# File 'lib/ovirtsdk4/types.rb', line 44664

def vnic_profile
  @vnic_profile
end

#vnic_profile=(value) ⇒ Object

Sets the value of the vnic_profile attribute.

The value parameter can be an instance of VnicProfile 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:



44677
44678
44679
44680
44681
44682
# File 'lib/ovirtsdk4/types.rb', line 44677

def vnic_profile=(value)
  if value.is_a?(Hash)
    value = VnicProfile.new(value)
  end
  @vnic_profile = value
end