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.

  • :synced (Boolean)

    The value of attribute synced.

  • :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.



48854
48855
48856
48857
48858
48859
48860
48861
48862
48863
48864
48865
48866
48867
48868
48869
48870
48871
48872
# File 'lib/ovirtsdk4/types.rb', line 48854

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.synced = opts[:synced]
  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.



48877
48878
48879
48880
48881
48882
48883
48884
48885
48886
48887
48888
48889
48890
48891
48892
48893
48894
48895
# File 'lib/ovirtsdk4/types.rb', line 48877

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 &&
  @synced == other.synced &&
  @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:



48265
48266
48267
# File 'lib/ovirtsdk4/types.rb', line 48265

def boot_protocol
  @boot_protocol
end

#boot_protocol=(value) ⇒ Object

Sets the value of the boot_protocol attribute.

Parameters:



48274
48275
48276
# File 'lib/ovirtsdk4/types.rb', line 48274

def boot_protocol=(value)
  @boot_protocol = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


48283
48284
48285
# File 'lib/ovirtsdk4/types.rb', line 48283

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


48292
48293
48294
# File 'lib/ovirtsdk4/types.rb', line 48292

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


48301
48302
48303
# File 'lib/ovirtsdk4/types.rb', line 48301

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


48310
48311
48312
# File 'lib/ovirtsdk4/types.rb', line 48310

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



48900
48901
48902
48903
48904
48905
48906
48907
48908
48909
48910
48911
48912
48913
48914
48915
48916
48917
48918
# File 'lib/ovirtsdk4/types.rb', line 48900

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 +
  @synced.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)


48319
48320
48321
# File 'lib/ovirtsdk4/types.rb', line 48319

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


48328
48329
48330
# File 'lib/ovirtsdk4/types.rb', line 48328

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:



48337
48338
48339
# File 'lib/ovirtsdk4/types.rb', line 48337

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:



48350
48351
48352
48353
48354
48355
# File 'lib/ovirtsdk4/types.rb', line 48350

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:



48362
48363
48364
# File 'lib/ovirtsdk4/types.rb', line 48362

def interface
  @interface
end

#interface=(value) ⇒ Object

Sets the value of the interface attribute.

Parameters:



48371
48372
48373
# File 'lib/ovirtsdk4/types.rb', line 48371

def interface=(value)
  @interface = value
end

#linkedBoolean

Returns the value of the linked attribute.

Returns:

  • (Boolean)


48380
48381
48382
# File 'lib/ovirtsdk4/types.rb', line 48380

def linked
  @linked
end

#linked=(value) ⇒ Object

Sets the value of the linked attribute.

Parameters:

  • value (Boolean)


48389
48390
48391
# File 'lib/ovirtsdk4/types.rb', line 48389

def linked=(value)
  @linked = value
end

#macMac

Returns the value of the mac attribute.

Returns:



48398
48399
48400
# File 'lib/ovirtsdk4/types.rb', line 48398

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)


48411
48412
48413
48414
48415
48416
# File 'lib/ovirtsdk4/types.rb', line 48411

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)


48423
48424
48425
# File 'lib/ovirtsdk4/types.rb', line 48423

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


48432
48433
48434
# File 'lib/ovirtsdk4/types.rb', line 48432

def name=(value)
  @name = value
end

#networkNetwork

Returns the value of the network attribute.

Returns:



48441
48442
48443
# File 'lib/ovirtsdk4/types.rb', line 48441

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:



48454
48455
48456
48457
48458
48459
# File 'lib/ovirtsdk4/types.rb', line 48454

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:



48466
48467
48468
# File 'lib/ovirtsdk4/types.rb', line 48466

def network_attachments
  @network_attachments
end

#network_attachments=(list) ⇒ Object

Sets the value of the network_attachments attribute.

Parameters:



48475
48476
48477
48478
48479
48480
48481
48482
48483
48484
48485
# File 'lib/ovirtsdk4/types.rb', line 48475

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:



48492
48493
48494
# File 'lib/ovirtsdk4/types.rb', line 48492

def network_filter_parameters
  @network_filter_parameters
end

#network_filter_parameters=(list) ⇒ Object

