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.



11629
11630
11631
11632
11633
11634
11635
11636
11637
# File 'lib/ovirtsdk4/types.rb', line 11629

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.



11642
11643
11644
11645
11646
11647
11648
11649
11650
# File 'lib/ovirtsdk4/types.rb', line 11642

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)


11404
11405
11406
# File 'lib/ovirtsdk4/types.rb', line 11404

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


11413
11414
11415
# File 'lib/ovirtsdk4/types.rb', line 11413

def comment=(value)
  @comment = value
end

#cpuCpu

Returns the value of the cpu attribute.

Returns:



11422
11423
11424
# File 'lib/ovirtsdk4/types.rb', line 11422

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)


11435
11436
11437
11438
11439
11440
# File 'lib/ovirtsdk4/types.rb', line 11435

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)


11447
11448
11449
# File 'lib/ovirtsdk4/types.rb', line 11447

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


11456
11457
11458
# File 'lib/ovirtsdk4/types.rb', line 11456

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



11655
11656
11657
11658
11659
11660
11661
11662
11663
# File 'lib/ovirtsdk4/types.rb', line 11655

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:



11465
11466
11467
# File 'lib/ovirtsdk4/types.rb', line 11465

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)


11478
11479
11480
11481
11482
11483
# File 'lib/ovirtsdk4/types.rb', line 11478

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)


11490
11491
11492
# File 'lib/ovirtsdk4/types.rb', line 11490

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


11499
11500
11501
# File 'lib/ovirtsdk4/types.rb', line 11499

def id=(value)
  @id = value
end

#indexInteger

Returns the value of the index attribute.

Returns:

  • (Integer)


11508
11509
11510
# File 'lib/ovirtsdk4/types.rb', line 11508

def index
  @index
end

#index=(value) ⇒ Object

Sets the value of the index attribute.

Parameters:

  • value (Integer)


11517
11518
11519
# File 'lib/ovirtsdk4/types.rb', line 11517

def index=(value)
  @index = value
end

#memoryInteger

Returns the value of the memory attribute.

Returns:

  • (Integer)


11526
11527
11528
# File 'lib/ovirtsdk4/types.rb', line 11526

def memory
  @memory
end

#memory=(value) ⇒ Object

Sets the value of the memory attribute.

Parameters:

  • value (Integer)


11535
11536
11537
# File 'lib/ovirtsdk4/types.rb', line 11535

def memory=(value)
  @memory = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


11544
11545
11546
# File 'lib/ovirtsdk4/types.rb', line 11544

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


11553
11554
11555
# File 'lib/ovirtsdk4/types.rb', line 11553

def name=(value)
  @name = value
end

#node_distanceString

Returns the value of the node_distance attribute.

Returns:

  • (String)


11562
11563
11564
# File 'lib/ovirtsdk4/types.rb', line 11562

def node_distance
  @node_distance
end

#node_distance=(value) ⇒ Object

Sets the value of the node_distance attribute.

Parameters:

  • value (String)


11571
11572
11573
# File 'lib/ovirtsdk4/types.rb', line 11571

def node_distance=(value)
  @node_distance = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



11580
11581
11582
# File 'lib/ovirtsdk4/types.rb', line 11580

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
# File 'lib/ovirtsdk4/types.rb', line 11589

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