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.



45749
45750
45751
45752
45753
45754
45755
45756
45757
45758
45759
45760
45761
45762
45763
45764
45765
45766
# File 'lib/ovirtsdk4/types.rb', line 45749

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.



45771
45772
45773
45774
45775
45776
45777
45778
45779
45780
45781
45782
45783
45784
45785
45786
45787
45788
# File 'lib/ovirtsdk4/types.rb', line 45771

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:



45180
45181
45182
# File 'lib/ovirtsdk4/types.rb', line 45180

def boot_protocol
  @boot_protocol
end

#boot_protocol=(value) ⇒ Object

Sets the value of the boot_protocol attribute.

Parameters:



45189
45190
45191
# File 'lib/ovirtsdk4/types.rb', line 45189

def boot_protocol=(value)
  @boot_protocol = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


45198
45199
45200
# File 'lib/ovirtsdk4/types.rb', line 45198

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


45207
45208
45209
# File 'lib/ovirtsdk4/types.rb', line 45207

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


45216
45217
45218
# File 'lib/ovirtsdk4/types.rb', line 45216

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


45225
45226
45227
# File 'lib/ovirtsdk4/types.rb', line 45225

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



45793
45794
45795
45796
45797
45798
45799
45800
45801
45802
45803
45804
45805
45806
45807
45808
45809
45810
# File 'lib/ovirtsdk4/types.rb', line 45793

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)


45234
45235
45236
# File 'lib/ovirtsdk4/types.rb', line 45234

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


45243
45244
45245
# File 'lib/ovirtsdk4/types.rb', line 45243

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:



45252
45253
45254
# File 'lib/ovirtsdk4/types.rb', line 45252

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:



45265
45266
45267
45268
45269
45270
# File 'lib/ovirtsdk4/types.rb', line 45265

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:



45277
45278
45279
# File 'lib/ovirtsdk4/types.rb', line 45277

def interface
  @interface
end

#interface=(value) ⇒ Object

Sets the value of the interface attribute.

Parameters:



45286
45287
45288
# File 'lib/ovirtsdk4/types.rb', line 45286

def interface=(value)
  @interface = value
end

#linkedBoolean

Returns the value of the linked attribute.

Returns:

  • (Boolean)


45295
45296
45297
# File 'lib/ovirtsdk4/types.rb', line 45295

def linked
  @linked
end

#linked=(value) ⇒ Object

Sets the value of the linked attribute.

Parameters:

  • value (Boolean)


45304
45305
45306
# File 'lib/ovirtsdk4/types.rb', line 45304

def linked=(value)
  @linked = value
end

#macMac

Returns the value of the mac attribute.

Returns:



45313
45314
45315
# File 'lib/ovirtsdk4/types.rb', line 45313

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)


45326
45327
45328
45329
45330
45331
# File 'lib/ovirtsdk4/types.rb', line 45326

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)


45338
45339
45340
# File 'lib/ovirtsdk4/types.rb', line 45338

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


45347
45348
45349
# File 'lib/ovirtsdk4/types.rb', line 45347

def name=(value)
  @name = value
end

#networkNetwork

Returns the value of the network attribute.

Returns:



45356
45357
45358
# File 'lib/ovirtsdk4/types.rb', line 45356

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:



45369
45370
45371
45372
45373
45374
# File 'lib/ovirtsdk4/types.rb', line 45369

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:



45381
45382
45383
# File 'lib/ovirtsdk4/types.rb', line 45381

def network_attachments
  @network_attachments
end

#network_attachments=(list) ⇒ Object

Sets the value of the network_attachments attribute.

Parameters:



45390
45391
45392
45393
45394
45395
45396
45397
45398
45399
45400
# File 'lib/ovirtsdk4/types.rb', line 45390

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:



45407
45408
45409
# File 'lib/ovirtsdk4/types.rb', line 45407

def network_filter_parameters
  @network_filter_parameters
end

#network_filter_parameters=(list) ⇒ Object

Sets the value of the network_filter_parameters attribute.

Parameters:



45416
45417
45418
45419
45420
45421
45422
45423
45424
45425
45426
# File 'lib/ovirtsdk4/types.rb', line 45416

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:



45433
45434
45435
# File 'lib/ovirtsdk4/types.rb', line 45433

def network_labels
  @network_labels
end

#network_labels=(list) ⇒ Object

Sets the value of the network_labels attribute.

Parameters:



45442
45443
45444
45445
45446
45447
45448
45449
45450
45451
45452
# File 'lib/ovirtsdk4/types.rb', line 45442

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)


45459
45460
45461
# File 'lib/ovirtsdk4/types.rb', line 45459

def on_boot
  @on_boot
end

#on_boot=(value) ⇒ Object

Sets the value of the on_boot attribute.

Parameters:

  • value (Boolean)


45468
45469
45470
# File 'lib/ovirtsdk4/types.rb', line 45468

def on_boot=(value)
  @on_boot = value
end

#pluggedBoolean

Returns the value of the plugged attribute.

Returns:

  • (Boolean)


45477
45478
45479
# File 'lib/ovirtsdk4/types.rb', line 45477

def plugged
  @plugged
end

#plugged=(value) ⇒ Object

Sets the value of the plugged attribute.

Parameters:

  • value (Boolean)


45486
45487
45488
# File 'lib/ovirtsdk4/types.rb', line 45486

def plugged=(value)
  @plugged = value
end

#reported_devicesArray<ReportedDevice>

Returns the value of the reported_devices attribute.

Returns:



45495
45496
45497
# File 'lib/ovirtsdk4/types.rb', line 45495

def reported_devices
  @reported_devices
end

#reported_devices=(list) ⇒ Object

Sets the value of the reported_devices attribute.

Parameters:



45504
45505
45506
45507
45508
45509
45510
45511
45512
45513
45514
# File 'lib/ovirtsdk4/types.rb', line 45504

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:



45521
45522
45523
# File 'lib/ovirtsdk4/types.rb', line 45521

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



45530
45531
45532
45533
45534
45535
45536
45537
45538
45539
45540
# File 'lib/ovirtsdk4/types.rb', line 45530

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:



45547
45548
45549
# File 'lib/ovirtsdk4/types.rb', line 45547

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:



45560
45561
45562
45563
45564
45565
# File 'lib/ovirtsdk4/types.rb', line 45560

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:



45572
45573
45574
# File 'lib/ovirtsdk4/types.rb', line 45572

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:



45581
45582
45583
45584
45585
45586
45587
45588
45589
45590
45591
# File 'lib/ovirtsdk4/types.rb', line 45581

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:



45598
45599
45600
# File 'lib/ovirtsdk4/types.rb', line 45598

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:



45607
45608
45609
45610
45611
45612
45613
45614
45615
45616
45617
# File 'lib/ovirtsdk4/types.rb', line 45607

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:



45624
45625
45626
# File 'lib/ovirtsdk4/types.rb', line 45624

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)


45637
45638
45639
45640
45641
45642
# File 'lib/ovirtsdk4/types.rb', line 45637

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


45649
45650
45651
# File 'lib/ovirtsdk4/types.rb', line 45649

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


45658
45659
45660
45661
45662
45663
45664
45665
45666
45667
45668
# File 'lib/ovirtsdk4/types.rb', line 45658

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:



45675
45676
45677
# File 'lib/ovirtsdk4/types.rb', line 45675

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:



45688
45689
45690
45691
45692
45693
# File 'lib/ovirtsdk4/types.rb', line 45688

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