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.

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.



12560
12561
12562
12563
12564
12565
12566
12567
12568
# File 'lib/ovirtsdk4/types.rb', line 12560

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.



12573
12574
12575
12576
12577
12578
12579
12580
12581
# File 'lib/ovirtsdk4/types.rb', line 12573

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.



12335
12336
12337
# File 'lib/ovirtsdk4/types.rb', line 12335

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



12344
12345
12346
# File 'lib/ovirtsdk4/types.rb', line 12344

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.



12353
12354
12355
# File 'lib/ovirtsdk4/types.rb', line 12353

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.



12366
12367
12368
12369
12370
12371
# File 'lib/ovirtsdk4/types.rb', line 12366

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

#descriptionString

Returns the value of the description attribute.



12378
12379
12380
# File 'lib/ovirtsdk4/types.rb', line 12378

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



12387
12388
12389
# File 'lib/ovirtsdk4/types.rb', line 12387

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



12586
12587
12588
12589
12590
12591
12592
12593
12594
# File 'lib/ovirtsdk4/types.rb', line 12586

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.



12396
12397
12398
# File 'lib/ovirtsdk4/types.rb', line 12396

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.



12409
12410
12411
12412
12413
12414
# File 'lib/ovirtsdk4/types.rb', line 12409

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

#idString

Returns the value of the id attribute.



12421
12422
12423
# File 'lib/ovirtsdk4/types.rb', line 12421

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



12430
12431
12432
# File 'lib/ovirtsdk4/types.rb', line 12430

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.



12439
12440
12441
# File 'lib/ovirtsdk4/types.rb', line 12439

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.



12448
12449
12450
# File 'lib/ovirtsdk4/types.rb', line 12448

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.



12457
12458
12459
# File 'lib/ovirtsdk4/types.rb', line 12457

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.



12466
12467
12468
# File 'lib/ovirtsdk4/types.rb', line 12466

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.



12475
12476
12477
# File 'lib/ovirtsdk4/types.rb', line 12475

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



12484
12485
12486
# File 'lib/ovirtsdk4/types.rb', line 12484

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.



12493
12494
12495
# File 'lib/ovirtsdk4/types.rb', line 12493

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.



12502
12503
12504
# File 'lib/ovirtsdk4/types.rb', line 12502

def node_distance=(value)
  @node_distance = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.



12511
12512
12513
# File 'lib/ovirtsdk4/types.rb', line 12511

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.



12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
# File 'lib/ovirtsdk4/types.rb', line 12520

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