Class: OCI::Core::Models::Shape

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

Overview

Constant Summary collapse

BASELINE_OCPU_UTILIZATIONS_ENUM =
[
  BASELINE_OCPU_UTILIZATIONS_BASELINE_1_8 = 'BASELINE_1_8'.freeze,
  BASELINE_OCPU_UTILIZATIONS_BASELINE_1_2 = 'BASELINE_1_2'.freeze,
  BASELINE_OCPU_UTILIZATIONS_BASELINE_1_1 = 'BASELINE_1_1'.freeze,
  BASELINE_OCPU_UTILIZATIONS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
BILLING_TYPE_ENUM =
[
  BILLING_TYPE_ALWAYS_FREE = 'ALWAYS_FREE'.freeze,
  BILLING_TYPE_LIMITED_FREE = 'LIMITED_FREE'.freeze,
  BILLING_TYPE_PAID = 'PAID'.freeze,
  BILLING_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Shape

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
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
# File 'lib/oci/core/models/shape.rb', line 288

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.baseline_ocpu_utilizations = attributes[:'baselineOcpuUtilizations'] if attributes[:'baselineOcpuUtilizations']

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

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

  self.min_total_baseline_ocpus_required = attributes[:'minTotalBaselineOcpusRequired'] if attributes[:'minTotalBaselineOcpusRequired']

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

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

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

  self.processor_description = attributes[:'processorDescription'] if attributes[:'processorDescription']

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

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

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

  self.memory_in_gbs = attributes[:'memoryInGBs'] if attributes[:'memoryInGBs']

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

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

  self.network_ports = attributes[:'networkPorts'] if attributes[:'networkPorts']

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

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

  self.networking_bandwidth_in_gbps = attributes[:'networkingBandwidthInGbps'] if attributes[:'networkingBandwidthInGbps']

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

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

  self.max_vnic_attachments = attributes[:'maxVnicAttachments'] if attributes[:'maxVnicAttachments']

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

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

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

  self.gpu_description = attributes[:'gpuDescription'] if attributes[:'gpuDescription']

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

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

  self.local_disks = attributes[:'localDisks'] if attributes[:'localDisks']

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

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

  self.local_disks_total_size_in_gbs = attributes[:'localDisksTotalSizeInGBs'] if attributes[:'localDisksTotalSizeInGBs']

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

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

  self.local_disk_description = attributes[:'localDiskDescription'] if attributes[:'localDiskDescription']

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

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

  self.rdma_ports = attributes[:'rdmaPorts'] if attributes[:'rdmaPorts']

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

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

  self.rdma_bandwidth_in_gbps = attributes[:'rdmaBandwidthInGbps'] if attributes[:'rdmaBandwidthInGbps']

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

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

  self.is_live_migration_supported = attributes[:'isLiveMigrationSupported'] unless attributes[:'isLiveMigrationSupported'].nil?

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

  self.is_live_migration_supported = attributes[:'is_live_migration_supported'] unless attributes[:'is_live_migration_supported'].nil?

  self.ocpu_options = attributes[:'ocpuOptions'] if attributes[:'ocpuOptions']

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

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

  self.memory_options = attributes[:'memoryOptions'] if attributes[:'memoryOptions']

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

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

  self.networking_bandwidth_options = attributes[:'networkingBandwidthOptions'] if attributes[:'networkingBandwidthOptions']

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

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

  self.max_vnic_attachment_options = attributes[:'maxVnicAttachmentOptions'] if attributes[:'maxVnicAttachmentOptions']

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

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

  self.platform_config_options = attributes[:'platformConfigOptions'] if attributes[:'platformConfigOptions']

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

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

  self.is_billed_for_stopped_instance = attributes[:'isBilledForStoppedInstance'] unless attributes[:'isBilledForStoppedInstance'].nil?

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

  self.is_billed_for_stopped_instance = attributes[:'is_billed_for_stopped_instance'] unless attributes[:'is_billed_for_stopped_instance'].nil?

  self.billing_type = attributes[:'billingType'] if attributes[:'billingType']

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

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

  self.quota_names = attributes[:'quotaNames'] if attributes[:'quotaNames']

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

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

  self.is_subcore = attributes[:'isSubcore'] unless attributes[:'isSubcore'].nil?

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

  self.is_subcore = attributes[:'is_subcore'] unless attributes[:'is_subcore'].nil?

  self.is_flexible = attributes[:'isFlexible'] unless attributes[:'isFlexible'].nil?

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

  self.is_flexible = attributes[:'is_flexible'] unless attributes[:'is_flexible'].nil?

  self.resize_compatible_shapes = attributes[:'resizeCompatibleShapes'] if attributes[:'resizeCompatibleShapes']

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

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

  self.recommended_alternatives = attributes[:'recommendedAlternatives'] if attributes[:'recommendedAlternatives']

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

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

Instance Attribute Details

#baseline_ocpu_utilizationsArray<String>

For a subcore burstable VM, the supported baseline OCPU utilization for instances that use this shape.

Returns:

  • (Array<String>)


32
33
34
# File 'lib/oci/core/models/shape.rb', line 32

def baseline_ocpu_utilizations
  @baseline_ocpu_utilizations
end

#billing_typeString

How instances that use this shape are charged.

Returns:

  • (String)


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

def billing_type
  @billing_type
end

#gpu_descriptionString

A short description of the graphics processing unit (GPU) available for this shape.

If the shape does not have any GPUs, this field is null.

Returns:

  • (String)


86
87
88
# File 'lib/oci/core/models/shape.rb', line 86

def gpu_description
  @gpu_description
end

#gpusInteger

The number of GPUs available for this shape.

Returns:

  • (Integer)


79
80
81
# File 'lib/oci/core/models/shape.rb', line 79

def gpus
  @gpus
end

#is_billed_for_stopped_instanceBOOLEAN

Whether billing continues when the instances that use this shape are in the stopped state.

Returns:

  • (BOOLEAN)


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

def is_billed_for_stopped_instance
  @is_billed_for_stopped_instance
end

#is_flexibleBOOLEAN

Whether the shape supports creating flexible instances. A flexible shape is a shape that lets you customize the number of OCPUs and the amount of memory when launching or resizing your instance.

Returns:

  • (BOOLEAN)


166
167
168
# File 'lib/oci/core/models/shape.rb', line 166

def is_flexible
  @is_flexible
end

#is_live_migration_supportedBOOLEAN

Whether live migration is supported for this shape.

Returns:

  • (BOOLEAN)


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

def is_live_migration_supported
  @is_live_migration_supported
end

#is_subcoreBOOLEAN

Whether the shape supports creating subcore or burstable instances. A burstable instance is a virtual machine (VM) instance that provides a baseline level of CPU performance with the ability to burst to a higher level to support occasional spikes in usage.

Returns:

  • (BOOLEAN)


160
161
162
# File 'lib/oci/core/models/shape.rb', line 160

def is_subcore
  @is_subcore
end

#local_disk_descriptionString

A short description of the local disks available for this shape.

If the shape does not have any local disks, this field is null.

Returns:

  • (String)


105
106
107
# File 'lib/oci/core/models/shape.rb', line 105

def local_disk_description
  @local_disk_description
end

#local_disksInteger

The number of local disks available for this shape.

Returns:

  • (Integer)


91
92
93
# File 'lib/oci/core/models/shape.rb', line 91

def local_disks
  @local_disks
end

#local_disks_total_size_in_gbsFloat

The aggregate size of the local disks available for this shape, in gigabytes.

If the shape does not have any local disks, this field is null.

Returns:

  • (Float)


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

def local_disks_total_size_in_gbs
  @local_disks_total_size_in_gbs
end

#max_vnic_attachment_optionsOCI::Core::Models::ShapeMaxVnicAttachmentOptions



135
136
137
# File 'lib/oci/core/models/shape.rb', line 135

def max_vnic_attachment_options
  @max_vnic_attachment_options
end

#max_vnic_attachmentsInteger

The maximum number of VNIC attachments available for this shape.

Returns:

  • (Integer)


74
75
76
# File 'lib/oci/core/models/shape.rb', line 74

def max_vnic_attachments
  @max_vnic_attachments
end

#memory_in_gbsFloat

The default amount of memory available for this shape, in gigabytes.

Returns:

  • (Float)


59
60
61
# File 'lib/oci/core/models/shape.rb', line 59

def memory_in_gbs
  @memory_in_gbs
end

#memory_optionsOCI::Core::Models::ShapeMemoryOptions



129
130
131
# File 'lib/oci/core/models/shape.rb', line 129

def memory_options
  @memory_options
end

#min_total_baseline_ocpus_requiredFloat

For a subcore burstable VM, the minimum total baseline OCPUs required. The total baseline OCPUs is equal to baselineOcpuUtilization chosen multiplied by the number of OCPUs chosen.

Returns:

  • (Float)


38
39
40
# File 'lib/oci/core/models/shape.rb', line 38

def min_total_baseline_ocpus_required
  @min_total_baseline_ocpus_required
end

#network_portsInteger

The number of physical network interface card (NIC) ports available for this shape.

Returns:

  • (Integer)


64
65
66
# File 'lib/oci/core/models/shape.rb', line 64

def network_ports
  @network_ports
end

#networking_bandwidth_in_gbpsFloat

The networking bandwidth available for this shape, in gigabits per second.

Returns:

  • (Float)


69
70
71
# File 'lib/oci/core/models/shape.rb', line 69

def networking_bandwidth_in_gbps
  @networking_bandwidth_in_gbps
end

#networking_bandwidth_optionsOCI::Core::Models::ShapeNetworkingBandwidthOptions



132
133
134
# File 'lib/oci/core/models/shape.rb', line 132

def networking_bandwidth_options
  @networking_bandwidth_options
end

#ocpu_optionsOCI::Core::Models::ShapeOcpuOptions



126
127
128
# File 'lib/oci/core/models/shape.rb', line 126

def ocpu_options
  @ocpu_options
end

#ocpusFloat

The default number of OCPUs available for this shape.

Returns:

  • (Float)


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

def ocpus
  @ocpus
end

#platform_config_optionsOCI::Core::Models::ShapePlatformConfigOptions



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

def platform_config_options
  @platform_config_options
end

#processor_descriptionString

A short description of the shape's processor (CPU).

Returns:

  • (String)


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

def processor_description
  @processor_description
end

#quota_namesArray<String>

The list of of compartment quotas for the shape.

Returns:

  • (Array<String>)


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

def quota_names
  @quota_names
end

#rdma_bandwidth_in_gbpsInteger

The networking bandwidth available for the remote direct memory access (RDMA) network for this shape, in gigabits per second.

Returns:

  • (Integer)


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

def rdma_bandwidth_in_gbps
  @rdma_bandwidth_in_gbps
end

#rdma_portsInteger

The number of networking ports available for the remote direct memory access (RDMA) network between nodes in a high performance computing (HPC) cluster network. If the shape does not support cluster networks, this value is 0.

Returns:

  • (Integer)


112
113
114
# File 'lib/oci/core/models/shape.rb', line 112

def rdma_ports
  @rdma_ports
end

The list of shapes and shape details (if applicable) that Oracle recommends that you use as an alternative to the current shape.



177
178
179
# File 'lib/oci/core/models/shape.rb', line 177

def recommended_alternatives
  @recommended_alternatives
end

#resize_compatible_shapesArray<String>

The list of compatible shapes that this shape can be changed to. For more information, see Changing the Shape of an Instance.

Returns:

  • (Array<String>)


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

def resize_compatible_shapes
  @resize_compatible_shapes
end

#shapeString

[Required] The name of the shape. You can enumerate all available shapes by calling list_shapes.

Returns:

  • (String)


44
45
46
# File 'lib/oci/core/models/shape.rb', line 44

def shape
  @shape
end

Class Method Details

.attribute_mapObject

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



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/oci/core/models/shape.rb', line 180

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'baseline_ocpu_utilizations': :'baselineOcpuUtilizations',
    'min_total_baseline_ocpus_required': :'minTotalBaselineOcpusRequired',
    'shape': :'shape',
    'processor_description': :'processorDescription',
    'ocpus': :'ocpus',
    'memory_in_gbs': :'memoryInGBs',
    'network_ports': :'networkPorts',
    'networking_bandwidth_in_gbps': :'networkingBandwidthInGbps',
    'max_vnic_attachments': :'maxVnicAttachments',
    'gpus': :'gpus',
    'gpu_description': :'gpuDescription',
    'local_disks': :'localDisks',
    'local_disks_total_size_in_gbs': :'localDisksTotalSizeInGBs',
    'local_disk_description': :'localDiskDescription',
    'rdma_ports': :'rdmaPorts',
    'rdma_bandwidth_in_gbps': :'rdmaBandwidthInGbps',
    'is_live_migration_supported': :'isLiveMigrationSupported',
    'ocpu_options': :'ocpuOptions',
    'memory_options': :'memoryOptions',
    'networking_bandwidth_options': :'networkingBandwidthOptions',
    'max_vnic_attachment_options': :'maxVnicAttachmentOptions',
    'platform_config_options': :'platformConfigOptions',
    'is_billed_for_stopped_instance': :'isBilledForStoppedInstance',
    'billing_type': :'billingType',
    'quota_names': :'quotaNames',
    'is_subcore': :'isSubcore',
    'is_flexible': :'isFlexible',
    'resize_compatible_shapes': :'resizeCompatibleShapes',
    'recommended_alternatives': :'recommendedAlternatives'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/oci/core/models/shape.rb', line 217

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'baseline_ocpu_utilizations': :'Array<String>',
    'min_total_baseline_ocpus_required': :'Float',
    'shape': :'String',
    'processor_description': :'String',
    'ocpus': :'Float',
    'memory_in_gbs': :'Float',
    'network_ports': :'Integer',
    'networking_bandwidth_in_gbps': :'Float',
    'max_vnic_attachments': :'Integer',
    'gpus': :'Integer',
    'gpu_description': :'String',
    'local_disks': :'Integer',
    'local_disks_total_size_in_gbs': :'Float',
    'local_disk_description': :'String',
    'rdma_ports': :'Integer',
    'rdma_bandwidth_in_gbps': :'Integer',
    'is_live_migration_supported': :'BOOLEAN',
    'ocpu_options': :'OCI::Core::Models::ShapeOcpuOptions',
    'memory_options': :'OCI::Core::Models::ShapeMemoryOptions',
    'networking_bandwidth_options': :'OCI::Core::Models::ShapeNetworkingBandwidthOptions',
    'max_vnic_attachment_options': :'OCI::Core::Models::ShapeMaxVnicAttachmentOptions',
    'platform_config_options': :'OCI::Core::Models::ShapePlatformConfigOptions',
    'is_billed_for_stopped_instance': :'BOOLEAN',
    'billing_type': :'String',
    'quota_names': :'Array<String>',
    'is_subcore': :'BOOLEAN',
    'is_flexible': :'BOOLEAN',
    'resize_compatible_shapes': :'Array<String>',
    'recommended_alternatives': :'Array<OCI::Core::Models::ShapeAlternativeObject>'
    # 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



497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# File 'lib/oci/core/models/shape.rb', line 497

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

  self.class == other.class &&
    baseline_ocpu_utilizations == other.baseline_ocpu_utilizations &&
    min_total_baseline_ocpus_required == other.min_total_baseline_ocpus_required &&
    shape == other.shape &&
    processor_description == other.processor_description &&
    ocpus == other.ocpus &&
    memory_in_gbs == other.memory_in_gbs &&
    network_ports == other.network_ports &&
    networking_bandwidth_in_gbps == other.networking_bandwidth_in_gbps &&
    max_vnic_attachments == other.max_vnic_attachments &&
    gpus == other.gpus &&
    gpu_description == other.gpu_description &&
    local_disks == other.local_disks &&
    local_disks_total_size_in_gbs == other.local_disks_total_size_in_gbs &&
    local_disk_description == other.local_disk_description &&
    rdma_ports == other.rdma_ports &&
    rdma_bandwidth_in_gbps == other.rdma_bandwidth_in_gbps &&
    is_live_migration_supported == other.is_live_migration_supported &&
    ocpu_options == other.ocpu_options &&
    memory_options == other.memory_options &&
    networking_bandwidth_options == other.networking_bandwidth_options &&
    max_vnic_attachment_options == other.max_vnic_attachment_options &&
    platform_config_options == other.platform_config_options &&
    is_billed_for_stopped_instance == other.is_billed_for_stopped_instance &&
    billing_type == other.billing_type &&
    quota_names == other.quota_names &&
    is_subcore == other.is_subcore &&
    is_flexible == other.is_flexible &&
    resize_compatible_shapes == other.resize_compatible_shapes &&
    recommended_alternatives == other.recommended_alternatives
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



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
# File 'lib/oci/core/models/shape.rb', line 555

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


535
536
537
# File 'lib/oci/core/models/shape.rb', line 535

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



544
545
546
# File 'lib/oci/core/models/shape.rb', line 544

def hash
  [baseline_ocpu_utilizations, min_total_baseline_ocpus_required, shape, processor_description, ocpus, memory_in_gbs, network_ports, networking_bandwidth_in_gbps, max_vnic_attachments, gpus, gpu_description, local_disks, local_disks_total_size_in_gbs, local_disk_description, rdma_ports, rdma_bandwidth_in_gbps, is_live_migration_supported, ocpu_options, memory_options, networking_bandwidth_options, max_vnic_attachment_options, platform_config_options, is_billed_for_stopped_instance, billing_type, quota_names, is_subcore, is_flexible, resize_compatible_shapes, recommended_alternatives].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



588
589
590
591
592
593
594
595
596
597
# File 'lib/oci/core/models/shape.rb', line 588

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



582
583
584
# File 'lib/oci/core/models/shape.rb', line 582

def to_s
  to_hash.to_s
end