Class: OCI::Database::Models::LaunchDbSystemBase

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/models/launch_db_system_base.rb

Overview

LaunchDbSystemBase model. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Constant Summary collapse

SOURCE_ENUM =

rubocop:disable Metrics/LineLength

[
  SOURCE_NONE = 'NONE'.freeze,
  SOURCE_DB_BACKUP = 'DB_BACKUP'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LaunchDbSystemBase

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :availability_domain (String)

    The value to assign to the #availability_domain property

  • :backup_subnet_id (String)

    The value to assign to the #backup_subnet_id property

  • :cluster_name (String)

    The value to assign to the #cluster_name property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :cpu_core_count (Integer)

    The value to assign to the #cpu_core_count property

  • :data_storage_percentage (Integer)

    The value to assign to the #data_storage_percentage property

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

    The value to assign to the #defined_tags property

  • :display_name (String)

    The value to assign to the #display_name property

  • :domain (String)

    The value to assign to the #domain property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :hostname (String)

    The value to assign to the #hostname property

  • :initial_data_storage_size_in_gb (Integer)

    The value to assign to the #initial_data_storage_size_in_gb property

  • :node_count (Integer)

    The value to assign to the #node_count property

  • :shape (String)

    The value to assign to the #shape property

  • :source (String)

    The value to assign to the #source property

  • :ssh_public_keys (Array<String>)

    The value to assign to the #ssh_public_keys property

  • :subnet_id (String)

    The value to assign to the #subnet_id property



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
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
# File 'lib/oci/database/models/launch_db_system_base.rb', line 220

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

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

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

  self.cluster_name = attributes[:'clusterName'] if attributes[:'clusterName']

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

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

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

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

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

  self.data_storage_percentage = attributes[:'dataStoragePercentage'] if attributes[:'dataStoragePercentage']

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

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

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

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

  self.initial_data_storage_size_in_gb = attributes[:'initialDataStorageSizeInGB'] if attributes[:'initialDataStorageSizeInGB']

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

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

  self.node_count = attributes[:'nodeCount'] if attributes[:'nodeCount']

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

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

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

  self.source = attributes[:'source'] if attributes[:'source']
  self.source = "NONE" if source.nil? && !attributes.key?(:'source') # rubocop:disable Style/StringLiterals

  self.ssh_public_keys = attributes[:'sshPublicKeys'] if attributes[:'sshPublicKeys']

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

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

  self.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId']

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

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

Instance Attribute Details

#availability_domainString

[Required] The Availability Domain where the DB System is located.

Returns:

  • (String)


17
18
19
# File 'lib/oci/database/models/launch_db_system_base.rb', line 17

def availability_domain
  @availability_domain
end

#backup_subnet_idString

The OCID of the backup network subnet the DB System is associated with. Applicable only to Exadata.

**Subnet Restrictions:** See above subnetId’s **Subnet Restriction**.

Returns:

  • (String)


24
25
26
# File 'lib/oci/database/models/launch_db_system_base.rb', line 24

def backup_subnet_id
  @backup_subnet_id
end

#cluster_nameString

Cluster name for Exadata and 2-node RAC DB Systems. The cluster name must begin with an an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive.

Returns:

  • (String)


29
30
31
# File 'lib/oci/database/models/launch_db_system_base.rb', line 29

def cluster_name
  @cluster_name
end

#compartment_idString

[Required] The Oracle Cloud ID (OCID) of the compartment the DB System belongs in.

Returns:

  • (String)


33
34
35
# File 'lib/oci/database/models/launch_db_system_base.rb', line 33

def compartment_id
  @compartment_id
end

#cpu_core_countInteger

[Required] The number of CPU cores to enable. The valid values depend on the specified shape:

  • BM.DenseIO1.36 and BM.HighIO1.36 - Specify a multiple of 2, from 2 to 36.

  • BM.RACLocalStorage1.72 - Specify a multiple of 4, from 4 to 72.

  • Exadata.Quarter1.84 - Specify a multiple of 2, from 22 to 84.

  • Exadata.Half1.168 - Specify a multiple of 4, from 44 to 168.

  • Exadata.Full1.336 - Specify a multiple of 8, from 88 to 336.

For VM DB systems, the core count is inferred from the specific VM shape chosen, so this parameter is not used.

Returns:

  • (Integer)


46
47
48
# File 'lib/oci/database/models/launch_db_system_base.rb', line 46

def cpu_core_count
  @cpu_core_count
end

#data_storage_percentageInteger

The percentage assigned to DATA storage (user data and database files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Specify 80 or 40. The default is 80 percent assigned to DATA storage. This is not applicable for VM based DB systems.

Returns:

  • (Integer)


53
54
55
# File 'lib/oci/database/models/launch_db_system_base.rb', line 53

def data_storage_percentage
  @data_storage_percentage
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](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).

Example: ‘{"CostCenter": "42"}`

Returns:

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


61
62
63
# File 'lib/oci/database/models/launch_db_system_base.rb', line 61

def defined_tags
  @defined_tags
end

#display_nameString

The user-friendly name for the DB System. It does not have to be unique.

Returns:

  • (String)


65
66
67
# File 'lib/oci/database/models/launch_db_system_base.rb', line 65

def display_name
  @display_name
end

#domainString

A domain name used for the DB System. If the Oracle-provided Internet and VCN Resolver is enabled for the specified subnet, the domain name for the subnet is used (don’t provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted.

Returns:

  • (String)


72
73
74
# File 'lib/oci/database/models/launch_db_system_base.rb', line 72

def domain
  @domain
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](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).

Example: ‘"Finance"`

Returns:

  • (Hash<String, String>)


80
81
82
# File 'lib/oci/database/models/launch_db_system_base.rb', line 80

def freeform_tags
  @freeform_tags
end

#hostnameString

[Required] The host name for the DB System. The host name must begin with an alphabetic character and can contain a maximum of 30 alphanumeric characters, including hyphens (-).

The maximum length of the combined hostname and domain is 63 characters.

Note: The hostname must be unique within the subnet. If it is not unique, the DB System will fail to provision.

Returns:

  • (String)


91
92
93
# File 'lib/oci/database/models/launch_db_system_base.rb', line 91

def hostname
  @hostname
end

#initial_data_storage_size_in_gbInteger

Size, in GBs, of the initial data volume that will be created and attached to VM-shape based DB system. This storage can later be scaled up if needed. Note that the total storage size attached will be more than what is requested, to account for REDO/RECO space and software volume.

Returns:

  • (Integer)


96
97
98
# File 'lib/oci/database/models/launch_db_system_base.rb', line 96

def initial_data_storage_size_in_gb
  @initial_data_storage_size_in_gb
end

#node_countInteger

Number of nodes to launch for a VM-shape based RAC DB system.

Returns:

  • (Integer)


101
102
103
# File 'lib/oci/database/models/launch_db_system_base.rb', line 101

def node_count
  @node_count
end

#shapeString

[Required] The shape of the DB System. The shape determines resources allocated to the DB System - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. To get a list of shapes, use the list_db_system_shapes operation.

Returns:

  • (String)


105
106
107
# File 'lib/oci/database/models/launch_db_system_base.rb', line 105

def shape
  @shape
end

#sourceString

Source of database:

NONE for creating a new database
DB_BACKUP for creating a new database by restoring a backup

Returns:

  • (String)


112
113
114
# File 'lib/oci/database/models/launch_db_system_base.rb', line 112

def source
  @source
end

#ssh_public_keysArray<String>

[Required] The public key portion of the key pair to use for SSH access to the DB System. Multiple public keys can be provided. The length of the combined keys cannot exceed 10,000 characters.

Returns:

  • (Array<String>)


116
117
118
# File 'lib/oci/database/models/launch_db_system_base.rb', line 116

def ssh_public_keys
  @ssh_public_keys
end

#subnet_idString

[Required] The OCID of the subnet the DB System is associated with.

**Subnet Restrictions:**

  • For single node and 2-node (RAC) DB Systems, do not use a subnet that overlaps with 192.168.16.16/28

  • For Exadata and VM-based RAC DB Systems, do not use a subnet that overlaps with 192.168.128.0/20

These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and backup subnet.

Returns:

  • (String)


129
130
131
# File 'lib/oci/database/models/launch_db_system_base.rb', line 129

def subnet_id
  @subnet_id
end

Class Method Details

.attribute_mapObject

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



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/oci/database/models/launch_db_system_base.rb', line 132

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'availability_domain': :'availabilityDomain',
    'backup_subnet_id': :'backupSubnetId',
    'cluster_name': :'clusterName',
    'compartment_id': :'compartmentId',
    'cpu_core_count': :'cpuCoreCount',
    'data_storage_percentage': :'dataStoragePercentage',
    'defined_tags': :'definedTags',
    'display_name': :'displayName',
    'domain': :'domain',
    'freeform_tags': :'freeformTags',
    'hostname': :'hostname',
    'initial_data_storage_size_in_gb': :'initialDataStorageSizeInGB',
    'node_count': :'nodeCount',
    'shape': :'shape',
    'source': :'source',
    'ssh_public_keys': :'sshPublicKeys',
    'subnet_id': :'subnetId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



186
187
188
189
190
191
192
193
194
# File 'lib/oci/database/models/launch_db_system_base.rb', line 186

def self.get_subtype(object_hash)
  type = object_hash[:'source'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::Database::Models::LaunchDbSystemDetails' if type == 'NONE'
  return 'OCI::Database::Models::LaunchDbSystemFromBackupDetails' if type == 'DB_BACKUP'

  # TODO: Log a warning when the subtype is not found.
  'OCI::Database::Models::LaunchDbSystemBase'
end

.swagger_typesObject

Attribute type mapping.



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/oci/database/models/launch_db_system_base.rb', line 157

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'availability_domain': :'String',
    'backup_subnet_id': :'String',
    'cluster_name': :'String',
    'compartment_id': :'String',
    'cpu_core_count': :'Integer',
    'data_storage_percentage': :'Integer',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'display_name': :'String',
    'domain': :'String',
    'freeform_tags': :'Hash<String, String>',
    'hostname': :'String',
    'initial_data_storage_size_in_gb': :'Integer',
    'node_count': :'Integer',
    'shape': :'String',
    'source': :'String',
    'ssh_public_keys': :'Array<String>',
    'subnet_id': :'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



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/oci/database/models/launch_db_system_base.rb', line 330

def ==(other)
  return true if equal?(other)
  self.class == other.class &&
    availability_domain == other.availability_domain &&
    backup_subnet_id == other.backup_subnet_id &&
    cluster_name == other.cluster_name &&
    compartment_id == other.compartment_id &&
    cpu_core_count == other.cpu_core_count &&
    data_storage_percentage == other.data_storage_percentage &&
    defined_tags == other.defined_tags &&
    display_name == other.display_name &&
    domain == other.domain &&
    freeform_tags == other.freeform_tags &&
    hostname == other.hostname &&
    initial_data_storage_size_in_gb == other.initial_data_storage_size_in_gb &&
    node_count == other.node_count &&
    shape == other.shape &&
    source == other.source &&
    ssh_public_keys == other.ssh_public_keys &&
    subnet_id == other.subnet_id
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



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/oci/database/models/launch_db_system_base.rb', line 375

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


355
356
357
# File 'lib/oci/database/models/launch_db_system_base.rb', line 355

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



364
365
366
# File 'lib/oci/database/models/launch_db_system_base.rb', line 364

def hash
  [availability_domain, backup_subnet_id, cluster_name, compartment_id, cpu_core_count, data_storage_percentage, defined_tags, display_name, domain, freeform_tags, hostname, initial_data_storage_size_in_gb, node_count, shape, source, ssh_public_keys, subnet_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



407
408
409
410
411
412
413
414
415
# File 'lib/oci/database/models/launch_db_system_base.rb', line 407

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



401
402
403
# File 'lib/oci/database/models/launch_db_system_base.rb', line 401

def to_s
  to_hash.to_s
end