Class: OCI::Database::Models::CreateDatabaseBase
- Inherits:
-
Object
- Object
- OCI::Database::Models::CreateDatabaseBase
- Defined in:
- lib/oci/database/models/create_database_base.rb
Overview
Details for creating a database.
Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API.
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
Direct Known Subclasses
CreateDatabaseFromBackup, CreateNewDatabaseDetails, CreateStandByDatabaseDetails
Constant Summary collapse
- SOURCE_ENUM =
[ SOURCE_NONE = 'NONE'.freeze, SOURCE_DB_BACKUP = 'DB_BACKUP'.freeze, SOURCE_DATAGUARD = 'DATAGUARD'.freeze ].freeze
Instance Attribute Summary collapse
-
#db_home_id ⇒ String
The OCID of the Database Home.
-
#db_version ⇒ String
A valid Oracle Database version.
-
#kms_key_id ⇒ String
The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
-
#kms_key_version_id ⇒ String
The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions.
-
#source ⇒ String
[Required] The source of the database: Use
NONE
for creating a new database.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.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.
-
.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 = {}) ⇒ CreateDatabaseBase
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 = {}) ⇒ CreateDatabaseBase
Initializes the object
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 |
# File 'lib/oci/database/models/create_database_base.rb', line 104 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.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_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.source = attributes[:'source'] if attributes[:'source'] self.source = "NONE" if source.nil? && !attributes.key?(:'source') # rubocop:disable Style/StringLiterals self.kms_key_id = attributes[:'kmsKeyId'] if attributes[:'kmsKeyId'] raise 'You cannot provide both :kmsKeyId and :kms_key_id' if attributes.key?(:'kmsKeyId') && attributes.key?(:'kms_key_id') self.kms_key_id = attributes[:'kms_key_id'] if attributes[:'kms_key_id'] self.kms_key_version_id = attributes[:'kmsKeyVersionId'] if attributes[:'kmsKeyVersionId'] raise 'You cannot provide both :kmsKeyVersionId and :kms_key_version_id' if attributes.key?(:'kmsKeyVersionId') && attributes.key?(:'kms_key_version_id') self.kms_key_version_id = attributes[:'kms_key_version_id'] if attributes[:'kms_key_version_id'] end |
Instance Attribute Details
#db_home_id ⇒ String
The OCID of the Database Home.
23 24 25 |
# File 'lib/oci/database/models/create_database_base.rb', line 23 def db_home_id @db_home_id end |
#db_version ⇒ String
A valid Oracle Database version. For a list of supported versions, use the ListDbVersions operation.
This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.
30 31 32 |
# File 'lib/oci/database/models/create_database_base.rb', line 30 def db_version @db_version end |
#kms_key_id ⇒ String
The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
43 44 45 |
# File 'lib/oci/database/models/create_database_base.rb', line 43 def kms_key_id @kms_key_id end |
#kms_key_version_id ⇒ String
The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances.
48 49 50 |
# File 'lib/oci/database/models/create_database_base.rb', line 48 def kms_key_version_id @kms_key_version_id end |
#source ⇒ String
[Required] The source of the database: Use NONE
for creating a new database. Use DB_BACKUP
for creating a new database by restoring from a backup. Use DATAGUARD
for creating a new STANDBY database for a Data Guard setup.. The default is NONE
.
39 40 41 |
# File 'lib/oci/database/models/create_database_base.rb', line 39 def source @source end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/oci/database/models/create_database_base.rb', line 51 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'db_home_id': :'dbHomeId', 'db_version': :'dbVersion', 'source': :'source', 'kms_key_id': :'kmsKeyId', 'kms_key_version_id': :'kmsKeyVersionId' # 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.
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/oci/database/models/create_database_base.rb', line 81 def self.get_subtype(object_hash) type = object_hash[:'source'] # rubocop:disable Style/SymbolLiteral return 'OCI::Database::Models::CreateNewDatabaseDetails' if type == 'NONE' return 'OCI::Database::Models::CreateStandByDatabaseDetails' if type == 'DATAGUARD' return 'OCI::Database::Models::CreateDatabaseFromBackup' if type == 'DB_BACKUP' # TODO: Log a warning when the subtype is not found. 'OCI::Database::Models::CreateDatabaseBase' end |
.swagger_types ⇒ Object
Attribute type mapping.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/oci/database/models/create_database_base.rb', line 64 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'db_home_id': :'String', 'db_version': :'String', 'source': :'String', 'kms_key_id': :'String', 'kms_key_version_id': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
153 154 155 156 157 158 159 160 161 162 |
# File 'lib/oci/database/models/create_database_base.rb', line 153 def ==(other) return true if equal?(other) self.class == other.class && db_home_id == other.db_home_id && db_version == other.db_version && source == other.source && kms_key_id == other.kms_key_id && kms_key_version_id == other.kms_key_version_id end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/oci/database/models/create_database_base.rb', line 187 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
167 168 169 |
# File 'lib/oci/database/models/create_database_base.rb', line 167 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
176 177 178 |
# File 'lib/oci/database/models/create_database_base.rb', line 176 def hash [db_home_id, db_version, source, kms_key_id, kms_key_version_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
220 221 222 223 224 225 226 227 228 229 |
# File 'lib/oci/database/models/create_database_base.rb', line 220 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
214 215 216 |
# File 'lib/oci/database/models/create_database_base.rb', line 214 def to_s to_hash.to_s end |