Sets the value of the network_filter_parameters attribute.

Parameters:



48501
48502
48503
48504
48505
48506
48507
48508
48509
48510
48511
# File 'lib/ovirtsdk4/types.rb', line 48501

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:



48518
48519
48520
# File 'lib/ovirtsdk4/types.rb', line 48518

def network_labels
  @network_labels
end

#network_labels=(list) ⇒ Object

Sets the value of the network_labels attribute.

Parameters:



48527
48528
48529
48530
48531
48532
48533
48534
48535
48536
48537
# File 'lib/ovirtsdk4/types.rb', line 48527

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)


48544
48545
48546
# File 'lib/ovirtsdk4/types.rb', line 48544

def on_boot
  @on_boot
end

#on_boot=(value) ⇒ Object

Sets the value of the on_boot attribute.

Parameters:

  • value (Boolean)


48553
48554
48555
# File 'lib/ovirtsdk4/types.rb', line 48553

def on_boot=(value)
  @on_boot = value
end

#pluggedBoolean

Returns the value of the plugged attribute.

Returns:

  • (Boolean)


48562
48563
48564
# File 'lib/ovirtsdk4/types.rb', line 48562

def plugged
  @plugged
end

#plugged=(value) ⇒ Object

Sets the value of the plugged attribute.

Parameters:

  • value (Boolean)


48571
48572
48573
# File 'lib/ovirtsdk4/types.rb', line 48571

def plugged=(value)
  @plugged = value
end

#reported_devicesArray<ReportedDevice>

Returns the value of the reported_devices attribute.

Returns:



48580
48581
48582
# File 'lib/ovirtsdk4/types.rb', line 48580

def reported_devices
  @reported_devices
end

#reported_devices=(list) ⇒ Object

Sets the value of the reported_devices attribute.

Parameters:



48589
48590
48591
48592
48593
48594
48595
48596
48597
48598
48599
# File 'lib/ovirtsdk4/types.rb', line 48589

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:



48606
48607
48608
# File 'lib/ovirtsdk4/types.rb', line 48606

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



48615
48616
48617
48618
48619
48620
48621
48622
48623
48624
48625
# File 'lib/ovirtsdk4/types.rb', line 48615

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

#syncedBoolean

Returns the value of the synced attribute.

Returns:

  • (Boolean)


48632
48633
48634
# File 'lib/ovirtsdk4/types.rb', line 48632

def synced
  @synced
end

#synced=(value) ⇒ Object

Sets the value of the synced attribute.

Parameters:

  • value (Boolean)


48641
48642
48643
# File 'lib/ovirtsdk4/types.rb', line 48641

def synced=(value)
  @synced = value
end

#templateTemplate

Returns the value of the template attribute.

Returns:



48650
48651
48652
# File 'lib/ovirtsdk4/types.rb', line 48650

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:



48663
48664
48665
48666
48667
48668
# File 'lib/ovirtsdk4/types.rb', line 48663

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:



48675
48676
48677
# File 'lib/ovirtsdk4/types.rb', line 48675

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:



48684
48685
48686
48687
48688
48689
48690
48691
48692
48693
48694
# File 'lib/ovirtsdk4/types.rb', line 48684

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:



48701
48702
48703
# File 'lib/ovirtsdk4/types.rb', line 48701

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:



48710
48711
48712
48713
48714
48715
48716
48717
48718
48719
48720
# File 'lib/ovirtsdk4/types.rb', line 48710

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:



48727
48728
48729
# File 'lib/ovirtsdk4/types.rb', line 48727

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)


48740
48741
48742
48743
48744
48745
# File 'lib/ovirtsdk4/types.rb', line 48740

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>)


48752
48753
48754
# File 'lib/ovirtsdk4/types.rb', line 48752

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


48761
48762
48763
48764
48765
48766
48767
48768
48769
48770
48771
# File 'lib/ovirtsdk4/types.rb', line 48761

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:



48778
48779
48780
# File 'lib/ovirtsdk4/types.rb', line 48778

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:



48791
48792
48793
48794
48795
48796
# File 'lib/ovirtsdk4/types.rb', line 48791

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