Class: OCI::Dif::Models::AdbDetail

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

Overview

Details to create an Oracle Autonomous Database.

Constant Summary collapse

DB_WORKLOAD_ENUM =
[
  DB_WORKLOAD_OLTP = 'OLTP'.freeze,
  DB_WORKLOAD_DW = 'DW'.freeze,
  DB_WORKLOAD_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AdbDetail

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :instance_id (String)

    The value to assign to the #instance_id property

  • :db_workload (String)

    The value to assign to the #db_workload property

  • :ecpu (Integer)

    The value to assign to the #ecpu property

  • :data_storage_size_in_tbs (Integer)

    The value to assign to the #data_storage_size_in_tbs property

  • :admin_password_id (String)

    The value to assign to the #admin_password_id property

  • :is_mtls_connection_required (BOOLEAN)

    The value to assign to the #is_mtls_connection_required property

  • :subnet_id (String)

    The value to assign to the #subnet_id property

  • :db_version (String)

    The value to assign to the #db_version property

  • :tools_public_access (String)

    The value to assign to the #tools_public_access property

  • :is_public (BOOLEAN)

    The value to assign to the #is_public property



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
# File 'lib/oci/dif/models/adb_detail.rb', line 110

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

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

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

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

  self.data_storage_size_in_tbs = attributes[:'dataStorageSizeInTBs'] if attributes[:'dataStorageSizeInTBs']

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

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

  self.admin_password_id = attributes[:'adminPasswordId'] if attributes[:'adminPasswordId']

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

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

  self.is_mtls_connection_required = attributes[:'isMtlsConnectionRequired'] unless attributes[:'isMtlsConnectionRequired'].nil?

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

  self.is_mtls_connection_required = attributes[:'is_mtls_connection_required'] unless attributes[:'is_mtls_connection_required'].nil?

  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']

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

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

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

  self.is_public = attributes[:'isPublic'] unless attributes[:'isPublic'].nil?

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

  self.is_public = attributes[:'is_public'] unless attributes[:'is_public'].nil?
end

Instance Attribute Details

#admin_password_idString

[Required] The OCI vault secret [/Content/General/Concepts/identifiers.htm]OCID for admin password.

Returns:

  • (String)


36
37
38
# File 'lib/oci/dif/models/adb_detail.rb', line 36

def admin_password_id
  @admin_password_id
end

#data_storage_size_in_tbsInteger

[Required] The size, in terabytes, of the data volume that will be created and attached to the database.

Returns:

  • (Integer)


32
33
34
# File 'lib/oci/dif/models/adb_detail.rb', line 32

def data_storage_size_in_tbs
  @data_storage_size_in_tbs
end

#db_versionString

[Required] A valid Oracle Database version for Autonomous Database.

Returns:

  • (String)


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

def db_version
  @db_version
end

#db_workloadString

[Required] DB Workload to be used with ADB. Accepted values are OLTP, DW.

Returns:

  • (String)


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

def db_workload
  @db_workload
end

#ecpuInteger

[Required] The compute amount (ECPUs) available to the database.

Returns:

  • (Integer)


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

def ecpu
  @ecpu
end

#instance_idString

[Required] Id for the adw instance.

Returns:

  • (String)


20
21
22
# File 'lib/oci/dif/models/adb_detail.rb', line 20

def instance_id
  @instance_id
end

#is_mtls_connection_requiredBOOLEAN

Specifies if the Autonomous Database requires mTLS connections.

Returns:

  • (BOOLEAN)


40
41
42
# File 'lib/oci/dif/models/adb_detail.rb', line 40

def is_mtls_connection_required
  @is_mtls_connection_required
end

#is_publicBOOLEAN

If true then subnetId should not be provided.

Returns:

  • (BOOLEAN)


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

def is_public
  @is_public
end

#subnet_idString

The OCID of the subnet the Autonomous Database is associated with.

Returns:

  • (String)


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

def subnet_id
  @subnet_id
end

#tools_public_accessString

This is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Allowed only when subnetId is provided (private ADB).

Returns:

  • (String)


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

def tools_public_access
  @tools_public_access
end

Class Method Details

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/dif/models/adb_detail.rb', line 59

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'instance_id': :'instanceId',
    'db_workload': :'dbWorkload',
    'ecpu': :'ecpu',
    'data_storage_size_in_tbs': :'dataStorageSizeInTBs',
    'admin_password_id': :'adminPasswordId',
    'is_mtls_connection_required': :'isMtlsConnectionRequired',
    'subnet_id': :'subnetId',
    'db_version': :'dbVersion',
    'tools_public_access': :'toolsPublicAccess',
    'is_public': :'isPublic'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/oci/dif/models/adb_detail.rb', line 77

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'instance_id': :'String',
    'db_workload': :'String',
    'ecpu': :'Integer',
    'data_storage_size_in_tbs': :'Integer',
    'admin_password_id': :'String',
    'is_mtls_connection_required': :'BOOLEAN',
    'subnet_id': :'String',
    'db_version': :'String',
    'tools_public_access': :'String',
    'is_public': :'BOOLEAN'
    # 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



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/oci/dif/models/adb_detail.rb', line 193

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    instance_id == other.instance_id &&
    db_workload == other.db_workload &&
    ecpu == other.ecpu &&
    data_storage_size_in_tbs == other.data_storage_size_in_tbs &&
    admin_password_id == other.admin_password_id &&
    is_mtls_connection_required == other.is_mtls_connection_required &&
    subnet_id == other.subnet_id &&
    db_version == other.db_version &&
    tools_public_access == other.tools_public_access &&
    is_public == other.is_public
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



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/oci/dif/models/adb_detail.rb', line 232

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


212
213
214
# File 'lib/oci/dif/models/adb_detail.rb', line 212

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



221
222
223
# File 'lib/oci/dif/models/adb_detail.rb', line 221

def hash
  [instance_id, db_workload, ecpu, data_storage_size_in_tbs, admin_password_id, is_mtls_connection_required, subnet_id, db_version, tools_public_access, is_public].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



265
266
267
268
269
270
271
272
273
274
# File 'lib/oci/dif/models/adb_detail.rb', line 265

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



259
260
261
# File 'lib/oci/dif/models/adb_detail.rb', line 259

def to_s
  to_hash.to_s
end