Class: OCI::Opsi::Models::HostCpuHardwareConfiguration

Inherits:
HostConfigurationMetricGroup show all
Defined in:
lib/oci/opsi/models/host_cpu_hardware_configuration.rb

Overview

CPU Hardware Configuration metric for the host

Constant Summary

Constants inherited from HostConfigurationMetricGroup

OCI::Opsi::Models::HostConfigurationMetricGroup::METRIC_NAME_ENUM

Instance Attribute Summary collapse

Attributes inherited from HostConfigurationMetricGroup

#metric_name, #time_collected

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from HostConfigurationMetricGroup

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ HostCpuHardwareConfiguration

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :time_collected (DateTime)

    The value to assign to the #time_collected proprety

  • :total_sockets (Integer)

    The value to assign to the #total_sockets property

  • :vendor_name (String)

    The value to assign to the #vendor_name property

  • :frequency_in_mhz (Float)

    The value to assign to the #frequency_in_mhz property

  • :cache_in_mb (Float)

    The value to assign to the #cache_in_mb property

  • :cpu_implementation (String)

    The value to assign to the #cpu_implementation property

  • :model (String)

    The value to assign to the #model property

  • :cpu_family (String)

    The value to assign to the #cpu_family property

  • :cores_per_socket (Integer)

    The value to assign to the #cores_per_socket property

  • :threads_per_socket (Integer)

    The value to assign to the #threads_per_socket property

  • :hyper_threading_enabled (String)

    The value to assign to the #hyper_threading_enabled property



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 110

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['metricName'] = 'HOST_CPU_HARDWARE_CONFIGURATION'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.total_sockets = attributes[:'totalSockets'] if attributes[:'totalSockets']

  raise 'You cannot provide both :totalSockets and :total_sockets' if attributes.key?(:'totalSockets') && attributes.key?(:'total_sockets')

  self.total_sockets = attributes[:'total_sockets'] if attributes[:'total_sockets']

  self.vendor_name = attributes[:'vendorName'] if attributes[:'vendorName']

  raise 'You cannot provide both :vendorName and :vendor_name' if attributes.key?(:'vendorName') && attributes.key?(:'vendor_name')

  self.vendor_name = attributes[:'vendor_name'] if attributes[:'vendor_name']

  self.frequency_in_mhz = attributes[:'frequencyInMhz'] if attributes[:'frequencyInMhz']

  raise 'You cannot provide both :frequencyInMhz and :frequency_in_mhz' if attributes.key?(:'frequencyInMhz') && attributes.key?(:'frequency_in_mhz')

  self.frequency_in_mhz = attributes[:'frequency_in_mhz'] if attributes[:'frequency_in_mhz']

  self.cache_in_mb = attributes[:'cacheInMB'] if attributes[:'cacheInMB']

  raise 'You cannot provide both :cacheInMB and :cache_in_mb' if attributes.key?(:'cacheInMB') && attributes.key?(:'cache_in_mb')

  self.cache_in_mb = attributes[:'cache_in_mb'] if attributes[:'cache_in_mb']

  self.cpu_implementation = attributes[:'cpuImplementation'] if attributes[:'cpuImplementation']

  raise 'You cannot provide both :cpuImplementation and :cpu_implementation' if attributes.key?(:'cpuImplementation') && attributes.key?(:'cpu_implementation')

  self.cpu_implementation = attributes[:'cpu_implementation'] if attributes[:'cpu_implementation']

  self.model = attributes[:'model'] if attributes[:'model']

  self.cpu_family = attributes[:'cpuFamily'] if attributes[:'cpuFamily']

  raise 'You cannot provide both :cpuFamily and :cpu_family' if attributes.key?(:'cpuFamily') && attributes.key?(:'cpu_family')

  self.cpu_family = attributes[:'cpu_family'] if attributes[:'cpu_family']

  self.cores_per_socket = attributes[:'coresPerSocket'] if attributes[:'coresPerSocket']

  raise 'You cannot provide both :coresPerSocket and :cores_per_socket' if attributes.key?(:'coresPerSocket') && attributes.key?(:'cores_per_socket')

  self.cores_per_socket = attributes[:'cores_per_socket'] if attributes[:'cores_per_socket']

  self.threads_per_socket = attributes[:'threadsPerSocket'] if attributes[:'threadsPerSocket']

  raise 'You cannot provide both :threadsPerSocket and :threads_per_socket' if attributes.key?(:'threadsPerSocket') && attributes.key?(:'threads_per_socket')

  self.threads_per_socket = attributes[:'threads_per_socket'] if attributes[:'threads_per_socket']

  self.hyper_threading_enabled = attributes[:'hyperThreadingEnabled'] if attributes[:'hyperThreadingEnabled']

  raise 'You cannot provide both :hyperThreadingEnabled and :hyper_threading_enabled' if attributes.key?(:'hyperThreadingEnabled') && attributes.key?(:'hyper_threading_enabled')

  self.hyper_threading_enabled = attributes[:'hyper_threading_enabled'] if attributes[:'hyper_threading_enabled']
