Class: OCI::Database::Models::Database
- Inherits:
-
Object
- Object
- OCI::Database::Models::Database
- Defined in:
- lib/oci/database/models/database.rb
Overview
Database model.
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze, LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze, LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze, LIFECYCLE_STATE_BACKUP_IN_PROGRESS = 'BACKUP_IN_PROGRESS'.freeze, LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze, LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze, LIFECYCLE_STATE_RESTORE_FAILED = 'RESTORE_FAILED'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#character_set ⇒ String
The character set for the database.
-
#compartment_id ⇒ String
[Required] The OCID of the compartment.
-
#connection_strings ⇒ OCI::Database::Models::DatabaseConnectionStrings
The Connection strings used to connect to the Oracle Database.
- #db_backup_config ⇒ OCI::Database::Models::DbBackupConfig
-
#db_home_id ⇒ String
The OCID of the Database Home.
-
#db_name ⇒ String
[Required] The database name.
-
#db_system_id ⇒ String
The OCID of the DB system.
-
#db_unique_name ⇒ String
[Required] A system-generated name for the database to ensure uniqueness within an Oracle Data Guard group (a primary database and its standby databases).
-
#db_workload ⇒ String
The database workload type.
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource.
-
#freeform_tags ⇒ Hash<String, String>
Free-form tags for this resource.
-
#id ⇒ String
[Required] The OCID of the database.
-
#last_backup_timestamp ⇒ DateTime
The date and time when the latest database backup was created.
-
#lifecycle_details ⇒ String
Additional information about the current lifecycleState.
-
#lifecycle_state ⇒ String
[Required] The current state of the database.
-
#ncharacter_set ⇒ String
The national character set for the database.
-
#pdb_name ⇒ String
The name of the pluggable database.
-
#time_created ⇒ DateTime
The date and time the database was created.
-
#vm_cluster_id ⇒ String
The OCID of the VM cluster.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Database
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ Database
Initializes the object
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 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 |
# File 'lib/oci/database/models/database.rb', line 184 def initialize(attributes = {}) return unless attributes.is_a?(Hash) self.id = attributes[:'id'] if attributes[:'id'] 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.character_set = attributes[:'characterSet'] if attributes[:'characterSet'] raise 'You cannot provide both :characterSet and :character_set' if attributes.key?(:'characterSet') && attributes.key?(:'character_set') self.character_set = attributes[:'character_set'] if attributes[:'character_set'] self.ncharacter_set = attributes[:'ncharacterSet'] if attributes[:'ncharacterSet'] raise 'You cannot provide both :ncharacterSet and :ncharacter_set' if attributes.key?(:'ncharacterSet') && attributes.key?(:'ncharacter_set') self.ncharacter_set = attributes[:'ncharacter_set'] if attributes[:'ncharacter_set'] self.db_home_id = attributes[:'dbHomeId'] if attributes[:'dbHomeId'] raise 'You cannot provide both :dbHomeId and :db_home_id' if attributes.key?(:'dbHomeId') && attributes.key?(:'db_home_id') self.db_home_id = attributes[:'db_home_id'] if attributes[:'db_home_id'] self.db_system_id = attributes[:'dbSystemId'] if attributes[:'dbSystemId'] raise 'You cannot provide both :dbSystemId and :db_system_id' if attributes.key?(:'dbSystemId') && attributes.key?(:'db_system_id') self.db_system_id = attributes[:'db_system_id'] if attributes[:'db_system_id'] self.vm_cluster_id = attributes[:'vmClusterId'] if attributes[:'vmClusterId'] raise 'You cannot provide both :vmClusterId and :vm_cluster_id' if attributes.key?(:'vmClusterId') && attributes.key?(:'vm_cluster_id') self.vm_cluster_id = attributes[:'vm_cluster_id'] if attributes[:'vm_cluster_id'] self.db_name = attributes[:'dbName'] if attributes[:'dbName'] raise 'You cannot provide both :dbName and :db_name' if attributes.key?(:'dbName') && attributes.key?(:'db_name') self.db_name = attributes[:'db_name'] if attributes[:'db_name'] self.pdb_name = attributes[:'pdbName'] if attributes[:'pdbName'] raise 'You cannot provide both :pdbName and :pdb_name' if attributes.key?(:'pdbName') && attributes.key?(:'pdb_name') self.pdb_name = attributes[:'pdb_name'] if attributes[:'pdb_name'] self.db_workload = attributes[:'dbWorkload'] if attributes[:'dbWorkload'] raise 'You cannot provide both :dbWorkload and :db_workload' if attributes.key?(:'dbWorkload') && attributes.key?(:'db_workload') self.db_workload = attributes[:'db_workload'] if attributes[:'db_workload'] self.db_unique_name = attributes[:'dbUniqueName'] if attributes[:'dbUniqueName'] raise 'You cannot provide both :dbUniqueName and :db_unique_name' if attributes.key?(:'dbUniqueName') && attributes.key?(:'db_unique_name') self.db_unique_name = attributes[:'db_unique_name'] if attributes[:'db_unique_name'] 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.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.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. = attributes[:'lastBackupTimestamp'] if attributes[:'lastBackupTimestamp'] raise 'You cannot provide both :lastBackupTimestamp and :last_backup_timestamp' if attributes.key?(:'lastBackupTimestamp') && attributes.key?(:'last_backup_timestamp') self. = attributes[:'last_backup_timestamp'] if attributes[:'last_backup_timestamp'] self.db_backup_config = attributes[:'dbBackupConfig'] if attributes[:'dbBackupConfig'] raise 'You cannot provide both :dbBackupConfig and :db_backup_config' if attributes.key?(:'dbBackupConfig') && attributes.key?(:'db_backup_config') self.db_backup_config = attributes[:'db_backup_config'] if attributes[:'db_backup_config'] self. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] self.connection_strings = attributes[:'connectionStrings'] if attributes[:'connectionStrings'] raise 'You cannot provide both :connectionStrings and :connection_strings' if attributes.key?(:'connectionStrings') && attributes.key?(:'connection_strings') self.connection_strings = attributes[:'connection_strings'] if attributes[:'connection_strings'] end |
Instance Attribute Details
#character_set ⇒ String
The character set for the database.
33 34 35 |
# File 'lib/oci/database/models/database.rb', line 33 def character_set @character_set end |
#compartment_id ⇒ String
[Required] The OCID of the compartment.
29 30 31 |
# File 'lib/oci/database/models/database.rb', line 29 def compartment_id @compartment_id end |
#connection_strings ⇒ OCI::Database::Models::DatabaseConnectionStrings
The Connection strings used to connect to the Oracle Database.
103 104 105 |
# File 'lib/oci/database/models/database.rb', line 103 def connection_strings @connection_strings end |
#db_backup_config ⇒ OCI::Database::Models::DbBackupConfig
85 86 87 |
# File 'lib/oci/database/models/database.rb', line 85 def db_backup_config @db_backup_config end |
#db_home_id ⇒ String
The OCID of the Database Home.
41 42 43 |
# File 'lib/oci/database/models/database.rb', line 41 def db_home_id @db_home_id end |
#db_name ⇒ String
[Required] The database name.
53 54 55 |
# File 'lib/oci/database/models/database.rb', line 53 def db_name @db_name end |
#db_system_id ⇒ String
The OCID of the DB system.
45 46 47 |
# File 'lib/oci/database/models/database.rb', line 45 def db_system_id @db_system_id end |
#db_unique_name ⇒ String
[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.
66 67 68 |
# File 'lib/oci/database/models/database.rb', line 66 def db_unique_name @db_unique_name end |
#db_workload ⇒ String
The database workload type.
61 62 63 |
# File 'lib/oci/database/models/database.rb', line 61 def db_workload @db_workload end |
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
99 100 101 |
# File 'lib/oci/database/models/database.rb', line 99 def @defined_tags end |
#freeform_tags ⇒ Hash<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\"}
93 94 95 |
# File 'lib/oci/database/models/database.rb', line 93 def @freeform_tags end |
#id ⇒ String
[Required] The OCID of the database.
25 26 27 |
# File 'lib/oci/database/models/database.rb', line 25 def id @id end |
#last_backup_timestamp ⇒ DateTime
The date and time when the latest database backup was created.
82 83 84 |
# File 'lib/oci/database/models/database.rb', line 82 def @last_backup_timestamp end |
#lifecycle_details ⇒ String
Additional information about the current lifecycleState.
70 71 72 |
# File 'lib/oci/database/models/database.rb', line 70 def lifecycle_details @lifecycle_details end |
#lifecycle_state ⇒ String
[Required] The current state of the database.
74 75 76 |
# File 'lib/oci/database/models/database.rb', line 74 def lifecycle_state @lifecycle_state end |
#ncharacter_set ⇒ String
The national character set for the database.
37 38 39 |
# File 'lib/oci/database/models/database.rb', line 37 def ncharacter_set @ncharacter_set end |
#pdb_name ⇒ String
The name of the pluggable database. The name 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.
57 58 59 |
# File 'lib/oci/database/models/database.rb', line 57 def pdb_name @pdb_name end |
#time_created ⇒ DateTime
The date and time the database was created.
78 79 80 |
# File 'lib/oci/database/models/database.rb', line 78 def time_created @time_created end |
#vm_cluster_id ⇒ String
The OCID of the VM cluster.
49 50 51 |
# File 'lib/oci/database/models/database.rb', line 49 def vm_cluster_id @vm_cluster_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/oci/database/models/database.rb', line 106 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'compartment_id': :'compartmentId', 'character_set': :'characterSet', 'ncharacter_set': :'ncharacterSet', 'db_home_id': :'dbHomeId', 'db_system_id': :'dbSystemId', 'vm_cluster_id': :'vmClusterId', 'db_name': :'dbName', 'pdb_name': :'pdbName', 'db_workload': :'dbWorkload', 'db_unique_name': :'dbUniqueName', 'lifecycle_details': :'lifecycleDetails', 'lifecycle_state': :'lifecycleState', 'time_created': :'timeCreated', 'last_backup_timestamp': :'lastBackupTimestamp', 'db_backup_config': :'dbBackupConfig', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'connection_strings': :'connectionStrings' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/oci/database/models/database.rb', line 133 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'compartment_id': :'String', 'character_set': :'String', 'ncharacter_set': :'String', 'db_home_id': :'String', 'db_system_id': :'String', 'vm_cluster_id': :'String', 'db_name': :'String', 'pdb_name': :'String', 'db_workload': :'String', 'db_unique_name': :'String', 'lifecycle_details': :'String', 'lifecycle_state': :'String', 'time_created': :'DateTime', 'last_backup_timestamp': :'DateTime', 'db_backup_config': :'OCI::Database::Models::DbBackupConfig', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'connection_strings': :'OCI::Database::Models::DatabaseConnectionStrings' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/oci/database/models/database.rb', line 318 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && compartment_id == other.compartment_id && character_set == other.character_set && ncharacter_set == other.ncharacter_set && db_home_id == other.db_home_id && db_system_id == other.db_system_id && vm_cluster_id == other.vm_cluster_id && db_name == other.db_name && pdb_name == other.pdb_name && db_workload == other.db_workload && db_unique_name == other.db_unique_name && lifecycle_details == other.lifecycle_details && lifecycle_state == other.lifecycle_state && time_created == other.time_created && == other. && db_backup_config == other.db_backup_config && == other. && == other. && connection_strings == other.connection_strings end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/oci/database/models/database.rb', line 366 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
346 347 348 |
# File 'lib/oci/database/models/database.rb', line 346 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
355 356 357 |
# File 'lib/oci/database/models/database.rb', line 355 def hash [id, compartment_id, character_set, ncharacter_set, db_home_id, db_system_id, vm_cluster_id, db_name, pdb_name, db_workload, db_unique_name, lifecycle_details, lifecycle_state, time_created, , db_backup_config, , , connection_strings].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
399 400 401 402 403 404 405 406 407 408 |
# File 'lib/oci/database/models/database.rb', line 399 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_s ⇒ String
Returns the string representation of the object
393 394 395 |
# File 'lib/oci/database/models/database.rb', line 393 def to_s to_hash.to_s end |