Class: OCI::Psql::Models::DbSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/psql/models/db_system.rb

Overview

Description of DbSystem resource.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_NEEDS_ATTENTION = 'NEEDS_ATTENTION'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
SYSTEM_TYPE_ENUM =
[
  SYSTEM_TYPE_OCI_OPTIMIZED_STORAGE = 'OCI_OPTIMIZED_STORAGE'.freeze,
  SYSTEM_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 = {}) ⇒ DbSystem

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
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
# File 'lib/oci/psql/models/db_system.rb', line 224

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

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

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

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

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

  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']

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

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

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

  self.system_type = attributes[:'systemType'] if attributes[:'systemType']

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

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

  self.db_version = attributes[:'dbVersion'] if attributes[:'dbVersion']

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

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

  self.config_id = attributes[:'configId'] if attributes[:'configId']

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

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

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

  self.instance_ocpu_count = attributes[:'instanceOcpuCount'] if attributes[:'instanceOcpuCount']

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

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

  self.instance_memory_size_in_gbs = attributes[:'instanceMemorySizeInGBs'] if attributes[:'instanceMemorySizeInGBs']

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

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

  self.instance_count = attributes[:'instanceCount'] if attributes[:'instanceCount']

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

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

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

  self.storage_details = attributes[:'storageDetails'] if attributes[:'storageDetails']

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

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

  self.network_details = attributes[:'networkDetails'] if attributes[:'networkDetails']

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

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

  self.management_policy = attributes[:'managementPolicy'] if attributes[:'managementPolicy']

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

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

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

Instance Attribute Details

#admin_usernameString

The DB system username.

Returns:

  • (String)


63
64
65
# File 'lib/oci/psql/models/db_system.rb', line 63

def admin_username
  @admin_username
end

#compartment_idString

[Required] Compartment identifier

Returns:

  • (String)


43
44
45
# File 'lib/oci/psql/models/db_system.rb', line 43

def compartment_id
  @compartment_id
end

#config_idString

Configuration identifier

Returns:

  • (String)


93
94
95
# File 'lib/oci/psql/models/db_system.rb', line 93

def config_id
  @config_id
end

#db_versionString

[Required] The major and minor versions of the DbSystem software.

Returns:

  • (String)


89
90
91
# File 'lib/oci/psql/models/db_system.rb', line 89

def db_version
  @db_version
end

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

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

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


75
76
77
# File 'lib/oci/psql/models/db_system.rb', line 75

def defined_tags
  @defined_tags
end

#descriptionString

Description of the DbSystem.

Returns:

  • (String)


39
40
41
# File 'lib/oci/psql/models/db_system.rb', line 39

def description
  @description
end

#display_nameString

[Required] DbSystem display name

Returns:

  • (String)


35
36
37
# File 'lib/oci/psql/models/db_system.rb', line 35

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


69
70
71
# File 'lib/oci/psql/models/db_system.rb', line 69

def freeform_tags
  @freeform_tags
end

#idString

[Required] Unique identifier that is immutable on creation

Returns:

  • (String)


31
32
33
# File 'lib/oci/psql/models/db_system.rb', line 31

def id
  @id
end

#instance_countInteger

Count of DbInstances in the DbSystem.

Returns:

  • (Integer)


109
110
111
# File 'lib/oci/psql/models/db_system.rb', line 109

def instance_count
  @instance_count
end

#instance_memory_size_in_gbsInteger

[Required] The total amount of memory available to each DbInstance, in gigabytes.

Returns:

  • (Integer)


105
106
107
# File 'lib/oci/psql/models/db_system.rb', line 105

def instance_memory_size_in_gbs
  @instance_memory_size_in_gbs
end

#instance_ocpu_countInteger

[Required] The total number of OCPUs available to each DbInstance.

Returns:

  • (Integer)


101
102
103
# File 'lib/oci/psql/models/db_system.rb', line 101

def instance_ocpu_count
  @instance_ocpu_count
end

#instancesArray<OCI::Psql::Models::DbInstance>

The list of DbInstances in the DbSystem.

Returns:



113
114
115
# File 'lib/oci/psql/models/db_system.rb', line 113

def instances
  @instances
end

#lifecycle_detailsString

A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.

Returns:

  • (String)


59
60
61
# File 'lib/oci/psql/models/db_system.rb', line 59

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The current state of the DbSystem.

Returns:

  • (String)


55
56
57
# File 'lib/oci/psql/models/db_system.rb', line 55

def lifecycle_state
  @lifecycle_state
end

