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.

  • :numa_tune_mode (NumaTuneMode)

    The value of attribute numa_tune_mode.

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

    The values of attribute statistics.

  • :vm (Vm, Hash)

    The value of attribute vm.



25723
25724
25725
25726
25727
25728
# File 'lib/ovirtsdk4/types.rb', line 25723

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

Instance Method Details

#==(other) ⇒ Object

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



25733
25734
25735
25736
25737
25738
# File 'lib/ovirtsdk4/types.rb', line 25733

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


25423
25424
25425
# File 'lib/ovirtsdk4/types.rb', line 25423

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


25432
25433
25434
# File 'lib/ovirtsdk4/types.rb', line 25432

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.

Returns:



25441
25442
25443
# File 'lib/ovirtsdk4/types.rb', line 25441

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)


25454
25455
25456
25457
25458
25459
# File 'lib/ovirtsdk4/types.rb', line 25454

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)


25466
25467
25468
# File 'lib/ovirtsdk4/types.rb', line 25466

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


25475
25476
25477
# File 'lib/ovirtsdk4/types.rb', line 25475

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



25743
25744
25745
25746
25747
25748
# File 'lib/ovirtsdk4/types.rb', line 25743

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

#hostHost

Returns the value of the host attribute.

Returns:



25484
25485
25486
# File 'lib/ovirtsdk4/types.rb', line 25484

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)


25497
25498
25499
25500
25501
25502
# File 'lib/ovirtsdk4/types.rb', line 25497

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)


25509
25510
25511
# File 'lib/ovirtsdk4/types.rb', line 25509

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


25518
25519
25520
# File 'lib/ovirtsdk4/types.rb', line 25518

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)


25527
25528
25529
# File 'lib/ovirtsdk4/types.rb', line 25527

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)


25536
25537
25538
# File 'lib/ovirtsdk4/types.rb', line 25536

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.

Returns:

  • (Integer)


25545
25546
25547
# File 'lib/ovirtsdk4/types.rb', line 25545

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.

Parameters:

  • value (Integer)


25554
25555
25556
# File 'lib/ovirtsdk4/types.rb', line 25554

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


25563
25564
25565
# File 'lib/ovirtsdk4/types.rb', line 25563

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


25572
25573
25574
# File 'lib/ovirtsdk4/types.rb', line 25572

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.

Returns:

  • (String)


25581
25582
25583
# File 'lib/ovirtsdk4/types.rb', line 25581

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.

Parameters:

  • value (String)


25590
25591
25592
# File 'lib/ovirtsdk4/types.rb', line 25590

def node_distance=(value)
  @node_distance = value
end

#numa_node_pinsArray<NumaNodePin>

Returns the value of the numa_node_pins attribute.

Returns:



25599
25600
25601
# File 'lib/ovirtsdk4/types.rb', line 25599

def numa_node_pins
  @numa_node_pins
end

#numa_node_pins=(list) ⇒ Object

Sets the value of the numa_node_pins attribute.

Parameters:



25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
# File 'lib/ovirtsdk4/types.rb', line 25608

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

#numa_tune_modeNumaTuneMode

Returns the value of the numa_tune_mode attribute.

Returns:



25625
25626
25627
# File 'lib/ovirtsdk4/types.rb', line 25625

def numa_tune_mode
  @numa_tune_mode
end

#numa_tune_mode=(value) ⇒ Object

Sets the value of the numa_tune_mode attribute.

Parameters:



25634
25635
25636
# File 'lib/ovirtsdk4/types.rb', line 25634

def numa_tune_mode=(value)
  @numa_tune_mode = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



25643
25644
25645
# File 'lib/ovirtsdk4/types.rb', line 25643

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
# File 'lib/ovirtsdk4/types.rb', line 25652

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:



25669
25670
25671
# File 'lib/ovirtsdk4/types.rb', line 25669

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)


25682
25683
25684
25685
25686
25687
# File 'lib/ovirtsdk4/types.rb', line 25682

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