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
Constant Summary collapse
- SOURCE_ENUM =
[ SOURCE_NONE = 'NONE'.freeze, SOURCE_DB_BACKUP = 'DB_BACKUP'.freeze ].freeze
Instance Attribute Summary collapse
-
#db_home_id ⇒ String
[Required] 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
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 |
# File 'lib/oci/database/models/create_database_base.rb', line 101 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
[Required] The OCID of the Database Home.
22 23 24 |
# File 'lib/oci/database/models/create_database_base.rb', line 22 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.
29 30 31 |
# File 'lib/oci/database/models/create_database_base.rb', line 29 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.
41 42 43 |
# File 'lib/oci/database/models/create_database_base.rb', line 41 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.
46 47 48 |
# File 'lib/oci/database/models/create_database_base.rb', line 46 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. The default is NONE
.
37 38 39 |
# File 'lib/oci/database/models/create_database_base.rb', line 37 def source @source end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/oci/database/models/create_database_base.rb', line 49 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.
79 80 81 82 83 84 85 86 87 |
# File 'lib/oci/database/models/create_database_base.rb', line 79 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::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.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/oci/database/models/create_database_base.rb', line 62 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.
150 151 152 153 154 155 156 157 158 159 |
# File 'lib/oci/database/models/create_database_base.rb', line 150 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
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/oci/database/models/create_database_base.rb', line 184 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
164 165 166 |
# File 'lib/oci/database/models/create_database_base.rb', line 164 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
173 174 175 |
# File 'lib/oci/database/models/create_database_base.rb', line 173 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
217 218 219 220 221 222 223 224 225 226 |
# File 'lib/oci/database/models/create_database_base.rb', line 217 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
211 212 213 |
# File 'lib/oci/database/models/create_database_base.rb', line 211 def to_s to_hash.to_s end |