#management_policyOCI::Psql::Models::ManagementPolicy

This attribute is required.



125
126
127
# File 'lib/oci/psql/models/db_system.rb', line 125

def management_policy
  @management_policy
end

#network_detailsOCI::Psql::Models::NetworkDetails

This attribute is required.



121
122
123
# File 'lib/oci/psql/models/db_system.rb', line 121

def network_details
  @network_details
end

#shapeString

[Required] Shape of dbInstance.

Returns:

  • (String)


97
98
99
# File 'lib/oci/psql/models/db_system.rb', line 97

def shape
  @shape
end

#sourceOCI::Psql::Models::SourceDetails



128
129
130
# File 'lib/oci/psql/models/db_system.rb', line 128

def source
  @source
end

#storage_detailsOCI::Psql::Models::StorageDetails

This attribute is required.



117
118
119
# File 'lib/oci/psql/models/db_system.rb', line 117

def storage_details
  @storage_details
end

#system_tagsHash<String, Hash<String, Object>>

System tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

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


81
82
83
# File 'lib/oci/psql/models/db_system.rb', line 81

def system_tags
  @system_tags
end

#system_typeString

[Required] Type of the DbSystem.

Returns:

  • (String)


85
86
87
# File 'lib/oci/psql/models/db_system.rb', line 85

def system_type
  @system_type
end

#time_createdDateTime

[Required] The time the the DbSystem was created. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


47
48
49
# File 'lib/oci/psql/models/db_system.rb', line 47

def time_created
  @time_created
end

#time_updatedDateTime

The time the DbSystem was updated. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


51
52
53
# File 'lib/oci/psql/models/db_system.rb', line 51

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/psql/models/db_system.rb', line 131

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'description': :'description',
    'compartment_id': :'compartmentId',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'admin_username': :'adminUsername',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags',
    'system_type': :'systemType',
    'db_version': :'dbVersion',
    'config_id': :'configId',
    'shape': :'shape',
    'instance_ocpu_count': :'instanceOcpuCount',
    'instance_memory_size_in_gbs': :'instanceMemorySizeInGBs',
    'instance_count': :'instanceCount',
    'instances': :'instances',
    'storage_details': :'storageDetails',
    'network_details': :'networkDetails',
    'management_policy': :'managementPolicy',
    'source': :'source'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/psql/models/db_system.rb', line 163

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'description': :'String',
    'compartment_id': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'admin_username': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_tags': :'Hash<String, Hash<String, Object>>',
    'system_type': :'String',
    'db_version': :'String',
    'config_id': :'String',
    'shape': :'String',
    'instance_ocpu_count': :'Integer',
    'instance_memory_size_in_gbs': :'Integer',
    'instance_count': :'Integer',
    'instances': :'Array<OCI::Psql::Models::DbInstance>',
    'storage_details': :'OCI::Psql::Models::StorageDetails',
    'network_details': :'OCI::Psql::Models::NetworkDetails',
    'management_policy': :'OCI::Psql::Models::ManagementPolicy',
    'source': :'OCI::Psql::Models::SourceDetails'
    # 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



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
# File 'lib/oci/psql/models/db_system.rb', line 388

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    description == other.description &&
    compartment_id == other.compartment_id &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    admin_username == other.admin_username &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags &&
    system_type == other.system_type &&
    db_version == other.db_version &&
    config_id == other.config_id &&
    shape == other.shape &&
    instance_ocpu_count == other.instance_ocpu_count &&
    instance_memory_size_in_gbs == other.instance_memory_size_in_gbs &&
    instance_count == other.instance_count &&
    instances == other.instances &&
    storage_details == other.storage_details &&
    network_details == other.network_details &&
    management_policy == other.management_policy &&
    source == other.source
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



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/oci/psql/models/db_system.rb', line 441

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


421
422
423
# File 'lib/oci/psql/models/db_system.rb', line 421

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



430
431
432
# File 'lib/oci/psql/models/db_system.rb', line 430

def hash
  [id, display_name, description, compartment_id, time_created, time_updated, lifecycle_state, lifecycle_details, admin_username, freeform_tags, defined_tags, system_tags, system_type, db_version, config_id, shape, instance_ocpu_count, instance_memory_size_in_gbs, instance_count, instances, storage_details, network_details, management_policy, source].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



474
475
476
477
478
479
480
481
482
483
# File 'lib/oci/psql/models/db_system.rb', line 474

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



468
469
470
# File 'lib/oci/psql/models/db_system.rb', line 468

def to_s
  to_hash.to_s
end