1# coding: utf-8
2# Copyright (c) 2016, 2021, Oracle and/or its affiliates.  All rights reserved.
3# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4
5from .host_configuration_metric_group import HostConfigurationMetricGroup
6from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
7from oci.decorators import init_model_state_from_kwargs
8
9
10@init_model_state_from_kwargs
11class HostCpuHardwareConfiguration(HostConfigurationMetricGroup):
12    """
13    CPU Hardware Configuration metric for the host
14    """
15
16    def __init__(self, **kwargs):
17        """
18        Initializes a new HostCpuHardwareConfiguration object with values from keyword arguments. The default value of the :py:attr:`~oci.opsi.models.HostCpuHardwareConfiguration.metric_name` attribute
19        of this class is ``HOST_CPU_HARDWARE_CONFIGURATION`` and it should not be changed.
20        The following keyword arguments are supported (corresponding to the getters/setters of this class):
21
22        :param metric_name:
23            The value to assign to the metric_name property of this HostCpuHardwareConfiguration.
24            Allowed values for this property are: "HOST_PRODUCT", "HOST_RESOURCE_ALLOCATION", "HOST_MEMORY_CONFIGURATION", "HOST_HARDWARE_CONFIGURATION", "HOST_CPU_HARDWARE_CONFIGURATION", "HOST_NETWORK_CONFIGURATION", "HOST_ENTITES"
25        :type metric_name: str
26
27        :param time_collected:
28            The value to assign to the time_collected property of this HostCpuHardwareConfiguration.
29        :type time_collected: datetime
30
31        :param total_sockets:
32            The value to assign to the total_sockets property of this HostCpuHardwareConfiguration.
33        :type total_sockets: int
34
35        :param vendor_name:
36            The value to assign to the vendor_name property of this HostCpuHardwareConfiguration.
37        :type vendor_name: str
38
39        :param frequency_in_mhz:
40            The value to assign to the frequency_in_mhz property of this HostCpuHardwareConfiguration.
41        :type frequency_in_mhz: float
42
43        :param cache_in_mb:
44            The value to assign to the cache_in_mb property of this HostCpuHardwareConfiguration.
45        :type cache_in_mb: float
46
47        :param cpu_implementation:
48            The value to assign to the cpu_implementation property of this HostCpuHardwareConfiguration.
49        :type cpu_implementation: str
50
51        :param model:
52            The value to assign to the model property of this HostCpuHardwareConfiguration.
53        :type model: str
54
55        :param cpu_family:
56            The value to assign to the cpu_family property of this HostCpuHardwareConfiguration.
57        :type cpu_family: str
58
59        :param cores_per_socket:
60            The value to assign to the cores_per_socket property of this HostCpuHardwareConfiguration.
61        :type cores_per_socket: int
62
63        :param threads_per_socket:
64            The value to assign to the threads_per_socket property of this HostCpuHardwareConfiguration.
65        :type threads_per_socket: int
66
67        :param hyper_threading_enabled:
68            The value to assign to the hyper_threading_enabled property of this HostCpuHardwareConfiguration.
69        :type hyper_threading_enabled: str
70
71        """
72        self.swagger_types = {
73            'metric_name': 'str',
74            'time_collected': 'datetime',
75            'total_sockets': 'int',
76            'vendor_name': 'str',
77            'frequency_in_mhz': 'float',
78            'cache_in_mb': 'float',
79            'cpu_implementation': 'str',
80            'model': 'str',
81            'cpu_family': 'str',
82            'cores_per_socket': 'int',
83            'threads_per_socket': 'int',
84            'hyper_threading_enabled': 'str'
85        }
86
87        self.attribute_map = {
88            'metric_name': 'metricName',
89            'time_collected': 'timeCollected',
90            'total_sockets': 'totalSockets',
91            'vendor_name': 'vendorName',
92            'frequency_in_mhz': 'frequencyInMhz',
93            'cache_in_mb': 'cacheInMB',
94            'cpu_implementation': 'cpuImplementation',
95            'model': 'model',
96            'cpu_family': 'cpuFamily',
97            'cores_per_socket': 'coresPerSocket',
98            'threads_per_socket': 'threadsPerSocket',
99            'hyper_threading_enabled': 'hyperThreadingEnabled'
100        }
101
102        self._metric_name = None
103        self._time_collected = None
104        self._total_sockets = None
105        self._vendor_name = None
106        self._frequency_in_mhz = None
107        self._cache_in_mb = None
108        self._cpu_implementation = None
109        self._model = None
110        self._cpu_family = None
111        self._cores_per_socket = None
112        self._threads_per_socket = None
113        self._hyper_threading_enabled = None
114        self._metric_name = 'HOST_CPU_HARDWARE_CONFIGURATION'
115
116    @property
117    def total_sockets(self):
118        """
119        Gets the total_sockets of this HostCpuHardwareConfiguration.
120        Total number of CPU Sockets
121
122
123        :return: The total_sockets of this HostCpuHardwareConfiguration.
124        :rtype: int
125        """
126        return self._total_sockets
127
128    @total_sockets.setter
129    def total_sockets(self, total_sockets):
130        """
131        Sets the total_sockets of this HostCpuHardwareConfiguration.
132        Total number of CPU Sockets
133
134
135        :param total_sockets: The total_sockets of this HostCpuHardwareConfiguration.
136        :type: int
137        """
138        self._total_sockets = total_sockets
139
140    @property
141    def vendor_name(self):
142        """
143        Gets the vendor_name of this HostCpuHardwareConfiguration.
144        Name of the CPU vendor
145
146
147        :return: The vendor_name of this HostCpuHardwareConfiguration.
148        :rtype: str
149        """
150        return self._vendor_name
151
152    @vendor_name.setter
153    def vendor_name(self, vendor_name):
154        """
155        Sets the vendor_name of this HostCpuHardwareConfiguration.
156        Name of the CPU vendor
157
158
159        :param vendor_name: The vendor_name of this HostCpuHardwareConfiguration.
160        :type: str
161        """
162        self._vendor_name = vendor_name
163
164    @property
165    def frequency_in_mhz(self):
166        """
167        Gets the frequency_in_mhz of this HostCpuHardwareConfiguration.
168        Clock frequency of the processor in megahertz
169
170
171        :return: The frequency_in_mhz of this HostCpuHardwareConfiguration.
172        :rtype: float
173        """
174        return self._frequency_in_mhz
175
176    @frequency_in_mhz.setter
177    def frequency_in_mhz(self, frequency_in_mhz):
178        """
179        Sets the frequency_in_mhz of this HostCpuHardwareConfiguration.
180        Clock frequency of the processor in megahertz
181
182
183        :param frequency_in_mhz: The frequency_in_mhz of this HostCpuHardwareConfiguration.
184        :type: float
185        """
186        self._frequency_in_mhz = frequency_in_mhz
187
188    @property
189    def cache_in_mb(self):
190        """
191        Gets the cache_in_mb of this HostCpuHardwareConfiguration.
192        Size of cache memory in megabytes
193
194
195        :return: The cache_in_mb of this HostCpuHardwareConfiguration.
196        :rtype: float
197        """
198        return self._cache_in_mb
199
200    @cache_in_mb.setter
201    def cache_in_mb(self, cache_in_mb):
202        """
203        Sets the cache_in_mb of this HostCpuHardwareConfiguration.
204        Size of cache memory in megabytes
205
206
207        :param cache_in_mb: The cache_in_mb of this HostCpuHardwareConfiguration.
208        :type: float
209        """
210        self._cache_in_mb = cache_in_mb
211
212    @property
213    def cpu_implementation(self):
214        """
215        Gets the cpu_implementation of this HostCpuHardwareConfiguration.
216        Model name of processor
217
218
219        :return: The cpu_implementation of this HostCpuHardwareConfiguration.
220        :rtype: str
221        """
222        return self._cpu_implementation
223
224    @cpu_implementation.setter
225    def cpu_implementation(self, cpu_implementation):
226        """
227        Sets the cpu_implementation of this HostCpuHardwareConfiguration.
228        Model name of processor
229
230
231        :param cpu_implementation: The cpu_implementation of this HostCpuHardwareConfiguration.
232        :type: str
233        """
234        self._cpu_implementation = cpu_implementation
235
236    @property
237    def model(self):
238        """
239        Gets the model of this HostCpuHardwareConfiguration.
240        CPU model
241
242
243        :return: The model of this HostCpuHardwareConfiguration.
244        :rtype: str
245        """
246        return self._model
247
248    @model.setter
249    def model(self, model):
250        """
251        Sets the model of this HostCpuHardwareConfiguration.
252        CPU model
253
254
255        :param model: The model of this HostCpuHardwareConfiguration.
256        :type: str
257        """
258        self._model = model
259
260    @property
261    def cpu_family(self):
262        """
263        Gets the cpu_family of this HostCpuHardwareConfiguration.
264        Type of processor in the system
265
266
267        :return: The cpu_family of this HostCpuHardwareConfiguration.
268        :rtype: str
269        """
270        return self._cpu_family
271
272    @cpu_family.setter
273    def cpu_family(self, cpu_family):
274        """
275        Sets the cpu_family of this HostCpuHardwareConfiguration.
276        Type of processor in the system
277
278
279        :param cpu_family: The cpu_family of this HostCpuHardwareConfiguration.
280        :type: str
281        """
282        self._cpu_family = cpu_family
283
284    @property
285    def cores_per_socket(self):
286        """
287        Gets the cores_per_socket of this HostCpuHardwareConfiguration.
288        Number of cores per socket
289
290
291        :return: The cores_per_socket of this HostCpuHardwareConfiguration.
292        :rtype: int
293        """
294        return self._cores_per_socket
295
296    @cores_per_socket.setter
297    def cores_per_socket(self, cores_per_socket):
298        """
299        Sets the cores_per_socket of this HostCpuHardwareConfiguration.
300        Number of cores per socket
301
302
303        :param cores_per_socket: The cores_per_socket of this HostCpuHardwareConfiguration.
304        :type: int
305        """
306        self._cores_per_socket = cores_per_socket
307
308    @property
309    def threads_per_socket(self):
310        """
311        Gets the threads_per_socket of this HostCpuHardwareConfiguration.
312        Number of threads per socket
313
314
315        :return: The threads_per_socket of this HostCpuHardwareConfiguration.
316        :rtype: int
317        """
318        return self._threads_per_socket
319
320    @threads_per_socket.setter
321    def threads_per_socket(self, threads_per_socket):
322        """
323        Sets the threads_per_socket of this HostCpuHardwareConfiguration.
324        Number of threads per socket
325
326
327        :param threads_per_socket: The threads_per_socket of this HostCpuHardwareConfiguration.
328        :type: int
329        """
330        self._threads_per_socket = threads_per_socket
331
332    @property
333    def hyper_threading_enabled(self):
334        """
335        Gets the hyper_threading_enabled of this HostCpuHardwareConfiguration.
336        Indicates if hyper-threading is enabled or not
337
338
339        :return: The hyper_threading_enabled of this HostCpuHardwareConfiguration.
340        :rtype: str
341        """
342        return self._hyper_threading_enabled
343
344    @hyper_threading_enabled.setter
345    def hyper_threading_enabled(self, hyper_threading_enabled):
346        """
347        Sets the hyper_threading_enabled of this HostCpuHardwareConfiguration.
348        Indicates if hyper-threading is enabled or not
349
350
351        :param hyper_threading_enabled: The hyper_threading_enabled of this HostCpuHardwareConfiguration.
352        :type: str
353        """
354        self._hyper_threading_enabled = hyper_threading_enabled
355
356    def __repr__(self):
357        return formatted_flat_dict(self)
358
359    def __eq__(self, other):
360        if other is None:
361            return False
362
363        return self.__dict__ == other.__dict__
364
365    def __ne__(self, other):
366        return not self == other
367