Class: OCI::Core::Models::InstanceMaintenanceEventSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/core/models/instance_maintenance_event_summary.rb

Overview

It is the event in which the maintenance action will be be performed on the customer instance on the scheduled date and time.

Constant Summary collapse

ALTERNATIVE_RESOLUTION_ACTIONS_ENUM =
[
  ALTERNATIVE_RESOLUTION_ACTIONS_REBOOT_MIGRATION = 'REBOOT_MIGRATION'.freeze,
  ALTERNATIVE_RESOLUTION_ACTIONS_TERMINATE = 'TERMINATE'.freeze,
  ALTERNATIVE_RESOLUTION_ACTIONS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ InstanceMaintenanceEventSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

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

    The value to assign to the #defined_tags property

  • :display_name (String)

    The value to assign to the #display_name property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :id (String)

    The value to assign to the #id property

  • :instance_id (String)

    The value to assign to the #instance_id property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :maintenance_category (String)

    The value to assign to the #maintenance_category property

  • :maintenance_reason (String)

    The value to assign to the #maintenance_reason property

  • :instance_action (String)

    The value to assign to the #instance_action property

  • :alternative_resolution_actions (Array<String>)

    The value to assign to the #alternative_resolution_actions property

  • :time_started (DateTime)

    The value to assign to the #time_started property

  • :time_finished (DateTime)

    The value to assign to the #time_finished property

  • :time_window_start (DateTime)

    The value to assign to the #time_window_start property

  • :start_window_duration (String)

    The value to assign to the #start_window_duration property

  • :estimated_duration (String)

    The value to assign to the #estimated_duration property

  • :time_hard_due_date (DateTime)

    The value to assign to the #time_hard_due_date property

  • :can_reschedule (BOOLEAN)

    The value to assign to the #can_reschedule property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :created_by (String)

    The value to assign to the #created_by property

  • :description (String)

    The value to assign to the #description property

  • :correlation_token (String)

    The value to assign to the #correlation_token property



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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 232

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

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

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

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

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

  self.maintenance_reason = attributes[:'maintenanceReason'] if attributes[:'maintenanceReason']

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

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

  self.instance_action = attributes[:'instanceAction'] if attributes[:'instanceAction']

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

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

  self.alternative_resolution_actions = attributes[:'alternativeResolutionActions'] if attributes[:'alternativeResolutionActions']

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

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

  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_finished = attributes[:'timeFinished'] if attributes[:'timeFinished']

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

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

  self.time_window_start = attributes[:'timeWindowStart'] if attributes[:'timeWindowStart']

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

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

  self.start_window_duration = attributes[:'startWindowDuration'] if attributes[:'startWindowDuration']

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

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

  self.estimated_duration = attributes[:'estimatedDuration'] if attributes[:'estimatedDuration']

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

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

  self.time_hard_due_date = attributes[:'timeHardDueDate'] if attributes[:'timeHardDueDate']

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

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

  self.can_reschedule = attributes[:'canReschedule'] unless attributes[:'canReschedule'].nil?

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

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

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

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

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

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

  self.correlation_token = attributes[:'correlationToken'] if attributes[:'correlationToken']

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

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

Instance Attribute Details

#alternative_resolution_actionsArray<String>

[Required] These are alternative actions to the requested instanceAction that can be taken to resolve the Maintenance.

Returns:

  • (Array<String>)


77
78
79
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 77

def alternative_resolution_actions
  @alternative_resolution_actions
end

#can_rescheduleBOOLEAN

[Required] Indicates if this MaintenanceEvent is capable of being rescheduled up to the timeHardDueDate.

Returns:

  • (BOOLEAN)


114
115
116
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 114

def can_reschedule
  @can_reschedule
end

#compartment_idString

[Required] The OCID of the compartment that contains the instance.

Returns:

  • (String)


53
54
55
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 53

def compartment_id
  @compartment_id
end

#correlation_tokenString

A unique identifier that will group Instances that have a relationship with one another and must be scheduled together for the Maintenance to proceed. Any Instances that have a relationship with one another from a Maintenance perspective will have a matching correlationToken.

Returns:

  • (String)


142
143
144
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 142

def correlation_token
  @correlation_token
end

#created_byString

[Required] The creator of the maintenance event.

Returns:

  • (String)


130
131
132
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 130

def created_by
  @created_by
end

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

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

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


25
26
27
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 25

def defined_tags
  @defined_tags
end

#descriptionString

It is the descriptive information about the maintenance taking place on the customer instance.

Returns:

  • (String)


135
136
137
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 135

def description
  @description
end

#display_nameString

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


31
32
33
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 31

def display_name
  @display_name
end

#estimated_durationString

This is the estimated duration of the Maintenance, once the Maintenance has entered the STARTED state.

Returns:

  • (String)


103
104
105
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 103

def estimated_duration
  @estimated_duration
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


39
40
41
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 39

def freeform_tags
  @freeform_tags
end

#idString

[Required] The OCID of the maintenance event.

Returns:

  • (String)


44
45
46
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 44

def id
  @id
end

#instance_actionString

[Required] This is the action that will be performed on the Instance by OCI when the Maintenance begins.

Returns:

  • (String)


72
73
74
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 72

def instance_action
  @instance_action
end

#instance_idString

[Required] The OCID of the instance.

Returns:

  • (String)


48
49
50
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 48

def instance_id
  @instance_id
end

#lifecycle_stateString

[Required] The current state of the maintenance event.

Returns:

  • (String)


125
126
127
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 125

def lifecycle_state
  @lifecycle_state
end

#maintenance_categoryString

[Required] This indicates the priority and allowed actions for this Maintenance. Higher priority forms of Maintenance have tighter restrictions and may not be rescheduled, while lower priority/severity Maintenance can be rescheduled, deferred, or even cancelled. Please see the Instance Maintenance documentation for details.

Returns:

  • (String)


61
62
63
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 61

def maintenance_category
  @maintenance_category
end

#maintenance_reasonString

[Required] This is the reason that Maintenance is being performed. See Instance Maintenance documentation for details.

Returns:

  • (String)


67
68
69
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 67

def maintenance_reason
  @maintenance_reason
end

#start_window_durationString

The duration of the time window Maintenance is scheduled to begin within.

Returns:

  • (String)


98
99
100
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 98

def start_window_duration
  @start_window_duration
end

#time_createdDateTime

[Required] The date and time the maintenance event was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Returns:

  • (DateTime)


120
121
122
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 120

def time_created
  @time_created
end

#time_finishedDateTime

The time at which the Maintenance actually finished.

Returns:

  • (DateTime)


87
88
89
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 87

def time_finished
  @time_finished
end

#time_hard_due_dateDateTime

It is the scheduled hard due date and time of the maintenance event. The maintenance event will happen at this time and the due date will not be extended.

Returns:

  • (DateTime)


109
110
111
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 109

def time_hard_due_date
  @time_hard_due_date
end

#time_startedDateTime

The time at which the Maintenance actually started.

Returns:

  • (DateTime)


82
83
84
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 82

def time_started
  @time_started
end

#time_window_startDateTime

[Required] The beginning of the time window when Maintenance is scheduled to begin. The Maintenance will not begin before this time.

Returns:

  • (DateTime)


93
94
95
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 93

def time_window_start
  @time_window_start
end

Class Method Details

.attribute_mapObject

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



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/core/models/instance_maintenance_event_summary.rb', line 145

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'defined_tags': :'definedTags',
    'display_name': :'displayName',
    'freeform_tags': :'freeformTags',
    'id': :'id',
    'instance_id': :'instanceId',
    'compartment_id': :'compartmentId',
    'maintenance_category': :'maintenanceCategory',
    'maintenance_reason': :'maintenanceReason',
    'instance_action': :'instanceAction',
    'alternative_resolution_actions': :'alternativeResolutionActions',
    'time_started': :'timeStarted',
    'time_finished': :'timeFinished',
    'time_window_start': :'timeWindowStart',
    'start_window_duration': :'startWindowDuration',
    'estimated_duration': :'estimatedDuration',
    'time_hard_due_date': :'timeHardDueDate',
    'can_reschedule': :'canReschedule',
    'time_created': :'timeCreated',
    'lifecycle_state': :'lifecycleState',
    'created_by': :'createdBy',
    'description': :'description',
    'correlation_token': :'correlationToken'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 175

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'display_name': :'String',
    'freeform_tags': :'Hash<String, String>',
    'id': :'String',
    'instance_id': :'String',
    'compartment_id': :'String',
    'maintenance_category': :'String',
    'maintenance_reason': :'String',
    'instance_action': :'String',
    'alternative_resolution_actions': :'Array<String>',
    'time_started': :'DateTime',
    'time_finished': :'DateTime',
    'time_window_start': :'DateTime',
    'start_window_duration': :'String',
    'estimated_duration': :'String',
    'time_hard_due_date': :'DateTime',
    'can_reschedule': :'BOOLEAN',
    'time_created': :'DateTime',
    'lifecycle_state': :'String',
    'created_by': :'String',
    'description': :'String',
    'correlation_token': :'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



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 390

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

  self.class == other.class &&
    defined_tags == other.defined_tags &&
    display_name == other.display_name &&
    freeform_tags == other.freeform_tags &&
    id == other.id &&
    instance_id == other.instance_id &&
    compartment_id == other.compartment_id &&
    maintenance_category == other.maintenance_category &&
    maintenance_reason == other.maintenance_reason &&
    instance_action == other.instance_action &&
    alternative_resolution_actions == other.alternative_resolution_actions &&
    time_started == other.time_started &&
    time_finished == other.time_finished &&
    time_window_start == other.time_window_start &&
    start_window_duration == other.start_window_duration &&
    estimated_duration == other.estimated_duration &&
    time_hard_due_date == other.time_hard_due_date &&
    can_reschedule == other.can_reschedule &&
    time_created == other.time_created &&
    lifecycle_state == other.lifecycle_state &&
    created_by == other.created_by &&
    description == other.description &&
    correlation_token == other.correlation_token
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



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 441

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


421
422
423
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 421

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



430
431
432
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 430

def hash
  [defined_tags, display_name, freeform_tags, id, instance_id, compartment_id, maintenance_category, maintenance_reason, instance_action, alternative_resolution_actions, time_started, time_finished, time_window_start, start_window_duration, estimated_duration, time_hard_due_date, can_reschedule, time_created, lifecycle_state, created_by, description, correlation_token].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



474
475
476
477
478
479
480
481
482
483
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 474

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



468
469
470
# File 'lib/oci/core/models/instance_maintenance_event_summary.rb', line 468

def to_s
  to_hash.to_s
end