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.


11780
11781
11782
11783
11784
11785
11786
11787
11788
# File 'lib/ovirtsdk4/types.rb', line 11780

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.


11793
11794
11795
11796
11797
11798
11799
11800
11801
# File 'lib/ovirtsdk4/types.rb', line 11793

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)

11555
11556
11557
# File 'lib/ovirtsdk4/types.rb', line 11555

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

11564
11565
11566
# File 'lib/ovirtsdk4/types.rb', line 11564

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.

Returns:


11573
11574
11575
# File 'lib/ovirtsdk4/types.rb', line 11573

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)

11586
11587
11588
11589
11590
11591
# File 'lib/ovirtsdk4/types.rb', line 11586

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)

11598
11599
11600
# File 'lib/ovirtsdk4/types.rb', line 11598

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

11607
11608
11609
# File 'lib/ovirtsdk4/types.rb', line 11607

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


11806
11807
11808
11809
11810
11811
11812
11813
11814
# File 'lib/ovirtsdk4/types.rb', line 11806

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:


11616
11617
11618
# File 'lib/ovirtsdk4/types.rb', line 11616

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)

11629
11630
11631
11632
11633
11634
# File 'lib/ovirtsdk4/types.rb', line 11629

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)

11641
11642
11643
# File 'lib/ovirtsdk4/types.rb', line 11641

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

11650
11651
11652
# File 'lib/ovirtsdk4/types.rb', line 11650

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)

11659
11660
11661
# File 'lib/ovirtsdk4/types.rb', line 11659

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)

11668
11669
11670
# File 'lib/ovirtsdk4/types.rb', line 11668

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.

Returns:

  • (Integer)

11677
11678
11679
# File 'lib/ovirtsdk4/types.rb', line 11677

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.

Parameters:

  • value (Integer)

11686
11687
11688
# File 'lib/ovirtsdk4/types.rb', line 11686

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

11695
11696
11697
# File 'lib/ovirtsdk4/types.rb', line 11695

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

11704
11705
11706
# File 'lib/ovirtsdk4/types.rb', line 11704

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.

Returns:

  • (String)

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

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.

Parameters:

  • value (String)

11722
11723
11724
# File 'lib/ovirtsdk4/types.rb', line 11722

def node_distance=(value)
  @node_distance = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:


11731
11732
11733
# File 'lib/ovirtsdk4/types.rb', line 11731

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:


11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
# File 'lib/ovirtsdk4/types.rb', line 11740

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