Class: OvirtSDK4::NumaNode

Inherits:
Identified show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Direct Known Subclasses

VirtualNumaNode

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ NumaNode

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

  • :cpu (Cpu, Hash)

    The value of attribute cpu.

  • :description (String)

    The value of attribute description.

  • :host (Host, Hash)

    The value of attribute host.

  • :id (String)

    The value of attribute id.

  • :index (Integer)

    The value of attribute index.

  • :memory (Integer)

    The value of attribute memory.

  • :name (String)

    The value of attribute name.

  • :node_distance (String)

    The value of attribute node_distance.

  • :statistics (Array<Statistic>, Array<Hash>)

    The values of attribute statistics.



11863
11864
11865
11866
11867
11868
11869
11870
11871
# File 'lib/ovirtsdk4/types.rb', line 11863

def initialize(opts = {})
  super(opts)
  self.cpu = opts[:cpu]
  self.host = opts[:host]
  self.index = opts[:index]
  self.memory = opts[:memory]
  self.node_distance = opts[:node_distance]
  self.statistics = opts[:statistics]
end

Instance Method Details

#==(other) ⇒ Object

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



11876
11877
11878
11879
11880
11881
11882
11883
11884
# File 'lib/ovirtsdk4/types.rb', line 11876

def ==(other)
  super &&
  @cpu == other.cpu &&
  @host == other.host &&
  @index == other.index &&
  @memory == other.memory &&
  @node_distance == other.node_distance &&
  @statistics == other.statistics
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


11638
11639
11640
# File 'lib/ovirtsdk4/types.rb', line 11638

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


11647
11648
11649
# File 'lib/ovirtsdk4/types.rb', line 11647

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.

Returns:



11656
11657
11658
# File 'lib/ovirtsdk4/types.rb', line 11656

def cpu
  @cpu
end

#cpu=(value) ⇒ Object

Sets the value of the cpu attribute.

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


11669
11670
11671
11672
11673
11674
# File 'lib/ovirtsdk4/types.rb', line 11669

def cpu=(value)
  if value.is_a?(Hash)
    value = Cpu.new(value)
  end
  @cpu = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


11681
11682
11683
# File 'lib/ovirtsdk4/types.rb', line 11681

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


11690
11691
11692
# File 'lib/ovirtsdk4/types.rb', line 11690

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



11889
11890
11891
11892
11893
11894
11895
11896
11897
# File 'lib/ovirtsdk4/types.rb', line 11889

def hash
  super +
  @cpu.hash +
  @host.hash +
  @index.hash +
  @memory.hash +
  @node_distance.hash +
  @statistics.hash
end

#hostHost

Returns the value of the host attribute.

Returns:



11699
11700
11701
# File 'lib/ovirtsdk4/types.rb', line 11699

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)


11712
11713
11714
11715
11716
11717
# File 'lib/ovirtsdk4/types.rb', line 11712

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


11724
11725
11726
# File 'lib/ovirtsdk4/types.rb', line 11724

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


11733
11734
11735
# File 'lib/ovirtsdk4/types.rb', line 11733

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)


11742
11743
11744
# File 'lib/ovirtsdk4/types.rb', line 11742

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)


11751
11752
11753
# File 'lib/ovirtsdk4/types.rb', line 11751

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.

Returns:

  • (Integer)


11760
11761
11762
# File 'lib/ovirtsdk4/types.rb', line 11760

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.

Parameters:

  • value (Integer)


11769
11770
11771
# File 'lib/ovirtsdk4/types.rb', line 11769

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


11778
11779
11780
# File 'lib/ovirtsdk4/types.rb', line 11778

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


11787
11788
11789
# File 'lib/ovirtsdk4/types.rb', line 11787

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.

Returns:

  • (String)


11796
11797
11798
# File 'lib/ovirtsdk4/types.rb', line 11796

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.

Parameters:

  • value (String)


11805
11806
11807
# File 'lib/ovirtsdk4/types.rb', line 11805

def node_distance=(value)
  @node_distance = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



11814
11815
11816
# File 'lib/ovirtsdk4/types.rb', line 11814

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
# File 'lib/ovirtsdk4/types.rb', line 11823

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