Class: OvirtSDK4::Cpu

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary (collapse)

Methods included from Type

#href, #href=

Constructor Details

- (Cpu) initialize(opts = {})

Creates a new instance of the OvirtSDK4::Cpu 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):

  • :architecture (Architecture)

    The value of attribute architecture.

  • :cores (Array<Core>, Array<Hash>)

    The values of attribute cores.

  • :cpu_tune (CpuTune, Hash)

    The value of attribute cpu_tune.

  • :level (Integer)

    The value of attribute level.

  • :mode (CpuMode)

    The value of attribute mode.

  • :name (String)

    The value of attribute name.

  • :speed (Fixnum)

    The value of attribute speed.

  • :topology (CpuTopology, Hash)

    The value of attribute topology.

  • :type (String)

    The value of attribute type.



1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
# File 'lib/ovirtsdk4/types.rb', line 1837

def initialize(opts = {})
  super(opts)
  self.architecture = opts[:architecture]
  self.cores = opts[:cores]
  self.cpu_tune = opts[:cpu_tune]
  self.level = opts[:level]
  self.mode = opts[:mode]
  self.name = opts[:name]
  self.speed = opts[:speed]
  self.topology = opts[:topology]
  self.type = opts[:type]
end

Instance Method Details

- (Architecture) architecture

Returns the value of the architecture attribute.

Returns:



1633
1634
1635
# File 'lib/ovirtsdk4/types.rb', line 1633

def architecture
  return @architecture
end

- (Object) architecture=(value)

Sets the value of the architecture attribute.

Parameters:



1642
1643
1644
# File 'lib/ovirtsdk4/types.rb', line 1642

def architecture=(value)
  @architecture = value
end

- (Array<Core>) cores

Returns the value of the cores attribute.

Returns:



1651
1652
1653
# File 'lib/ovirtsdk4/types.rb', line 1651

def cores
  return @cores
end

- (Object) cores=(list)

Sets the value of the cores attribute.

Parameters:

  • list (Array<Core>)


1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
# File 'lib/ovirtsdk4/types.rb', line 1659

def cores=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Core.new(value)
      end
    end
  end
  @cores = list
end

- (CpuTune) cpu_tune

Returns the value of the cpu_tune attribute.

Returns:



1676
1677
1678
# File 'lib/ovirtsdk4/types.rb', line 1676

def cpu_tune
  return @cpu_tune
end

- (Object) cpu_tune=(value)

Sets the value of the cpu_tune attribute.

The value parameter can be an instance of OvirtSDK4::CpuTune 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:



1689
1690
1691
1692
1693
1694
# File 'lib/ovirtsdk4/types.rb', line 1689

def cpu_tune=(value)
  if value.is_a?(Hash)
    value = CpuTune.new(value)
  end
  @cpu_tune = value
end

- (Integer) level

Returns the value of the level attribute.

Returns:

  • (Integer)


1701
1702
1703
# File 'lib/ovirtsdk4/types.rb', line 1701

def level
  return @level
end

- (Object) level=(value)

Sets the value of the level attribute.

Parameters:

  • value (Integer)


1710
1711
1712
# File 'lib/ovirtsdk4/types.rb', line 1710

def level=(value)
  @level = value
end

- (CpuMode) mode

Returns the value of the mode attribute.

Returns:



1719
1720
1721
# File 'lib/ovirtsdk4/types.rb', line 1719

def mode
  return @mode
end

- (Object) mode=(value)

Sets the value of the mode attribute.

Parameters:



1728
1729
1730
# File 'lib/ovirtsdk4/types.rb', line 1728

def mode=(value)
  @mode = value
end

- (String) name

Returns the value of the name attribute.

Returns:

  • (String)


1737
1738
1739
# File 'lib/ovirtsdk4/types.rb', line 1737

def name
  return @name
end

- (Object) name=(value)

Sets the value of the name attribute.

Parameters:

  • value (String)


1746
1747
1748
# File 'lib/ovirtsdk4/types.rb', line 1746

def name=(value)
  @name = value
end

- (Fixnum) speed

Returns the value of the speed attribute.

Returns:

  • (Fixnum)


1755
1756
1757
# File 'lib/ovirtsdk4/types.rb', line 1755

def speed
  return @speed
end

- (Object) speed=(value)

Sets the value of the speed attribute.

Parameters:

  • value (Fixnum)


1764
1765
1766
# File 'lib/ovirtsdk4/types.rb', line 1764

def speed=(value)
  @speed = value
end

- (CpuTopology) topology

Returns the value of the topology attribute.

Returns:



1773
1774
1775
# File 'lib/ovirtsdk4/types.rb', line 1773

def topology
  return @topology
end

- (Object) topology=(value)

Sets the value of the topology attribute.

The value parameter can be an instance of OvirtSDK4::CpuTopology 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:



1786
1787
1788
1789
1790
1791
# File 'lib/ovirtsdk4/types.rb', line 1786

def topology=(value)
  if value.is_a?(Hash)
    value = CpuTopology.new(value)
  end
  @topology = value
end

- (String) type

Returns the value of the type attribute.

Returns:

  • (String)


1798
1799
1800
# File 'lib/ovirtsdk4/types.rb', line 1798

def type
  return @type
end

- (Object) type=(value)

Sets the value of the type attribute.

Parameters:

  • value (String)


1807
1808
1809
# File 'lib/ovirtsdk4/types.rb', line 1807

def type=(value)
  @type = value
end