Class: OCI::Mysql::Models::MaintenanceEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/mysql/models/maintenance_event.rb

Overview

The details of a maintenance event.

Constant Summary collapse

MAINTENANCE_SCOPE_ENUM =
[
  MAINTENANCE_SCOPE_ALL = 'ALL'.freeze,
  MAINTENANCE_SCOPE_ALL_BUT_PRIMARY = 'ALL_BUT_PRIMARY'.freeze,
  MAINTENANCE_SCOPE_PRIMARY_ONLY = 'PRIMARY_ONLY'.freeze,
  MAINTENANCE_SCOPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MAINTENANCE_TYPE_ENUM =
[
  MAINTENANCE_TYPE_AUTOMATIC = 'AUTOMATIC'.freeze,
  MAINTENANCE_TYPE_MANUAL = 'MANUAL'.freeze,
  MAINTENANCE_TYPE_SHAPE = 'SHAPE'.freeze,
  MAINTENANCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MAINTENANCE_ACTION_ENUM =
[
  MAINTENANCE_ACTION_DATABASE = 'DATABASE'.freeze,
  MAINTENANCE_ACTION_OS_UPDATE = 'OS_UPDATE'.freeze,
  MAINTENANCE_ACTION_ONLINE_UPDATE = 'ONLINE_UPDATE'.freeze,
  MAINTENANCE_ACTION_HARDWARE = 'HARDWARE'.freeze,
  MAINTENANCE_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MAINTENANCE_STATUS_ENUM =
[
  MAINTENANCE_STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  MAINTENANCE_STATUS_FAILED = 'FAILED'.freeze,
  MAINTENANCE_STATUS_CANCELED = 'CANCELED'.freeze,
  MAINTENANCE_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MaintenanceEvent

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/oci/mysql/models/maintenance_event.rb', line 189

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_system_id = attributes[:'dbSystemId'] if attributes[:'dbSystemId']

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.maintenance_notes = attributes[:'maintenanceNotes'] if attributes[:'maintenanceNotes']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']

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

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

  self.time_ended = attributes[:'timeEnded'] if attributes[:'timeEnded']

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

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

  self.time_mysql_switch_over_started = attributes[:'timeMysqlSwitchOverStarted'] if attributes[:'timeMysqlSwitchOverStarted']

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

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

  self.time_mysql_switch_over_ended = attributes[:'timeMysqlSwitchOverEnded'] if attributes[:'timeMysqlSwitchOverEnded']

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

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

  self.mysql_version_before_maintenance = attributes[:'mysqlVersionBeforeMaintenance'] if attributes[:'mysqlVersionBeforeMaintenance']

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

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

  self.mysql_version_after_maintenance = attributes[:'mysqlVersionAfterMaintenance'] if attributes[:'mysqlVersionAfterMaintenance']

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

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

  self.maintenance_scope = attributes[:'maintenanceScope'] if attributes[:'maintenanceScope']
  self.maintenance_scope = "ALL" if maintenance_scope.nil? && !attributes.key?(:'maintenanceScope') # rubocop:disable Style/StringLiterals

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

  self.maintenance_scope = attributes[:'maintenance_scope'] if attributes[:'maintenance_scope']
  self.maintenance_scope = "ALL" if maintenance_scope.nil? && !attributes.key?(:'maintenanceScope') && !attributes.key?(:'maintenance_scope') # rubocop:disable Style/StringLiterals

  self.maintenance_type = attributes[:'maintenanceType'] if attributes[:'maintenanceType']

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

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

  self.maintenance_action = attributes[:'maintenanceAction'] if attributes[:'maintenanceAction']

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

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

  self.maintenance_status = attributes[:'maintenanceStatus'] if attributes[:'maintenanceStatus']

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

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

Instance Attribute Details

#compartment_idString

[Required] The OCID of the compartment the maintenance event belongs to.

Returns:

  • (String)


48
49
50
# File 'lib/oci/mysql/models/maintenance_event.rb', line 48

def compartment_id
  @compartment_id
end

#db_system_idString

[Required] The OCID of the DB System this maintenance event is associated with.

Returns:

  • (String)


44
45
46
# File 'lib/oci/mysql/models/maintenance_event.rb', line 44

def db_system_id
  @db_system_id
end

#maintenance_actionString

[Required] The nature of the maintenance event.

DATABASE: maintenance event causing a MySQL version upgrade. This may also include OS updates. OS_UPDATE: maintenance event causing an OS update. ONLINE_UPDATE: maintenance event causing downtime-free OS security patches. HARDWARE: hardware maintenance event affecting the DB System's VMs and BMs.

Returns:

  • (String)


118
119
120
# File 'lib/oci/mysql/models/maintenance_event.rb', line 118

def maintenance_action
  @maintenance_action
end

#maintenance_notesString

Information regarding what was performed during that maintenance.

Returns:

  • (String)


52
53
54
# File 'lib/oci/mysql/models/maintenance_event.rb', line 52

def maintenance_notes
  @maintenance_notes
end

#maintenance_scopeString

The MySQL instances operated during a maintenance event.

ALL: maintenance event targeting all MySQL instances in a DB System. ALL_BUT_PRIMARY: maintenance event targeting all MySQL instances in a highly available DB System except the primary group member. PRIMARY_ONLY: maintenance event targeting only the primary group member in a highly available DB System.

Returns:

  • (String)


99
100
101
# File 'lib/oci/mysql/models/maintenance_event.rb', line 99

def maintenance_scope
  @maintenance_scope
end

#maintenance_statusString

[Required] The last status of the maintenance event.

Returns:

  • (String)


123
124
125
# File 'lib/oci/mysql/models/maintenance_event.rb', line 123

def maintenance_status
  @maintenance_status
end

#maintenance_typeString

[Required] How the maintenance event was triggered.

AUTOMATIC: maintenance event triggered as part of scheduled maintenance. MANUAL: maintenance event triggered manually. SHAPE: maintenance event triggered by a shape update.

Returns:

  • (String)


108
109
110
# File 'lib/oci/mysql/models/maintenance_event.rb', line 108

def maintenance_type
  @maintenance_type
end

#mysql_version_after_maintenanceString

[Required] The MySQL version after the maintenance.

Returns:

  • (String)


90
91
92
# File 'lib/oci/mysql/models/maintenance_event.rb', line 90

def mysql_version_after_maintenance
  @mysql_version_after_maintenance
end

#mysql_version_before_maintenanceString

[Required] The MySQL version prior to the maintenance.

Returns:

  • (String)


86
87
88
# File 'lib/oci/mysql/models/maintenance_event.rb', line 86

def mysql_version_before_maintenance
  @mysql_version_before_maintenance
end

#time_createdDateTime

[Required] The date and time the record was created, as described by RFC 3339.

Returns:

  • (DateTime)


58
59
60
# File 'lib/oci/mysql/models/maintenance_event.rb', line 58

def time_created
  @time_created
end

#time_endedDateTime

The date and time the maintenance event ended, as described by RFC 3339.

Returns:

  • (DateTime)


70
71
72
# File 'lib/oci/mysql/models/maintenance_event.rb', line 70

def time_ended
  @time_ended
end

#time_mysql_switch_over_endedDateTime

The date and time the DB System came back online during the maintenance, as described by RFC 3339.

Returns:

  • (DateTime)


82
83
84
# File 'lib/oci/mysql/models/maintenance_event.rb', line 82

def time_mysql_switch_over_ended
  @time_mysql_switch_over_ended
end

#time_mysql_switch_over_startedDateTime

The date and time the DB System was initially down during the maintenance, as described by RFC 3339.

Returns:

  • (DateTime)


76
77
78
# File 'lib/oci/mysql/models/maintenance_event.rb', line 76

def time_mysql_switch_over_started
  @time_mysql_switch_over_started
end

#time_startedDateTime

The date and time the maintenance event started, as described by RFC 3339.

Returns:

  • (DateTime)


64
65
66
# File 'lib/oci/mysql/models/maintenance_event.rb', line 64

def time_started
  @time_started
end

Class Method Details

.attribute_mapObject

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



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/mysql/models/maintenance_event.rb', line 126

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'db_system_id': :'dbSystemId',
    'compartment_id': :'compartmentId',
    'maintenance_notes': :'maintenanceNotes',
    'time_created': :'timeCreated',
    'time_started': :'timeStarted',
    'time_ended': :'timeEnded',
    'time_mysql_switch_over_started': :'timeMysqlSwitchOverStarted',
    'time_mysql_switch_over_ended': :'timeMysqlSwitchOverEnded',
    'mysql_version_before_maintenance': :'mysqlVersionBeforeMaintenance',
    'mysql_version_after_maintenance': :'mysqlVersionAfterMaintenance',
    'maintenance_scope': :'maintenanceScope',
    'maintenance_type': :'maintenanceType',
    'maintenance_action': :'maintenanceAction',
    'maintenance_status': :'maintenanceStatus'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/mysql/models/maintenance_event.rb', line 148

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'db_system_id': :'String',
    'compartment_id': :'String',
    'maintenance_notes': :'String',
    'time_created': :'DateTime',
    'time_started': :'DateTime',
    'time_ended': :'DateTime',
    'time_mysql_switch_over_started': :'DateTime',
    'time_mysql_switch_over_ended': :'DateTime',
    'mysql_version_before_maintenance': :'String',
    'mysql_version_after_maintenance': :'String',
    'maintenance_scope': :'String',
    'maintenance_type': :'String',
    'maintenance_action': :'String',
    'maintenance_status': :'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



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/oci/mysql/models/maintenance_event.rb', line 341

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

  self.class == other.class &&
    db_system_id == other.db_system_id &&
    compartment_id == other.compartment_id &&
    maintenance_notes == other.maintenance_notes &&
    time_created == other.time_created &&
    time_started == other.time_started &&
    time_ended == other.time_ended &&
    time_mysql_switch_over_started == other.time_mysql_switch_over_started &&
    time_mysql_switch_over_ended == other.time_mysql_switch_over_ended &&
    mysql_version_before_maintenance == other.mysql_version_before_maintenance &&
    mysql_version_after_maintenance == other.mysql_version_after_maintenance &&
    maintenance_scope == other.maintenance_scope &&
    maintenance_type == other.maintenance_type &&
    maintenance_action == other.maintenance_action &&
    maintenance_status == other.maintenance_status
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



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/oci/mysql/models/maintenance_event.rb', line 384

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


364
365
366
# File 'lib/oci/mysql/models/maintenance_event.rb', line 364

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



373
374
375
# File 'lib/oci/mysql/models/maintenance_event.rb', line 373

def hash
  [db_system_id, compartment_id, maintenance_notes, time_created, time_started, time_ended, time_mysql_switch_over_started, time_mysql_switch_over_ended, mysql_version_before_maintenance, mysql_version_after_maintenance, maintenance_scope, maintenance_type, maintenance_action, maintenance_status].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



417
418
419
420
421
422
423
424
425
426
# File 'lib/oci/mysql/models/maintenance_event.rb', line 417

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



411
412
413
# File 'lib/oci/mysql/models/maintenance_event.rb', line 411

def to_s
  to_hash.to_s
end