Class: OvirtSDK4::VirtualNumaNode

Inherits:
NumaNode 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 = {}) ⇒ VirtualNumaNode

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

  • :numa_node_pins (Array<NumaNodePin>, Array<Hash>)

    The values of attribute numa_node_pins.

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

    The values of attribute statistics.

  • :vm (Vm, Hash)

    The value of attribute vm.



24130
24131
24132
24133
24134
# File 'lib/ovirtsdk4/types.rb', line 24130

def initialize(opts = {})
  super(opts)
  self.numa_node_pins = opts[:numa_node_pins]
  self.vm = opts[:vm]
end

Instance Method Details

#==(other) ⇒ Object

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



24139
24140
24141
24142
24143
# File 'lib/ovirtsdk4/types.rb', line 24139

def ==(other)
  super &&
  @numa_node_pins == other.numa_node_pins &&
  @vm == other.vm
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


23850
23851
23852
# File 'lib/ovirtsdk4/types.rb', line 23850

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


23859
23860
23861
# File 'lib/ovirtsdk4/types.rb', line 23859

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.

Returns:



23868
23869
23870
# File 'lib/ovirtsdk4/types.rb', line 23868

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)


23881
23882
23883
23884
23885
23886
# File 'lib/ovirtsdk4/types.rb', line 23881

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)


23893
23894
23895
# File 'lib/ovirtsdk4/types.rb', line 23893

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


23902
23903
23904
# File 'lib/ovirtsdk4/types.rb', line 23902

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



24148
24149
24150
24151
24152
# File 'lib/ovirtsdk4/types.rb', line 24148

def hash
  super +
  @numa_node_pins.hash +
  @vm.hash
end

#hostHost

Returns the value of the host attribute.

Returns:



23911
23912
23913
# File 'lib/ovirtsdk4/types.rb', line 23911

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)


23924
23925
23926
23927
23928
23929
# File 'lib/ovirtsdk4/types.rb', line 23924

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)


23936
23937
23938
# File 'lib/ovirtsdk4/types.rb', line 23936

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


23945
23946
23947
# File 'lib/ovirtsdk4/types.rb', line 23945

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)


23954
23955
23956
# File 'lib/ovirtsdk4/types.rb', line 23954

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)


23963
23964
23965
# File 'lib/ovirtsdk4/types.rb', line 23963

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.

Returns:

  • (Integer)


23972
23973
23974
# File 'lib/ovirtsdk4/types.rb', line 23972

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.

Parameters:

  • value (Integer)


23981
23982
23983
# File 'lib/ovirtsdk4/types.rb', line 23981

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


23990
23991
23992
# File 'lib/ovirtsdk4/types.rb', line 23990

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


23999
24000
24001
# File 'lib/ovirtsdk4/types.rb', line 23999

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.

Returns:

  • (String)


24008
24009
24010
# File 'lib/ovirtsdk4/types.rb', line 24008

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.

Parameters:

  • value (String)


24017
24018
24019
# File 'lib/ovirtsdk4/types.rb', line 24017

def node_distance=(value)
  @node_distance = value
end

#numa_node_pinsArray<NumaNodePin>

Returns the value of the numa_node_pins attribute.

Returns:



24026
24027
24028
# File 'lib/ovirtsdk4/types.rb', line 24026

def numa_node_pins
  @numa_node_pins
end

#numa_node_pins=(list) ⇒ Object

Sets the value of the numa_node_pins attribute.

Parameters:



24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
# File 'lib/ovirtsdk4/types.rb', line 24035

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

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



24052
24053
24054
# File 'lib/ovirtsdk4/types.rb', line 24052

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
# File 'lib/ovirtsdk4/types.rb', line 24061

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

#vmVm

Returns the value of the vm attribute.

Returns:



24078
24079
24080
# File 'lib/ovirtsdk4/types.rb', line 24078

def vm
  @vm
end

#vm=(value) ⇒ Object

Sets the value of the vm attribute.

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


24091
24092
24093
24094
24095
24096
# File 'lib/ovirtsdk4/types.rb', line 24091

def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end