Class: OCI::Database::Models::AutonomousDatabaseStandbySummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/models/autonomous_database_standby_summary.rb

Overview

Autonomous Data Guard standby database details.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
  LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
  LIFECYCLE_STATE_STOPPING = 'STOPPING'.freeze,
  LIFECYCLE_STATE_STOPPED = 'STOPPED'.freeze,
  LIFECYCLE_STATE_STARTING = 'STARTING'.freeze,
  LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze,
  LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze,
  LIFECYCLE_STATE_UNAVAILABLE = 'UNAVAILABLE'.freeze,
  LIFECYCLE_STATE_RESTORE_IN_PROGRESS = 'RESTORE_IN_PROGRESS'.freeze,
  LIFECYCLE_STATE_RESTORE_FAILED = 'RESTORE_FAILED'.freeze,
  LIFECYCLE_STATE_BACKUP_IN_PROGRESS = 'BACKUP_IN_PROGRESS'.freeze,
  LIFECYCLE_STATE_SCALE_IN_PROGRESS = 'SCALE_IN_PROGRESS'.freeze,
  LIFECYCLE_STATE_AVAILABLE_NEEDS_ATTENTION = 'AVAILABLE_NEEDS_ATTENTION'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_MAINTENANCE_IN_PROGRESS = 'MAINTENANCE_IN_PROGRESS'.freeze,
  LIFECYCLE_STATE_RESTARTING = 'RESTARTING'.freeze,
  LIFECYCLE_STATE_RECREATING = 'RECREATING'.freeze,
  LIFECYCLE_STATE_ROLE_CHANGE_IN_PROGRESS = 'ROLE_CHANGE_IN_PROGRESS'.freeze,
  LIFECYCLE_STATE_UPGRADING = 'UPGRADING'.freeze,
  LIFECYCLE_STATE_INACCESSIBLE = 'INACCESSIBLE'.freeze,
  LIFECYCLE_STATE_STANDBY = 'STANDBY'.freeze,
  LIFECYCLE_STATE_TRANSPORTING = 'TRANSPORTING'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AutonomousDatabaseStandbySummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 131

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

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

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

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

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

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

  self.time_disaster_recovery_role_changed = attributes[:'timeDisasterRecoveryRoleChanged'] if attributes[:'timeDisasterRecoveryRoleChanged']

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

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

  self.time_maintenance_begin = attributes[:'timeMaintenanceBegin'] if attributes[:'timeMaintenanceBegin']

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

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

  self.time_maintenance_end = attributes[:'timeMaintenanceEnd'] if attributes[:'timeMaintenanceEnd']

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

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

  self.maintenance_target_component = attributes[:'maintenanceTargetComponent'] if attributes[:'maintenanceTargetComponent']

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

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

  self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain']

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

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

  self.external_location_zone = attributes[:'externalLocationZone'] if attributes[:'externalLocationZone']

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

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

Instance Attribute Details

#availability_domainString

The availability domain of a local Autonomous Data Guard standby database of an Autonomous AI Database Serverless instance.

Returns:

  • (String)


73
74
75
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 73

def availability_domain
  @availability_domain
end

#external_location_zoneString

The external logical zone where the local Autonomous Data Guard is located (Intended for multicloud use).

Returns:

  • (String)


77
78
79
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 77

def external_location_zone
  @external_location_zone
end

#lag_time_in_secondsInteger

The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover.

Returns:

  • (Integer)


41
42
43
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 41

def lag_time_in_seconds
  @lag_time_in_seconds
end

#lifecycle_detailsString

Additional information about the current lifecycle state.

Returns:

  • (String)


49
50
51
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 49

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The current state of the Autonomous AI Database.

Returns:

  • (String)


45
46
47
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 45

def lifecycle_state
  @lifecycle_state
end

#maintenance_target_componentString

The component chosen for maintenance.

Returns:

  • (String)


69
70
71
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 69

def maintenance_target_component
  @maintenance_target_component
end

#time_data_guard_role_changedDateTime

The date and time the Autonomous Data Guard role was switched for the standby Autonomous AI Database.

Returns:

  • (DateTime)


53
54
55
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 53

def time_data_guard_role_changed
  @time_data_guard_role_changed
end

#time_disaster_recovery_role_changedDateTime

The date and time the Disaster Recovery role was switched for the standby Autonomous AI Database.

Returns:

  • (DateTime)


57
58
59
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 57

def time_disaster_recovery_role_changed
  @time_disaster_recovery_role_changed
end

#time_maintenance_beginDateTime

The date and time when maintenance will begin.

Returns:

  • (DateTime)


61
62
63
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 61

def time_maintenance_begin
  @time_maintenance_begin
end

#time_maintenance_endDateTime

The date and time when maintenance will end.

Returns:

  • (DateTime)


65
66
67
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 65

def time_maintenance_end
  @time_maintenance_end
end

Class Method Details

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 80

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'lag_time_in_seconds': :'lagTimeInSeconds',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'time_data_guard_role_changed': :'timeDataGuardRoleChanged',
    'time_disaster_recovery_role_changed': :'timeDisasterRecoveryRoleChanged',
    'time_maintenance_begin': :'timeMaintenanceBegin',
    'time_maintenance_end': :'timeMaintenanceEnd',
    'maintenance_target_component': :'maintenanceTargetComponent',
    'availability_domain': :'availabilityDomain',
    'external_location_zone': :'externalLocationZone'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 98

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'lag_time_in_seconds': :'Integer',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'time_data_guard_role_changed': :'DateTime',
    'time_disaster_recovery_role_changed': :'DateTime',
    'time_maintenance_begin': :'DateTime',
    'time_maintenance_end': :'DateTime',
    'maintenance_target_component': :'String',
    'availability_domain': :'String',
    'external_location_zone': :'String'
    # 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



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 218

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

  self.class == other.class &&
    lag_time_in_seconds == other.lag_time_in_seconds &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    time_data_guard_role_changed == other.time_data_guard_role_changed &&
    time_disaster_recovery_role_changed == other.time_disaster_recovery_role_changed &&
    time_maintenance_begin == other.time_maintenance_begin &&
    time_maintenance_end == other.time_maintenance_end &&
    maintenance_target_component == other.maintenance_target_component &&
    availability_domain == other.availability_domain &&
    external_location_zone == other.external_location_zone
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



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 257

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


237
238
239
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 237

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



246
247
248
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 246

def hash
  [lag_time_in_seconds, lifecycle_state, lifecycle_details, time_data_guard_role_changed, time_disaster_recovery_role_changed, time_maintenance_begin, time_maintenance_end, maintenance_target_component, availability_domain, external_location_zone].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



290
291
292
293
294
295
296
297
298
299
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 290

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



284
285
286
# File 'lib/oci/database/models/autonomous_database_standby_summary.rb', line 284

def to_s
  to_hash.to_s
end