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.

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.



44996
44997
44998
44999
45000
45001
45002
45003
45004
45005
45006
45007
45008
45009
45010
45011
45012
45013
# File 'lib/ovirtsdk4/types.rb', line 44996

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.



45018
45019
45020
45021
45022
45023
45024
45025
45026
45027
45028
45029
45030
45031
45032
45033
45034
45035
# File 'lib/ovirtsdk4/types.rb', line 45018

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.



44427
44428
44429
# File 'lib/ovirtsdk4/types.rb', line 44427

def boot_protocol
  @boot_protocol
end

#boot_protocol=(value) ⇒ Object

Sets the value of the boot_protocol attribute.



44436
44437
44438
# File 'lib/ovirtsdk4/types.rb', line 44436

def boot_protocol=(value)
  @boot_protocol = value
end

#commentString

Returns the value of the comment attribute.



44445
44446
44447
# File 'lib/ovirtsdk4/types.rb', line 44445

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



44454
44455
44456
# File 'lib/ovirtsdk4/types.rb', line 44454

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



44463
44464
44465
# File 'lib/ovirtsdk4/types.rb', line 44463

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



44472
44473
44474
# File 'lib/ovirtsdk4/types.rb', line 44472

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



45040
45041
45042
45043
45044
45045
45046
45047
45048
45049
45050
45051
45052
45053
45054
45055
45056
45057
# File 'lib/ovirtsdk4/types.rb', line 45040

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.



44481
44482
44483
# File 'lib/ovirtsdk4/types.rb', line 44481

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



44490
44491
44492
# File 'lib/ovirtsdk4/types.rb', line 44490

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.



44499
44500
44501
# File 'lib/ovirtsdk4/types.rb', line 44499

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.



44512
44513
44514
44515
44516
44517
# File 'lib/ovirtsdk4/types.rb', line 44512

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.



44524
44525
44526
# File 'lib/ovirtsdk4/types.rb', line 44524

def interface
  @interface
end

#interface=(value) ⇒ Object

Sets the value of the interface attribute.



44533
44534
44535
# File 'lib/ovirtsdk4/types.rb', line 44533

def interface=(value)
  @interface = value
end

#linkedBoolean

Returns the value of the linked attribute.



44542
44543
44544
# File 'lib/ovirtsdk4/types.rb', line 44542

def linked
  @linked
end

#linked=(value) ⇒ Object

Sets the value of the linked attribute.



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

def linked=(value)
  @linked = value
end

#macMac

Returns the value of the mac attribute.



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

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.



44573
44574
44575
44576
44577
44578
# File 'lib/ovirtsdk4/types.rb', line 44573

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

#nameString

Returns the value of the name attribute.



44585
44586
44587
# File 'lib/ovirtsdk4/types.rb', line 44585

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



44594
44595
44596
# File 'lib/ovirtsdk4/types.rb', line 44594

def name=(value)
  @name = value
end

#networkNetwork

Returns the value of the network attribute.



44603
44604
44605
# File 'lib/ovirtsdk4/types.rb', line 44603

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.



44616
44617
44618
44619
44620
44621
# File 'lib/ovirtsdk4/types.rb', line 44616

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.



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

def network_attachments
  @network_attachments
end

#network_attachments=(list) ⇒ Object

Sets the value of the network_attachments attribute.



44637
44638
44639
44640
44641
44642
44643
44644
44645
44646
44647
# File 'lib/ovirtsdk4/types.rb', line 44637

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.



44654
44655
44656
# File 'lib/ovirtsdk4/types.rb', line 44654

def network_filter_parameters
  @network_filter_parameters
end

#network_filter_parameters=(list) ⇒ Object

Sets the value of the network_filter_parameters attribute.



44663
44664
44665
44666
44667
44668
44669
44670
44671
44672
44673
# File 'lib/ovirtsdk4/types.rb', line 44663

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.



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

def network_labels
  @network_labels
end

#network_labels=(list) ⇒ Object

Sets the value of the network_labels attribute.



44689
44690
44691
44692
44693
44694
44695
44696
44697
44698
44699
# File 'lib/ovirtsdk4/types.rb', line 44689

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.



44706
44707
44708
# File 'lib/ovirtsdk4/types.rb', line 44706

def on_boot
  @on_boot
end

#on_boot=(value) ⇒ Object

Sets the value of the on_boot attribute.



44715
44716
44717
# File 'lib/ovirtsdk4/types.rb', line 44715

def on_boot=(value)
  @on_boot = value
end

#pluggedBoolean

Returns the value of the plugged attribute.



44724
44725
44726
# File 'lib/ovirtsdk4/types.rb', line 44724

def plugged
  @plugged
end

#plugged=(value) ⇒ Object

Sets the value of the plugged attribute.



44733
44734
44735
# File 'lib/ovirtsdk4/types.rb', line 44733

def plugged=(value)
  @plugged = value
end

#reported_devicesArray<ReportedDevice>

Returns the value of the reported_devices attribute.



44742
44743
44744
# File 'lib/ovirtsdk4/types.rb', line 44742

def reported_devices
  @reported_devices
end

#reported_devices=(list) ⇒ Object

Sets the value of the reported_devices attribute.



44751
44752
44753
44754
44755
44756
44757
44758
44759
44760
44761
# File 'lib/ovirtsdk4/types.rb', line 44751

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.



44768
44769
44770
# File 'lib/ovirtsdk4/types.rb', line 44768

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.



44777
44778
44779
44780
44781
44782
44783
44784
44785
44786
44787
# File 'lib/ovirtsdk4/types.rb', line 44777

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.



44794
44795
44796
# File 'lib/ovirtsdk4/types.rb', line 44794

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.



44807
44808
44809
44810
44811
44812
# File 'lib/ovirtsdk4/types.rb', line 44807

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.



44819
44820
44821
# File 'lib/ovirtsdk4/types.rb', line 44819

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.



44828
44829
44830
44831
44832
44833
44834
44835
44836
44837
44838
# File 'lib/ovirtsdk4/types.rb', line 44828

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.



44845
44846
44847
# File 'lib/ovirtsdk4/types.rb', line 44845

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.



44854
44855
44856
44857
44858
44859
44860
44861
44862
44863
44864
# File 'lib/ovirtsdk4/types.rb', line 44854

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.



44871
44872
44873
# File 'lib/ovirtsdk4/types.rb', line 44871

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.



44884
44885
44886
44887
44888
44889
# File 'lib/ovirtsdk4/types.rb', line 44884

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.



44896
44897
44898
# File 'lib/ovirtsdk4/types.rb', line 44896

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.



44905
44906
44907
44908
44909
44910
44911
44912
44913
44914
44915
# File 'lib/ovirtsdk4/types.rb', line 44905

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.



44922
44923
44924
# File 'lib/ovirtsdk4/types.rb', line 44922

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.



44935
44936
44937
44938
44939
44940
# File 'lib/ovirtsdk4/types.rb', line 44935

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