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.


46493
46494
46495
46496
46497
46498
46499
46500
46501
46502
46503
46504
46505
46506
46507
46508
46509
46510
# File 'lib/ovirtsdk4/types.rb', line 46493

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.


46515
46516
46517
46518
46519
46520
46521
46522
46523
46524
46525
46526
46527
46528
46529
46530
46531
46532
# File 'lib/ovirtsdk4/types.rb', line 46515

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:


45924
45925
45926
# File 'lib/ovirtsdk4/types.rb', line 45924

def boot_protocol
  @boot_protocol
end

#boot_protocol=(value) ⇒ Object

Sets the value of the boot_protocol attribute.

Parameters:


45933
45934
45935
# File 'lib/ovirtsdk4/types.rb', line 45933

def boot_protocol=(value)
  @boot_protocol = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

45942
45943
45944
# File 'lib/ovirtsdk4/types.rb', line 45942

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

45951
45952
45953
# File 'lib/ovirtsdk4/types.rb', line 45951

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

45960
45961
45962
# File 'lib/ovirtsdk4/types.rb', line 45960

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

45969
45970
45971
# File 'lib/ovirtsdk4/types.rb', line 45969

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


46537
46538
46539
46540
46541
46542
46543
46544
46545
46546
46547
46548
46549
46550
46551
46552
46553
46554
# File 'lib/ovirtsdk4/types.rb', line 46537

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)

45978
45979
45980
# File 'lib/ovirtsdk4/types.rb', line 45978

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

45987
45988
45989
# File 'lib/ovirtsdk4/types.rb', line 45987

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:


45996
45997
45998
# File 'lib/ovirtsdk4/types.rb', line 45996

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:


46009
46010
46011
46012
46013
46014
# File 'lib/ovirtsdk4/types.rb', line 46009

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:


46021
46022
46023
# File 'lib/ovirtsdk4/types.rb', line 46021

def interface
  @interface
end

#interface=(value) ⇒ Object

Sets the value of the interface attribute.

Parameters:


46030
46031
46032
# File 'lib/ovirtsdk4/types.rb', line 46030

def interface=(value)
  @interface = value
end

#linkedBoolean

Returns the value of the linked attribute.

Returns:

  • (Boolean)

46039
46040
46041
# File 'lib/ovirtsdk4/types.rb', line 46039

def linked
  @linked
end

#linked=(value) ⇒ Object

Sets the value of the linked attribute.

Parameters:

  • value (Boolean)

46048
46049
46050
# File 'lib/ovirtsdk4/types.rb', line 46048

def linked=(value)
  @linked = value
end

#macMac

Returns the value of the mac attribute.

Returns:


46057
46058
46059
# File 'lib/ovirtsdk4/types.rb', line 46057

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)

46070
46071
46072
46073
46074
46075
# File 'lib/ovirtsdk4/types.rb', line 46070

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)

46082
46083
46084
# File 'lib/ovirtsdk4/types.rb', line 46082

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

46091
46092
46093
# File 'lib/ovirtsdk4/types.rb', line 46091

def name=(value)
  @name = value
end

#networkNetwork

Returns the value of the network attribute.

Returns:


46100
46101
46102
# File 'lib/ovirtsdk4/types.rb', line 46100

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:


46113
46114
46115
46116
46117
46118
# File 'lib/ovirtsdk4/types.rb', line 46113

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:


46125
46126
46127
# File 'lib/ovirtsdk4/types.rb', line 46125

def network_attachments
  @network_attachments
end

#network_attachments=(list) ⇒ Object

Sets the value of the network_attachments attribute.

Parameters:


46134
46135
46136
46137
46138
46139
46140
46141
46142
46143
46144
# File 'lib/ovirtsdk4/types.rb', line 46134

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:


46151
46152
46153
# File 'lib/ovirtsdk4/types.rb', line 46151

def network_filter_parameters
  @network_filter_parameters
end

#network_filter_parameters=(list) ⇒ Object

Sets the value of the network_filter_parameters attribute.

Parameters:


46160
46161
46162
46163
46164
46165
46166
46167
46168
46169
46170
# File 'lib/ovirtsdk4/types.rb', line 46160

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:


46177
46178
46179
# File 'lib/ovirtsdk4/types.rb', line 46177

def network_labels
  @network_labels
end

#network_labels=(list) ⇒ Object

Sets the value of the network_labels attribute.

Parameters:


46186
46187
46188
46189
46190
46191
46192
46193
46194
46195
46196
# File 'lib/ovirtsdk4/types.rb', line 46186

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)

46203
46204
46205
# File 'lib/ovirtsdk4/types.rb', line 46203

def on_boot
  @on_boot
end

#on_boot=(value) ⇒ Object

Sets the value of the on_boot attribute.

Parameters:

  • value (Boolean)

46212
46213
46214
# File 'lib/ovirtsdk4/types.rb', line 46212

def on_boot=(value)
  @on_boot = value
end

#pluggedBoolean

Returns the value of the plugged attribute.

Returns:

  • (Boolean)

46221
46222
46223
# File 'lib/ovirtsdk4/types.rb', line 46221

def plugged
  @plugged
end

#plugged=(value) ⇒ Object

Sets the value of the plugged attribute.

Parameters:

  • value (Boolean)

46230
46231
46232
# File 'lib/ovirtsdk4/types.rb', line 46230

def plugged=(value)
  @plugged = value
end

#reported_devicesArray<ReportedDevice>

Returns the value of the reported_devices attribute.

Returns:


46239
46240
46241
# File 'lib/ovirtsdk4/types.rb', line 46239

def reported_devices
  @reported_devices
end

#reported_devices=(list) ⇒ Object

Sets the value of the reported_devices attribute.

Parameters:


46248
46249
46250
46251
46252
46253
46254
46255
46256
46257
46258
# File 'lib/ovirtsdk4/types.rb', line 46248

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:


46265
46266
46267
# File 'lib/ovirtsdk4/types.rb', line 46265

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:


46274
46275
46276
46277
46278
46279
46280
46281
46282
46283
46284
# File 'lib/ovirtsdk4/types.rb', line 46274

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:


46291
46292
46293
# File 'lib/ovirtsdk4/types.rb', line 46291

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:


46304
46305
46306
46307
46308
46309
# File 'lib/ovirtsdk4/types.rb', line 46304

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:


46316
46317
46318
# File 'lib/ovirtsdk4/types.rb', line 46316

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:


46325
46326
46327
46328
46329
46330
46331
46332
46333
46334
46335
# File 'lib/ovirtsdk4/types.rb', line 46325

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:


46342
46343
46344
# File 'lib/ovirtsdk4/types.rb', line 46342

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:


46351
46352
46353
46354
46355
46356
46357
46358
46359
46360
46361
# File 'lib/ovirtsdk4/types.rb', line 46351

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:


46368
46369
46370
# File 'lib/ovirtsdk4/types.rb', line 46368

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)

46381
46382
46383
46384
46385
46386
# File 'lib/ovirtsdk4/types.rb', line 46381

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

46393
46394
46395
# File 'lib/ovirtsdk4/types.rb', line 46393

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)

46402
46403
46404
46405
46406
46407
46408
46409
46410
46411
46412
# File 'lib/ovirtsdk4/types.rb', line 46402

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:


46419
46420
46421
# File 'lib/ovirtsdk4/types.rb', line 46419

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:


46432
46433
46434
46435
46436
46437
# File 'lib/ovirtsdk4/types.rb', line 46432

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