Class: OvirtSDK4::NetworkAttachment

Inherits:
Identified 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 = {}) ⇒ NetworkAttachment

Creates a new instance of the OvirtSDK4::NetworkAttachment 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):

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :dns_resolver_configuration (DnsResolverConfiguration, Hash)

    The value of attribute dns_resolver_configuration.

  • :host (Host, Hash)

    The value of attribute host.

  • :host_nic (HostNic, Hash)

    The value of attribute host_nic.

  • :id (String)

    The value of attribute id.

  • :in_sync (Boolean)

    The value of attribute in_sync.

  • :ip_address_assignments (Array<IpAddressAssignment>, Array<Hash>)

    The values of attribute ip_address_assignments.

  • :name (String)

    The value of attribute name.

  • :network (Network, Hash)

    The value of attribute network.

  • :properties (Array<Property>, Array<Hash>)

    The values of attribute properties.

  • :qos (Qos, Hash)

    The value of attribute qos.

  • :reported_configurations (Array<ReportedConfiguration>, Array<Hash>)

    The values of attribute reported_configurations.


10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
# File 'lib/ovirtsdk4/types.rb', line 10674

def initialize(opts = {})
  super(opts)
  self.dns_resolver_configuration = opts[:dns_resolver_configuration]
  self.host = opts[:host]
  self.host_nic = opts[:host_nic]
  self.in_sync = opts[:in_sync]
  self.ip_address_assignments = opts[:ip_address_assignments]
  self.network = opts[:network]
  self.properties = opts[:properties]
  self.qos = opts[:qos]
  self.reported_configurations = opts[:reported_configurations]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.


10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
# File 'lib/ovirtsdk4/types.rb', line 10690

def ==(other)
  super &&
  @dns_resolver_configuration == other.dns_resolver_configuration &&
  @host == other.host &&
  @host_nic == other.host_nic &&
  @in_sync == other.in_sync &&
  @ip_address_assignments == other.ip_address_assignments &&
  @network == other.network &&
  @properties == other.properties &&
  @qos == other.qos &&
  @reported_configurations == other.reported_configurations
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

10352
10353
10354
# File 'lib/ovirtsdk4/types.rb', line 10352

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

10361
10362
10363
# File 'lib/ovirtsdk4/types.rb', line 10361

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

10370
10371
10372
# File 'lib/ovirtsdk4/types.rb', line 10370

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

10379
10380
10381
# File 'lib/ovirtsdk4/types.rb', line 10379

def description=(value)
  @description = value
end

#dns_resolver_configurationDnsResolverConfiguration

Returns the value of the dns_resolver_configuration attribute.


10388
10389
10390
# File 'lib/ovirtsdk4/types.rb', line 10388

def dns_resolver_configuration
  @dns_resolver_configuration
end

#dns_resolver_configuration=(value) ⇒ Object

Sets the value of the dns_resolver_configuration attribute.

The value parameter can be an instance of DnsResolverConfiguration 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:


10401
10402
10403
10404
10405
10406
# File 'lib/ovirtsdk4/types.rb', line 10401

def dns_resolver_configuration=(value)
  if value.is_a?(Hash)
    value = DnsResolverConfiguration.new(value)
  end
  @dns_resolver_configuration = value
end

#hashObject

Generates a hash value for this object.


10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
# File 'lib/ovirtsdk4/types.rb', line 10706

def hash
  super +
  @dns_resolver_configuration.hash +
  @host.hash +
  @host_nic.hash +
  @in_sync.hash +
  @ip_address_assignments.hash +
  @network.hash +
  @properties.hash +
  @qos.hash +
  @reported_configurations.hash
end

#hostHost

Returns the value of the host attribute.

Returns:


10413
10414
10415
# File 'lib/ovirtsdk4/types.rb', line 10413

def host
  @host
end

#host=(value) ⇒ Object

Sets the value of the host attribute.

The value parameter can be an instance of Host 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 (Host, Hash)

10426
10427
10428
10429
10430
10431
# File 'lib/ovirtsdk4/types.rb', line 10426

