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.


24637
24638
24639
24640
24641
# File 'lib/ovirtsdk4/types.rb', line 24637

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.


24646
24647
24648
24649
24650
# File 'lib/ovirtsdk4/types.rb', line 24646

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

24357
24358
24359
# File 'lib/ovirtsdk4/types.rb', line 24357

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

24366
24367
24368
# File 'lib/ovirtsdk4/types.rb', line 24366

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.

Returns:


24375
24376
24377
# File 'lib/ovirtsdk4/types.rb', line 24375

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)

24388
24389
24390
24391
24392
24393
# File 'lib/ovirtsdk4/types.rb', line 24388

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)

24400
24401
24402
# File 'lib/ovirtsdk4/types.rb', line 24400

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

24409
24410
24411
# File 'lib/ovirtsdk4/types.rb', line 24409

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


24655
24656
24657
24658
24659
# File 'lib/ovirtsdk4/types.rb', line 24655

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

#hostHost

Returns the value of the host attribute.

Returns:


24418
24419
24420
# File 'lib/ovirtsdk4/types.rb', line 24418

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)

24431
24432
24433
24434
24435
24436
# File 'lib/ovirtsdk4/types.rb', line 24431

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)

24443
24444
24445
# File 'lib/ovirtsdk4/types.rb', line 24443

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

24452
24453
24454
# File 'lib/ovirtsdk4/types.rb', line 24452

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)

24461
24462
24463
# File 'lib/ovirtsdk4/types.rb', line 24461

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)

24470
24471
24472
# File 'lib/ovirtsdk4/types.rb', line 24470

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.

Returns:

  • (Integer)

24479
24480
24481
# File 'lib/ovirtsdk4/types.rb', line 24479

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.

Parameters:

  • value (Integer)

24488
24489
24490
# File 'lib/ovirtsdk4/types.rb', line 24488

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

24497
24498
24499
# File 'lib/ovirtsdk4/types.rb', line 24497

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

24506
24507
24508
# File 'lib/ovirtsdk4/types.rb', line 24506

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.

Returns:

  • (String)

24515
24516
24517
# File 'lib/ovirtsdk4/types.rb', line 24515

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.

Parameters:

  • value (String)

24524
24525
24526
# File 'lib/ovirtsdk4/types.rb', line 24524

def node_distance=(value)
  @node_distance = value
end

#numa_node_pinsArray<NumaNodePin>

Returns the value of the numa_node_pins attribute.

Returns:


24533
24534
24535
# File 'lib/ovirtsdk4/types.rb', line 24533

def numa_node_pins
  @numa_node_pins
end

#numa_node_pins=(list) ⇒ Object

Sets the value of the numa_node_pins attribute.

Parameters:


24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
# File 'lib/ovirtsdk4/types.rb', line 24542

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:


24559
24560
24561
# File 'lib/ovirtsdk4/types.rb', line 24559

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:


24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
# File 'lib/ovirtsdk4/types.rb', line 24568

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:


24585
24586
24587
# File 'lib/ovirtsdk4/types.rb', line 24585

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)

24598
24599
24600
24601
24602
24603
# File 'lib/ovirtsdk4/types.rb', line 24598

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