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

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

Overview

An Oracle database on a DB System. For more information, see [Managing Oracle Databases](docs.us-phoenix-1.oraclecloud.com/Content/Database/Concepts/overview.htm).

To use any of the API operations, you must be authorized in an IAM policy. If you’re not authorized, talk to an administrator. If you’re an administrator who needs to write policies to give users access, see [Getting Started with Policies](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
LIFECYCLE_STATE_UPDATING = 'UPDATING',
LIFECYCLE_STATE_BACKUP_IN_PROGRESS = 'BACKUP_IN_PROGRESS',
LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
LIFECYCLE_STATE_RESTORE_FAILED = 'RESTORE_FAILED',
LIFECYCLE_STATE_FAILED = 'FAILED',
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Database

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :character_set (String)

    The value to assign to the #character_set property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :db_backup_config (OCI::Database::Models::DbBackupConfig)

    The value to assign to the #db_backup_config property

  • :db_home_id (String)

    The value to assign to the #db_home_id property

  • :db_name (String)

    The value to assign to the #db_name property

  • :db_unique_name (String)

    The value to assign to the #db_unique_name property

  • :db_workload (String)

    The value to assign to the #db_workload property

  • :id (String)

    The value to assign to the #id property

  • :lifecycle_details (String)

    The value to assign to the #lifecycle_details property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :ncharacter_set (String)

    The value to assign to the #ncharacter_set property

  • :pdb_name (String)

    The value to assign to the #pdb_name property

  • :time_created (DateTime)

    The value to assign to the #time_created property



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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
161
162
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/oci/database/models/database.rb', line 90

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}

  if attributes[:'characterSet']
    self.character_set = attributes[:'characterSet']
  end

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

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

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

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

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

  if attributes[:'dbBackupConfig']
    self.db_backup_config = attributes[:'dbBackupConfig']
  end

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

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

  if attributes[:'dbHomeId']
    self.db_home_id = attributes[:'dbHomeId']
  end

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

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

  if attributes[:'dbName']
    self.db_name = attributes[:'dbName']
  end

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

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

  if attributes[:'dbUniqueName']
    self.db_unique_name = attributes[:'dbUniqueName']
  end

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

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

  if attributes[:'dbWorkload']
    self.db_workload = attributes[:'dbWorkload']
  end

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

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

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

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

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

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

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

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

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

  if attributes[:'ncharacterSet']
    self.ncharacter_set = attributes[:'ncharacterSet']
  end

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

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

  if attributes[:'pdbName']
    self.pdb_name = attributes[:'pdbName']
  end

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

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

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

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

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

end

Instance Attribute Details

#character_setString

The character set for the database.

Returns:

  • (String)


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

def character_set
  @character_set
end

#compartment_idString

[Required] The OCID of the compartment.

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#db_backup_configOCI::Database::Models::DbBackupConfig



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

def db_backup_config
  @db_backup_config
end

#db_home_idString

The OCID of the database home.

Returns:

  • (String)


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

def db_home_id
  @db_home_id
end

#db_nameString

[Required] The database name.

Returns:

  • (String)


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

def db_name
  @db_name
end

#db_unique_nameString

[Required] A system-generated name for the database to ensure uniqueness within an Oracle Data Guard group (a primary database and its standby databases). The unique name cannot be changed.

Returns:

  • (String)


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

def db_unique_name
  @db_unique_name
end

#db_workloadString

Database workload type.

Returns:

  • (String)


48
49
50
# File 'lib/oci/database/models/database.rb', line 48

def db_workload
  @db_workload
end

#idString

[Required] The OCID of the database.

Returns:

  • (String)


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

def id
  @id
end

#lifecycle_detailsString

Additional information about the current lifecycleState.

Returns:

  • (String)


56
57
58
# File 'lib/oci/database/models/database.rb', line 56

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The current state of the database.

Returns:

  • (String)


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

def lifecycle_state
  @lifecycle_state
end

#ncharacter_setString

The national character set for the database.

Returns:

  • (String)


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

def ncharacter_set
  @ncharacter_set
end

#pdb_nameString

Pluggable database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name.

Returns:

  • (String)


68
69
70
# File 'lib/oci/database/models/database.rb', line 68

def pdb_name
  @pdb_name
end

#time_createdDateTime

The date and time the database was created.

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

Instance Method Details

#==(other_object) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other_object (Object)

    to be compared



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/database/models/database.rb', line 234

def ==(other_object)
  return true if self.equal?(other_object)
  self.class == other_object.class &&
      character_set == other_object.character_set &&
      compartment_id == other_object.compartment_id &&
      db_backup_config == other_object.db_backup_config &&
      db_home_id == other_object.db_home_id &&
      db_name == other_object.db_name &&
      db_unique_name == other_object.db_unique_name &&
      db_workload == other_object.db_workload &&
      id == other_object.id &&
      lifecycle_details == other_object.lifecycle_details &&
      lifecycle_state == other_object.lifecycle_state &&
      ncharacter_set == other_object.ncharacter_set &&
      pdb_name == other_object.pdb_name &&
      time_created == other_object.time_created
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



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/oci/database/models/database.rb', line 267

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)
        self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.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_object) ⇒ Boolean

Parameters:

  • other_object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


254
255
256
# File 'lib/oci/database/models/database.rb', line 254

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



260
261
262
# File 'lib/oci/database/models/database.rb', line 260

def hash
  [character_set, compartment_id, db_backup_config, db_home_id, db_name, db_unique_name, db_workload, id, lifecycle_details, lifecycle_state, ncharacter_set, pdb_name, time_created].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



292
293
294
295
296
297
298
299
300
# File 'lib/oci/database/models/database.rb', line 292

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



286
287
288
# File 'lib/oci/database/models/database.rb', line 286

def to_s
  to_hash.to_s
end