Class: OCI::Mysql::Models::MaintenanceEvent
- Inherits:
-
Object
- Object
- OCI::Mysql::Models::MaintenanceEvent
- 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
-
#compartment_id ⇒ String
[Required] The OCID of the compartment the maintenance event belongs to.
-
#db_system_id ⇒ String
[Required] The OCID of the DB System this maintenance event is associated with.
-
#maintenance_action ⇒ String
[Required] The nature of the maintenance event.
-
#maintenance_notes ⇒ String
Information regarding what was performed during that maintenance.
-
#maintenance_scope ⇒ String
The MySQL instances operated during a maintenance event.
-
#maintenance_status ⇒ String
[Required] The last status of the maintenance event.
-
#maintenance_type ⇒ String
[Required] How the maintenance event was triggered.
-
#mysql_version_after_maintenance ⇒ String
[Required] The MySQL version after the maintenance.
-
#mysql_version_before_maintenance ⇒ String
[Required] The MySQL version prior to the maintenance.
-
#time_created ⇒ DateTime
[Required] The date and time the record was created, as described by RFC 3339.
-
#time_ended ⇒ DateTime
The date and time the maintenance event ended, as described by RFC 3339.
-
#time_mysql_switch_over_ended ⇒ DateTime
The date and time the DB System came back online during the maintenance, as described by RFC 3339.
-
#time_mysql_switch_over_started ⇒ DateTime
The date and time the DB System was initially down during the maintenance, as described by RFC 3339.
-
#time_started ⇒ DateTime
The date and time the maintenance event started, as described by RFC 3339.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.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 = {}) ⇒ MaintenanceEvent
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 = {}) ⇒ MaintenanceEvent
Initializes the object
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_id ⇒ String
[Required] The OCID of the compartment the maintenance event belongs to.
48 49 50 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 48 def compartment_id @compartment_id end |
#db_system_id ⇒ String
[Required] The OCID of the DB System this maintenance event is associated with.
44 45 46 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 44 def db_system_id @db_system_id end |
#maintenance_action ⇒ String
[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.
118 119 120 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 118 def maintenance_action @maintenance_action end |
#maintenance_notes ⇒ String
Information regarding what was performed during that maintenance.
52 53 54 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 52 def maintenance_notes @maintenance_notes end |
#maintenance_scope ⇒ String
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.
99 100 101 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 99 def maintenance_scope @maintenance_scope end |
#maintenance_status ⇒ String
[Required] The last status of the maintenance event.
123 124 125 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 123 def maintenance_status @maintenance_status end |
#maintenance_type ⇒ String
[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.
108 109 110 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 108 def maintenance_type @maintenance_type end |
#mysql_version_after_maintenance ⇒ String
[Required] The MySQL version after the maintenance.
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_maintenance ⇒ String
[Required] The MySQL version prior to the maintenance.
86 87 88 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 86 def mysql_version_before_maintenance @mysql_version_before_maintenance end |
#time_created ⇒ DateTime
[Required] The date and time the record was created, as described by RFC 3339.
58 59 60 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 58 def time_created @time_created end |
#time_ended ⇒ DateTime
The date and time the maintenance event ended, as described by RFC 3339.
70 71 72 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 70 def time_ended @time_ended end |
#time_mysql_switch_over_ended ⇒ DateTime
The date and time the DB System came back online during the maintenance, as described by RFC 3339.
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_started ⇒ DateTime
The date and time the DB System was initially down during the maintenance, as described by RFC 3339.
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_started ⇒ DateTime
The date and time the maintenance event started, as described by RFC 3339.
64 65 66 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 64 def time_started @time_started end |
Class Method Details
.attribute_map ⇒ Object
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_types ⇒ Object
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.
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
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
364 365 366 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 364 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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_hash ⇒ 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_s ⇒ String
Returns the string representation of the object
411 412 413 |
# File 'lib/oci/mysql/models/maintenance_event.rb', line 411 def to_s to_hash.to_s end |