Class: OCI::Core::Models::ComputeHost

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/core/models/compute_host.rb

Overview

The customer facing object includes host details.

Constant Summary collapse

CONFIGURATION_STATE_ENUM =
[
  CONFIGURATION_STATE_CONFORMANT = 'CONFORMANT'.freeze,
  CONFIGURATION_STATE_NON_CONFORMANT = 'NON_CONFORMANT'.freeze,
  CONFIGURATION_STATE_CHECKING = 'CHECKING'.freeze,
  CONFIGURATION_STATE_PRE_APPLYING = 'PRE_APPLYING'.freeze,
  CONFIGURATION_STATE_APPLYING = 'APPLYING'.freeze,
  CONFIGURATION_STATE_UNKNOWN = 'UNKNOWN'.freeze,
  CONFIGURATION_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
HEALTH_ENUM =
[
  HEALTH_HEALTHY = 'HEALTHY'.freeze,
  HEALTH_UNHEALTHY = 'UNHEALTHY'.freeze,
  HEALTH_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
  LIFECYCLE_STATE_OCCUPIED = 'OCCUPIED'.freeze,
  LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
  LIFECYCLE_STATE_REPAIR = 'REPAIR'.freeze,
  LIFECYCLE_STATE_UNAVAILABLE = 'UNAVAILABLE'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ComputeHost

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'lib/oci/core/models/compute_host.rb', line 312

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

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

  self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain']

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

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

  self.fault_domain = attributes[:'faultDomain'] if attributes[:'faultDomain']

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

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

  self.hpc_island_id = attributes[:'hpcIslandId'] if attributes[:'hpcIslandId']

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

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

  self.host_correlation_id = attributes[:'hostCorrelationId'] if attributes[:'hostCorrelationId']

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

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

  self.compute_host_group_id = attributes[:'computeHostGroupId'] if attributes[:'computeHostGroupId']

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

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

  self.configuration_state = attributes[:'configurationState'] if attributes[:'configurationState']

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

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

  self.time_configuration_check = attributes[:'timeConfigurationCheck'] if attributes[:'timeConfigurationCheck']

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

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

  self.configuration_data = attributes[:'configurationData'] if attributes[:'configurationData']

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

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

  self.recycle_details = attributes[:'recycleDetails'] if attributes[:'recycleDetails']

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

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

  self.firmware_bundle_id = attributes[:'firmwareBundleId'] if attributes[:'firmwareBundleId']

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

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

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

  self.network_block_id = attributes[:'networkBlockId'] if attributes[:'networkBlockId']

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

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

  self.local_block_id = attributes[:'localBlockId'] if attributes[:'localBlockId']

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

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

  self.gpu_memory_fabric_id = attributes[:'gpuMemoryFabricId'] if attributes[:'gpuMemoryFabricId']

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

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

  self.instance_id = attributes[:'instanceId'] if attributes[:'instanceId']

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

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

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

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

  self.additional_data = attributes[:'additionalData'] if attributes[:'additionalData']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

  self.capacity_reservation_id = attributes[:'capacityReservationId'] if attributes[:'capacityReservationId']

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

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

  self.impacted_component_details = attributes[:'impactedComponentDetails'] if attributes[:'impactedComponentDetails']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

Instance Attribute Details

#additional_dataHash<String, Object>

Additional data that can be exposed to the customer. Will include raw fault codes for strategic customers

Returns:

  • (Hash<String, Object>)


143
144
145
# File 'lib/oci/core/models/compute_host.rb', line 143

def additional_data
  @additional_data
end

#availability_domainString

[Required] The availability domain of the compute host.

Example: Uocm:US-CHICAGO-1-AD-2

Returns:

  • (String)


43
44
45
# File 'lib/oci/core/models/compute_host.rb', line 43

def availability_domain
  @availability_domain
end

#capacity_reservation_idString

The OCID for the Capacity Reserver that is currently on host

Returns:

  • (String)


158
159
160
# File 'lib/oci/core/models/compute_host.rb', line 158

def capacity_reservation_id
  @capacity_reservation_id
end

#compartment_idString

[Required] The OCID for the compartment. This should always be the root compartment.

Returns:

  • (String)


49
50
51
# File 'lib/oci/core/models/compute_host.rb', line 49

def compartment_id
  @compartment_id
end

#compute_host_group_idString

The OCID for the Customer-unique host group associated with the Compute Bare Metal Host.

Returns:

  • (String)


80
81
82
# File 'lib/oci/core/models/compute_host.rb', line 80

def compute_host_group_id
  @compute_host_group_id
end

#configuration_dataOCI::Core::Models::ComputeHostConfigurationData



95
96
97
# File 'lib/oci/core/models/compute_host.rb', line 95

def configuration_data
  @configuration_data
end

#configuration_stateString

Configuration state of the Compute Bare Metal Host.

Returns:

  • (String)


85
86
87
# File 'lib/oci/core/models/compute_host.rb', line 85

def configuration_state
  @configuration_state
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


187
188
189
# File 'lib/oci/core/models/compute_host.rb', line 187

def defined_tags
  @defined_tags
end

#display_nameString

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


193
194
195
# File 'lib/oci/core/models/compute_host.rb', line 193

def display_name
  @display_name
end

#fault_domainString

[Required] A fault domain is a grouping of hardware and infrastructure within an availability domain. Each availability domain contains three fault domains. Fault domains let you distribute your instances so that they are not on the same physical hardware within a single availability domain. A hardware failure or Compute hardware maintenance that affects one fault domain does not affect instances in other fault domains.

This field is the Fault domain of the host

Returns:

  • (String)


65
66
67
# File 'lib/oci/core/models/compute_host.rb', line 65

def fault_domain
  @fault_domain
end

#firmware_bundle_idString

The OCID for the Customer-unique firmware bundle associated with the Host.

Returns:

  • (String)


103
104
105
# File 'lib/oci/core/models/compute_host.rb', line 103

def firmware_bundle_id
  @firmware_bundle_id
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


201
202
203
# File 'lib/oci/core/models/compute_host.rb', line 201

def freeform_tags
  @freeform_tags
end

#gpu_memory_fabric_idString

The OCID for Customer-unique GPU Memory Fabric

Returns:

  • (String)


123
124
125
# File 'lib/oci/core/models/compute_host.rb', line 123

def gpu_memory_fabric_id
  @gpu_memory_fabric_id
end

#healthString

[Required] The heathy state of the host

Returns:

  • (String)


138
139
140
# File 'lib/oci/core/models/compute_host.rb', line 138

def health
  @health
end

#host_correlation_idString

The ID that remains consistent when a host moves between capacity pools within the same tenancy.

Returns:

  • (String)


75
76
77
# File 'lib/oci/core/models/compute_host.rb', line 75

def host_correlation_id
  @host_correlation_id
end

#hpc_island_idString

The OCID for Customer-unique HPC Island

Returns:

  • (String)


70
71
72
# File 'lib/oci/core/models/compute_host.rb', line 70

def hpc_island_id
  @hpc_island_id
end

#idString

[Required] The OCID for the Customer-unique host

Returns:

  • (String)


54
55
56
# File 'lib/oci/core/models/compute_host.rb', line 54

def id
  @id
end

#impacted_component_detailsHash<String, Object>

A list that contains impacted components related to an unhealthy host. An impacted component will be a free-form structure of key values pairs that will provide more or less details based on data tiering

Returns:

  • (Hash<String, Object>)


164
165
166
# File 'lib/oci/core/models/compute_host.rb', line 164

def impacted_component_details
  @impacted_component_details
end

#instance_idString

The public OCID for the Virtual Machine or Bare Metal instance

Returns:

  • (String)


128
129
130
# File 'lib/oci/core/models/compute_host.rb', line 128

def instance_id
  @instance_id
end

#lifecycle_detailsHash<String, Object>

A free-form description detailing why the host is in its current state.

Returns:

  • (Hash<String, Object>)


153
154
155
# File 'lib/oci/core/models/compute_host.rb', line 153

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The lifecycle state of the host

Returns:

  • (String)


148
149
150
# File 'lib/oci/core/models/compute_host.rb', line 148

def lifecycle_state
  @lifecycle_state
end

#local_block_idString

The OCID for Customer-unique Local Block

Returns:

  • (String)


118
119
120
# File 'lib/oci/core/models/compute_host.rb', line 118

def local_block_id
  @local_block_id
end

#network_block_idString

The OCID for Customer-unique Network Block

Returns:

  • (String)


113
114
115
# File 'lib/oci/core/models/compute_host.rb', line 113

def network_block_id
  @network_block_id
end

#platformString

The platform of the host

Returns:

  • (String)


108
109
110
# File 'lib/oci/core/models/compute_host.rb', line 108

def platform
  @platform
end

#recycle_detailsOCI::Core::Models::RecycleDetails



98
99
100
# File 'lib/oci/core/models/compute_host.rb', line 98

def recycle_details
  @recycle_details
end

#shapeString

[Required] The shape of host

Returns:

  • (String)


133
134
135
# File 'lib/oci/core/models/compute_host.rb', line 133

def shape
  @shape
end

#time_configuration_checkDateTime

The date and time that the compute bare metal host configuration check was updated, in the format defined by RFC3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


92
93
94
# File 'lib/oci/core/models/compute_host.rb', line 92

def time_configuration_check
  @time_configuration_check
end

#time_createdDateTime

[Required] The date and time that the compute host record was created, in the format defined by [RFC3339](tools .ietf.org/html/rfc3339).

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


172
173
174
# File 'lib/oci/core/models/compute_host.rb', line 172

def time_created
  @time_created
end

#time_updatedDateTime

[Required] The date and time that the compute host record was updated, in the format defined by RFC3339.

Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


179
180
181
# File 'lib/oci/core/models/compute_host.rb', line 179

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/core/models/compute_host.rb', line 204

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'availability_domain': :'availabilityDomain',
    'compartment_id': :'compartmentId',
    'id': :'id',
    'fault_domain': :'faultDomain',
    'hpc_island_id': :'hpcIslandId',
    'host_correlation_id': :'hostCorrelationId',
    'compute_host_group_id': :'computeHostGroupId',
    'configuration_state': :'configurationState',
    'time_configuration_check': :'timeConfigurationCheck',
    'configuration_data': :'configurationData',
    'recycle_details': :'recycleDetails',
    'firmware_bundle_id': :'firmwareBundleId',
    'platform': :'platform',
    'network_block_id': :'networkBlockId',
    'local_block_id': :'localBlockId',
    'gpu_memory_fabric_id': :'gpuMemoryFabricId',
    'instance_id': :'instanceId',
    'shape': :'shape',
    'health': :'health',
    'additional_data': :'additionalData',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'capacity_reservation_id': :'capacityReservationId',
    'impacted_component_details': :'impactedComponentDetails',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'defined_tags': :'definedTags',
    'display_name': :'displayName',
    'freeform_tags': :'freeformTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/oci/core/models/compute_host.rb', line 241

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'availability_domain': :'String',
    'compartment_id': :'String',
    'id': :'String',
    'fault_domain': :'String',
    'hpc_island_id': :'String',
    'host_correlation_id': :'String',
    'compute_host_group_id': :'String',
    'configuration_state': :'String',
    'time_configuration_check': :'DateTime',
    'configuration_data': :'OCI::Core::Models::ComputeHostConfigurationData',
    'recycle_details': :'OCI::Core::Models::RecycleDetails',
    'firmware_bundle_id': :'String',
    'platform': :'String',
    'network_block_id': :'String',
    'local_block_id': :'String',
    'gpu_memory_fabric_id': :'String',
    'instance_id': :'String',
    'shape': :'String',
    'health': :'String',
    'additional_data': :'Hash<String, Object>',
    'lifecycle_state': :'String',
    'lifecycle_details': :'Hash<String, Object>',
    'capacity_reservation_id': :'String',
    'impacted_component_details': :'Hash<String, Object>',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'display_name': :'String',
    'freeform_tags': :'Hash<String, 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



523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/oci/core/models/compute_host.rb', line 523

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

  self.class == other.class &&
    availability_domain == other.availability_domain &&
    compartment_id == other.compartment_id &&
    id == other.id &&
    fault_domain == other.fault_domain &&
    hpc_island_id == other.hpc_island_id &&
    host_correlation_id == other.host_correlation_id &&
    compute_host_group_id == other.compute_host_group_id &&
    configuration_state == other.configuration_state &&
    time_configuration_check == other.time_configuration_check &&
    configuration_data == other.configuration_data &&
    recycle_details == other.recycle_details &&
    firmware_bundle_id == other.firmware_bundle_id &&
    platform == other.platform &&
    network_block_id == other.network_block_id &&
    local_block_id == other.local_block_id &&
    gpu_memory_fabric_id == other.gpu_memory_fabric_id &&
    instance_id == other.instance_id &&
    shape == other.shape &&
    health == other.health &&
    additional_data == other.additional_data &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    capacity_reservation_id == other.capacity_reservation_id &&
    impacted_component_details == other.impacted_component_details &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    defined_tags == other.defined_tags &&
    display_name == other.display_name &&
    freeform_tags == other.freeform_tags
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



581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'lib/oci/core/models/compute_host.rb', line 581

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


561
562
563
# File 'lib/oci/core/models/compute_host.rb', line 561

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



570
571
572
# File 'lib/oci/core/models/compute_host.rb', line 570

def hash
  [availability_domain, compartment_id, id, fault_domain, hpc_island_id, host_correlation_id, compute_host_group_id, configuration_state, time_configuration_check, configuration_data, recycle_details, firmware_bundle_id, platform, network_block_id, local_block_id, gpu_memory_fabric_id, instance_id, shape, health, additional_data, lifecycle_state, lifecycle_details, capacity_reservation_id, impacted_component_details, time_created, time_updated, defined_tags, display_name, freeform_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



614
615
616
617
618
619
620
621
622
623
# File 'lib/oci/core/models/compute_host.rb', line 614

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



608
609
610
# File 'lib/oci/core/models/compute_host.rb', line 608

def to_s
  to_hash.to_s
end