Class: OCI::Recovery::Models::UpdateProtectedDatabaseDetails

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

Overview

Describes the parameters required to update a protected database.

Constant Summary collapse

DATABASE_SIZE_ENUM =
[
  DATABASE_SIZE_XS = 'XS'.freeze,
  DATABASE_SIZE_S = 'S'.freeze,
  DATABASE_SIZE_M = 'M'.freeze,
  DATABASE_SIZE_L = 'L'.freeze,
  DATABASE_SIZE_XL = 'XL'.freeze,
  DATABASE_SIZE_XXL = 'XXL'.freeze,
  DATABASE_SIZE_AUTO = 'AUTO'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateProtectedDatabaseDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 117

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

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

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

  self.database_size = attributes[:'databaseSize'] if attributes[:'databaseSize']

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

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

  self.database_size_in_gbs = attributes[:'databaseSizeInGBs'] if attributes[:'databaseSizeInGBs']

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

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

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

  self.protection_policy_id = attributes[:'protectionPolicyId'] if attributes[:'protectionPolicyId']

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

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

  self.recovery_service_subnets = attributes[:'recoveryServiceSubnets'] if attributes[:'recoveryServiceSubnets']

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

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

  self.is_redo_logs_shipped = attributes[:'isRedoLogsShipped'] unless attributes[:'isRedoLogsShipped'].nil?

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#database_sizeString

The size of the database is allowed to be decreased. XS - Less than 5GB, S - 5GB to 50GB, M - 50GB to 500GB, L - 500GB to 1TB, XL - 1TB to 5TB, XXL - Greater than 5TB.

Returns:

  • (String)


27
28
29
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 27

def database_size
  @database_size
end

#database_size_in_gbsInteger

The size of the database, in gigabytes.

Returns:

  • (Integer)


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

def database_size_in_gbs
  @database_size_in_gbs
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}. For more information, see {Resource Tags}[https://docs.oracle.com/en-us/iaas/Content/General/Concepts/resourcetags.htm]

Returns:

  • (Hash<String, Hash<String, Object>>)


66
67
68
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 66

def defined_tags
  @defined_tags
end

#display_nameString

The protected database name. You can change the displayName. Avoid entering confidential information.

Returns:

  • (String)


23
24
25
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 23

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


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

def freeform_tags
  @freeform_tags
end

#is_redo_logs_shippedBOOLEAN

The value TRUE indicates that the protected database is configured to use Real-time data protection, and redo-data is sent from the protected database to Recovery Service. Real-time data protection substantially reduces the window of potential data loss that exists between successive archived redo log backups. For this to be effective, additional configuration is needed on client side.

Returns:

  • (BOOLEAN)


54
55
56
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 54

def is_redo_logs_shipped
  @is_redo_logs_shipped
end

#passwordString

Password credential which can be used to connect to Protected Database. It must contain at least 2 uppercase, 2 lowercase, 2 numeric and 2 special characters. The special characters must be underscore (_), number sign (#) or hyphen (-). The password must not contain the username "admin", regardless of casing. Password must not be same as current passsword.

Returns:

  • (String)


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

def password
  @password
end

#protection_policy_idString

The OCID of the protection policy associated with the protected database.

Returns:

  • (String)


43
44
45
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 43

def protection_policy_id
  @protection_policy_id
end

#recovery_service_subnetsArray<OCI::Recovery::Models::RecoveryServiceSubnetInput>

List of recovery service subnet resources associated with the protected database.



47
48
49
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 47

def recovery_service_subnets
  @recovery_service_subnets
end

Class Method Details

.attribute_mapObject

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



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 69

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'database_size': :'databaseSize',
    'database_size_in_gbs': :'databaseSizeInGBs',
    'password': :'password',
    'protection_policy_id': :'protectionPolicyId',
    'recovery_service_subnets': :'recoveryServiceSubnets',
    'is_redo_logs_shipped': :'isRedoLogsShipped',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 86

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'database_size': :'String',
    'database_size_in_gbs': :'Integer',
    'password': :'String',
    'protection_policy_id': :'String',
    'recovery_service_subnets': :'Array<OCI::Recovery::Models::RecoveryServiceSubnetInput>',
    'is_redo_logs_shipped': :'BOOLEAN',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 189

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

  self.class == other.class &&
    display_name == other.display_name &&
    database_size == other.database_size &&
    database_size_in_gbs == other.database_size_in_gbs &&
    password == other.password &&
    protection_policy_id == other.protection_policy_id &&
    recovery_service_subnets == other.recovery_service_subnets &&
    is_redo_logs_shipped == other.is_redo_logs_shipped &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 227

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


207
208
209
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 207

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



216
217
218
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 216

def hash
  [display_name, database_size, database_size_in_gbs, password, protection_policy_id, recovery_service_subnets, is_redo_logs_shipped, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/recovery/models/update_protected_database_details.rb', line 260

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



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

def to_s
  to_hash.to_s
end