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.



11501
11502
11503
11504
11505
11506
11507
11508
11509
# File 'lib/ovirtsdk4/types.rb', line 11501

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.



11514
11515
11516
11517
11518
11519
11520
11521
11522
# File 'lib/ovirtsdk4/types.rb', line 11514

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)


11276
11277
11278
# File 'lib/ovirtsdk4/types.rb', line 11276

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


11285
11286
11287
# File 'lib/ovirtsdk4/types.rb', line 11285

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.

Returns:



11294
11295
11296
# File 'lib/ovirtsdk4/types.rb', line 11294

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)


11307
11308
11309
11310
11311
11312
# File 'lib/ovirtsdk4/types.rb', line 11307

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)


11319
11320
11321
# File 'lib/ovirtsdk4/types.rb', line 11319

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


11328
11329
11330
# File 'lib/ovirtsdk4/types.rb', line 11328

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



11527
11528
11529
11530
11531
11532
11533
11534
11535
# File 'lib/ovirtsdk4/types.rb', line 11527

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:



11337
11338
11339
# File 'lib/ovirtsdk4/types.rb', line 11337

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)


11350
11351
11352
11353
11354
11355
# File 'lib/ovirtsdk4/types.rb', line 11350

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)


11362
11363
11364
# File 'lib/ovirtsdk4/types.rb', line 11362

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


11371
11372
11373
# File 'lib/ovirtsdk4/types.rb', line 11371

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)


11380
11381
11382
# File 'lib/ovirtsdk4/types.rb', line 11380

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)


11389
11390
11391
# File 'lib/ovirtsdk4/types.rb', line 11389

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.

Returns:

  • (Integer)


11398
11399
11400
# File 'lib/ovirtsdk4/types.rb', line 11398

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.

Parameters:

  • value (Integer)


11407
11408
11409
# File 'lib/ovirtsdk4/types.rb', line 11407

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


11416
11417
11418
# File 'lib/ovirtsdk4/types.rb', line 11416

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


11425
11426
11427
# File 'lib/ovirtsdk4/types.rb', line 11425

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.

Returns:

  • (String)


11434
11435
11436
# File 'lib/ovirtsdk4/types.rb', line 11434

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.

Parameters:

  • value (String)


11443
11444
11445
# File 'lib/ovirtsdk4/types.rb', line 11443

def node_distance=(value)
  @node_distance = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



11452
11453
11454
# File 'lib/ovirtsdk4/types.rb', line 11452

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
# File 'lib/ovirtsdk4/types.rb', line 11461

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