end

Instance Attribute Details

#cache_in_mbFloat

Size of cache memory in megabytes

Returns:

  • (Float)


27
28
29
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 27

def cache_in_mb
  @cache_in_mb
end

#cores_per_socketInteger

Number of cores per socket

Returns:

  • (Integer)


43
44
45
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 43

def cores_per_socket
  @cores_per_socket
end

#cpu_familyString

Type of processor in the system

Returns:

  • (String)


39
40
41
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 39

def cpu_family
  @cpu_family
end

#cpu_implementationString

Model name of processor

Returns:

  • (String)


31
32
33
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 31

def cpu_implementation
  @cpu_implementation
end

#frequency_in_mhzFloat

Clock frequency of the processor in megahertz

Returns:

  • (Float)


23
24
25
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 23

def frequency_in_mhz
  @frequency_in_mhz
end

#hyper_threading_enabledString

Indicates if hyper-threading is enabled or not

Returns:

  • (String)


51
52
53
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 51

def hyper_threading_enabled
  @hyper_threading_enabled
end

#modelString

CPU model

Returns:

  • (String)


35
36
37
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 35

def model
  @model
end

#threads_per_socketInteger

Number of threads per socket

Returns:

  • (Integer)


47
48
49
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 47

def threads_per_socket
  @threads_per_socket
end

#total_socketsInteger

Total number of CPU Sockets

Returns:

  • (Integer)


15
16
17
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 15

def total_sockets
  @total_sockets
end

#vendor_nameString

Name of the CPU vendor

Returns:

  • (String)


19
20
21
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 19

def vendor_name
  @vendor_name
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 54

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'metric_name': :'metricName',
    'time_collected': :'timeCollected',
    'total_sockets': :'totalSockets',
    'vendor_name': :'vendorName',
    'frequency_in_mhz': :'frequencyInMhz',
    'cache_in_mb': :'cacheInMB',
    'cpu_implementation': :'cpuImplementation',
    'model': :'model',
    'cpu_family': :'cpuFamily',
    'cores_per_socket': :'coresPerSocket',
    'threads_per_socket': :'threadsPerSocket',
    'hyper_threading_enabled': :'hyperThreadingEnabled'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 74

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'metric_name': :'String',
    'time_collected': :'DateTime',
    'total_sockets': :'Integer',
    'vendor_name': :'String',
    'frequency_in_mhz': :'Float',
    'cache_in_mb': :'Float',
    'cpu_implementation': :'String',
    'model': :'String',
    'cpu_family': :'String',
    'cores_per_socket': :'Integer',
    'threads_per_socket': :'Integer',
    'hyper_threading_enabled': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 184

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    metric_name == other.metric_name &&
    time_collected == other.time_collected &&
    total_sockets == other.total_sockets &&
    vendor_name == other.vendor_name &&
    frequency_in_mhz == other.frequency_in_mhz &&
    cache_in_mb == other.cache_in_mb &&
    cpu_implementation == other.cpu_implementation &&
    model == other.model &&
    cpu_family == other.cpu_family &&
    cores_per_socket == other.cores_per_socket &&
    threads_per_socket == other.threads_per_socket &&
    hyper_threading_enabled == other.hyper_threading_enabled
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 225

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


205
206
207
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 205

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



214
215
216
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 214

def hash
  [metric_name, time_collected, total_sockets, vendor_name, frequency_in_mhz, cache_in_mb, cpu_implementation, model, cpu_family, cores_per_socket, threads_per_socket, hyper_threading_enabled].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



258
259
260
261
262
263
264
265
266
267
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 258

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



252
253
254
# File 'lib/oci/opsi/models/host_cpu_hardware_configuration.rb', line 252

def to_s
  to_hash.to_s
end