def host=(value)
  if value.is_a?(Hash)
    value = Host.new(value)
  end
  @host = value
end

#host_nicHostNic

Returns the value of the host_nic attribute.

Returns:


10438
10439
10440
# File 'lib/ovirtsdk4/types.rb', line 10438

def host_nic
  @host_nic
end

#host_nic=(value) ⇒ Object

Sets the value of the host_nic attribute.

The value parameter can be an instance of HostNic 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:


10451
10452
10453
10454
10455
10456
# File 'lib/ovirtsdk4/types.rb', line 10451

def host_nic=(value)
  if value.is_a?(Hash)
    value = HostNic.new(value)
  end
  @host_nic = value
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

10463
10464
10465
# File 'lib/ovirtsdk4/types.rb', line 10463

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

10472
10473
10474
# File 'lib/ovirtsdk4/types.rb', line 10472

def id=(value)
  @id = value
end

#in_syncBoolean

Returns the value of the in_sync attribute.

Returns:

  • (Boolean)

10481
10482
10483
# File 'lib/ovirtsdk4/types.rb', line 10481

def in_sync
  @in_sync
end

#in_sync=(value) ⇒ Object

Sets the value of the in_sync attribute.

Parameters:

  • value (Boolean)

10490
10491
10492
# File 'lib/ovirtsdk4/types.rb', line 10490

def in_sync=(value)
  @in_sync = value
end

#ip_address_assignmentsArray<IpAddressAssignment>

Returns the value of the ip_address_assignments attribute.

Returns:


10499
10500
10501
# File 'lib/ovirtsdk4/types.rb', line 10499

def ip_address_assignments
  @ip_address_assignments
end

#ip_address_assignments=(list) ⇒ Object

Sets the value of the ip_address_assignments attribute.

Parameters:


10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
# File 'lib/ovirtsdk4/types.rb', line 10508

def ip_address_assignments=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = IpAddressAssignment.new(value)
      end
    end
  end
  @ip_address_assignments = list
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

10525
10526
10527
# File 'lib/ovirtsdk4/types.rb', line 10525

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

10534
10535
10536
# File 'lib/ovirtsdk4/types.rb', line 10534

def name=(value)
  @name = value
end

#networkNetwork

Returns the value of the network attribute.

Returns:


10543
10544
10545
# File 'lib/ovirtsdk4/types.rb', line 10543

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:


10556
10557
10558
10559
10560
10561
# File 'lib/ovirtsdk4/types.rb', line 10556

def network=(value)
  if value.is_a?(Hash)
    value = Network.new(value)
  end
  @network = value
end

#propertiesArray<Property>

Returns the value of the properties attribute.

Returns:


10568
10569
10570
# File 'lib/ovirtsdk4/types.rb', line 10568

def properties
  @properties
end

#properties=(list) ⇒ Object

Sets the value of the properties attribute.

Parameters:


10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
# File 'lib/ovirtsdk4/types.rb', line 10577

def properties=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Property.new(value)
      end
    end
  end
  @properties = list
end

#qosQos

Returns the value of the qos attribute.

Returns:


10594
10595
10596
# File 'lib/ovirtsdk4/types.rb', line 10594

def qos
  @qos
end

#qos=(value) ⇒ Object

Sets the value of the qos attribute.

The value parameter can be an instance of Qos 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 (Qos, Hash)

10607
10608
10609
10610
10611
10612
# File 'lib/ovirtsdk4/types.rb', line 10607

def qos=(value)
  if value.is_a?(Hash)
    value = Qos.new(value)
  end
  @qos = value
end

#reported_configurationsArray<ReportedConfiguration>

Returns the value of the reported_configurations attribute.

Returns:


10619
10620
10621
# File 'lib/ovirtsdk4/types.rb', line 10619

def reported_configurations
  @reported_configurations
end

#reported_configurations=(list) ⇒ Object

Sets the value of the reported_configurations attribute.

Parameters:


10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
# File 'lib/ovirtsdk4/types.rb', line 10628

def reported_configurations=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = ReportedConfiguration.new(value)
      end
    end
  end
  @reported_configurations = list
end