Class: OvirtSDK4::NetworkConfiguration

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary (collapse)

Methods included from Type

#href, #href=

Constructor Details

- (NetworkConfiguration) initialize(opts = {})

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

  • :dns (Dns, Hash)

    The value of attribute dns.

  • :nics (Array<Nic>, Array<Hash>)

    The values of attribute nics.



7663
7664
7665
7666
7667
# File 'lib/ovirtsdk4/types.rb', line 7663

def initialize(opts = {})
  super(opts)
  self.dns = opts[:dns]
  self.nics = opts[:nics]
end

Instance Method Details

- (Dns) dns

Returns the value of the dns attribute.

Returns:



7606
7607
7608
# File 'lib/ovirtsdk4/types.rb', line 7606

def dns
  return @dns
end

- (Object) dns=(value)

Sets the value of the dns attribute.

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


7619
7620
7621
7622
7623
7624
# File 'lib/ovirtsdk4/types.rb', line 7619

def dns=(value)
  if value.is_a?(Hash)
    value = Dns.new(value)
  end
  @dns = value
end

- (Array<Nic>) nics

Returns the value of the nics attribute.

Returns:



7631
7632
7633
# File 'lib/ovirtsdk4/types.rb', line 7631

def nics
  return @nics
end

- (Object) nics=(list)

Sets the value of the nics attribute.

Parameters:

  • list (Array<Nic>)


7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
# File 'lib/ovirtsdk4/types.rb', line 7639

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