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.



45065
45066
45067
45068
45069
45070
45071
45072
45073
45074
45075
45076
45077
45078
45079
45080
45081
45082
# File 'lib/ovirtsdk4/types.rb', line 45065

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.



45087
45088
45089
45090
45091
45092
45093
45094
45095
45096
45097
45098
45099
45100
45101
45102
45103
45104
# File 'lib/ovirtsdk4/types.rb', line 45087

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:



44496
44497
44498
# File 'lib/ovirtsdk4/types.rb', line 44496

def boot_protocol
  @boot_protocol
end

#boot_protocol=(value) ⇒ Object

Sets the value of the boot_protocol attribute.

Parameters:



44505
44506
44507
# File 'lib/ovirtsdk4/types.rb', line 44505

def boot_protocol=(value)
  @boot_protocol = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


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

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


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

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


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

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


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

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



45109
45110
45111
45112
45113
45114
45115
45116
45117
45118
45119
45120
45121
45122
45123
45124
45125
45126
# File 'lib/ovirtsdk4/types.rb', line 45109

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)


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

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


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

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:



44568
44569
44570
# File 'lib/ovirtsdk4/types.rb', line 44568

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:



44581
44582
44583
44584
44585
44586
# File 'lib/ovirtsdk4/types.rb', line 44581

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:



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

def interface
  @interface
end

#interface=(value) ⇒ Object

Sets the value of the interface attribute.

Parameters:



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

def interface=(value)
  @interface = value
end

#linkedBoolean

Returns the value of the linked attribute.

Returns:

  • (Boolean)


44611
44612
44613
# File 'lib/ovirtsdk4/types.rb', line 44611

def linked
  @linked
end

#linked=(value) ⇒ Object

Sets the value of the linked attribute.

Parameters:

  • value (Boolean)


44620
44621
44622
# File 'lib/ovirtsdk4/types.rb', line 44620

def linked=(value)
  @linked = value
end

#macMac

Returns the value of the mac attribute.

Returns:



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

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)


44642
44643
44644
44645
44646
44647
# File 'lib/ovirtsdk4/types.rb', line 44642

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)


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

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


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

def name=(value)
  @name = value
end

#networkNetwork

Returns the value of the network attribute.

Returns:



44672
44673
44674
# File 'lib/ovirtsdk4/types.rb', line 44672

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:



44685
44686
44687
44688
44689
44690
# File 'lib/ovirtsdk4/types.rb', line 44685

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:



44697
44698
44699
# File 'lib/ovirtsdk4/types.rb', line 44697

def network_attachments
  @network_attachments
end

#network_attachments=(list) ⇒ Object

Sets the value of the network_attachments attribute.

Parameters:



44706
44707
44708
44709
44710
44711
44712
44713
44714
44715
44716
# File 'lib/ovirtsdk4/types.rb', line 44706

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:



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

def network_filter_parameters
  @network_filter_parameters
end

#network_filter_parameters=(list) ⇒ Object

Sets the value of the network_filter_parameters attribute.

Parameters:



44732
44733
44734
44735
44736
44737
44738
44739
44740
44741
44742
# File 'lib/ovirtsdk4/types.rb', line 44732

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:



44749
44750
44751
# File 'lib/ovirtsdk4/types.rb', line 44749

def network_labels
  @network_labels
end

#network_labels=(list) ⇒ Object

Sets the value of the network_labels attribute.

Parameters:



44758
44759
44760
44761
44762
44763
44764
44765
44766
44767
44768
# File 'lib/ovirtsdk4/types.rb', line 44758

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)


44775
44776
44777
# File 'lib/ovirtsdk4/types.rb', line 44775

def on_boot
  @on_boot
end

#on_boot=(value) ⇒ Object

Sets the value of the on_boot attribute.

Parameters:

  • value (Boolean)


44784
44785
44786
# File 'lib/ovirtsdk4/types.rb', line 44784

def on_boot=(value)
  @on_boot = value
end

#pluggedBoolean

Returns the value of the plugged attribute.

Returns:

  • (Boolean)


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

def plugged
  @plugged
end

#plugged=(value) ⇒ Object

Sets the value of the plugged attribute.

Parameters:

  • value (Boolean)


44802
44803
44804
# File 'lib/ovirtsdk4/types.rb', line 44802

def plugged=(value)
  @plugged = value
end

#reported_devicesArray<ReportedDevice>

Returns the value of the reported_devices attribute.

Returns:



44811
44812
44813
# File 'lib/ovirtsdk4/types.rb', line 44811

def reported_devices
  @reported_devices
end

#reported_devices=(list) ⇒ Object

Sets the value of the reported_devices attribute.

Parameters:



44820
44821
44822
44823
44824
44825
44826
44827
44828
44829
44830
# File 'lib/ovirtsdk4/types.rb', line 44820

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:



44837
44838
44839
# File 'lib/ovirtsdk4/types.rb', line 44837

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



44846
44847
44848
44849
44850
44851
44852
44853
44854
44855
44856
# File 'lib/ovirtsdk4/types.rb', line 44846

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:



44863
44864
44865
# File 'lib/ovirtsdk4/types.rb', line 44863

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:



44876
44877
44878
44879
44880
44881
# File 'lib/ovirtsdk4/types.rb', line 44876

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:



44888
44889
44890
# File 'lib/ovirtsdk4/types.rb', line 44888

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:



44897
44898
44899
44900
44901
44902
44903
44904
44905
44906
44907
# File 'lib/ovirtsdk4/types.rb', line 44897

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:



44914
44915
44916
# File 'lib/ovirtsdk4/types.rb', line 44914

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:



44923
44924
44925
44926
44927
44928
44929
44930
44931
44932
44933
# File 'lib/ovirtsdk4/types.rb', line 44923

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:



44940
44941
44942
# File 'lib/ovirtsdk4/types.rb', line 44940

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)


44953
44954
44955
44956
44957
44958
# File 'lib/ovirtsdk4/types.rb', line 44953

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


44965
44966
44967
# File 'lib/ovirtsdk4/types.rb', line 44965

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


44974
44975
44976
44977
44978
44979
44980
44981
44982
44983
44984
# File 'lib/ovirtsdk4/types.rb', line 44974

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:



44991
44992
44993
# File 'lib/ovirtsdk4/types.rb', line 44991

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:



45004
45005
45006
45007
45008
45009
# File 'lib/ovirtsdk4/types.rb', line 45004

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