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.



12313
12314
12315
12316
12317
12318
12319
12320
12321
# File 'lib/ovirtsdk4/types.rb', line 12313

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.



12326
12327
12328
12329
12330
12331
12332
12333
12334
# File 'lib/ovirtsdk4/types.rb', line 12326

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)


12088
12089
12090
# File 'lib/ovirtsdk4/types.rb', line 12088

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


12097
12098
12099
# File 'lib/ovirtsdk4/types.rb', line 12097

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.

Returns:



12106
12107
12108
# File 'lib/ovirtsdk4/types.rb', line 12106

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)


12119
12120
12121
12122
12123
12124
# File 'lib/ovirtsdk4/types.rb', line 12119

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)


12131
12132
12133
# File 'lib/ovirtsdk4/types.rb', line 12131

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


12140
12141
12142
# File 'lib/ovirtsdk4/types.rb', line 12140

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



12339
12340
12341
12342
12343
12344
12345
12346
12347
# File 'lib/ovirtsdk4/types.rb', line 12339

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:



12149
12150
12151
# File 'lib/ovirtsdk4/types.rb', line 12149

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)


12162
12163
12164
12165
12166
12167
# File 'lib/ovirtsdk4/types.rb', line 12162

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)


12174
12175
12176
# File 'lib/ovirtsdk4/types.rb', line 12174

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


12183
12184
12185
# File 'lib/ovirtsdk4/types.rb', line 12183

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)


12192
12193
12194
# File 'lib/ovirtsdk4/types.rb', line 12192

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)


12201
12202
12203
# File 'lib/ovirtsdk4/types.rb', line 12201

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.

Returns:

  • (Integer)


12210
12211
12212
# File 'lib/ovirtsdk4/types.rb', line 12210

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.

Parameters:

  • value (Integer)


12219
12220
12221
# File 'lib/ovirtsdk4/types.rb', line 12219

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


12228
12229
12230
# File 'lib/ovirtsdk4/types.rb', line 12228

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


12237
12238
12239
# File 'lib/ovirtsdk4/types.rb', line 12237

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.

Returns:

  • (String)


12246
12247
12248
# File 'lib/ovirtsdk4/types.rb', line 12246

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.

Parameters:

  • value (String)


12255
12256
12257
# File 'lib/ovirtsdk4/types.rb', line 12255

def node_distance=(value)
  @node_distance = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



12264
12265
12266
# File 'lib/ovirtsdk4/types.rb', line 12264

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
# File 'lib/ovirtsdk4/types.rb', line 12273

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