Class: OCI::Datacc::Models::MaintenanceWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/datacc/models/maintenance_window.rb

Overview

The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window.

Constant Summary collapse

PREFERENCE_ENUM =
[
  PREFERENCE_NO_PREFERENCE = 'NO_PREFERENCE'.freeze,
  PREFERENCE_CUSTOM_PREFERENCE = 'CUSTOM_PREFERENCE'.freeze,
  PREFERENCE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PATCHING_MODE_ENUM =
[
  PATCHING_MODE_ROLLING = 'ROLLING'.freeze,
  PATCHING_MODE_NONROLLING = 'NONROLLING'.freeze,
  PATCHING_MODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MONTHS_ENUM =
[
  MONTHS_JANUARY = 'JANUARY'.freeze,
  MONTHS_FEBRUARY = 'FEBRUARY'.freeze,
  MONTHS_MARCH = 'MARCH'.freeze,
  MONTHS_APRIL = 'APRIL'.freeze,
  MONTHS_MAY = 'MAY'.freeze,
  MONTHS_JUNE = 'JUNE'.freeze,
  MONTHS_JULY = 'JULY'.freeze,
  MONTHS_AUGUST = 'AUGUST'.freeze,
  MONTHS_SEPTEMBER = 'SEPTEMBER'.freeze,
  MONTHS_OCTOBER = 'OCTOBER'.freeze,
  MONTHS_NOVEMBER = 'NOVEMBER'.freeze,
  MONTHS_DECEMBER = 'DECEMBER'.freeze,
  MONTHS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DAYS_OF_WEEK_ENUM =
[
  DAYS_OF_WEEK_MONDAY = 'MONDAY'.freeze,
  DAYS_OF_WEEK_TUESDAY = 'TUESDAY'.freeze,
  DAYS_OF_WEEK_WEDNESDAY = 'WEDNESDAY'.freeze,
  DAYS_OF_WEEK_THURSDAY = 'THURSDAY'.freeze,
  DAYS_OF_WEEK_FRIDAY = 'FRIDAY'.freeze,
  DAYS_OF_WEEK_SATURDAY = 'SATURDAY'.freeze,
  DAYS_OF_WEEK_SUNDAY = 'SUNDAY'.freeze,
  DAYS_OF_WEEK_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MaintenanceWindow

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/datacc/models/maintenance_window.rb', line 159

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.preference = attributes[:'preference'] if attributes[:'preference']
  self.preference = "NO_PREFERENCE" if preference.nil? && !attributes.key?(:'preference') # rubocop:disable Style/StringLiterals

  self.patching_mode = attributes[:'patchingMode'] if attributes[:'patchingMode']
  self.patching_mode = "NONROLLING" if patching_mode.nil? && !attributes.key?(:'patchingMode') # rubocop:disable Style/StringLiterals

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

  self.patching_mode = attributes[:'patching_mode'] if attributes[:'patching_mode']
  self.patching_mode = "NONROLLING" if patching_mode.nil? && !attributes.key?(:'patchingMode') && !attributes.key?(:'patching_mode') # rubocop:disable Style/StringLiterals

  self.is_custom_action_timeout_enabled = attributes[:'isCustomActionTimeoutEnabled'] unless attributes[:'isCustomActionTimeoutEnabled'].nil?

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

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

  self.custom_action_timeout_in_mins = attributes[:'customActionTimeoutInMins'] if attributes[:'customActionTimeoutInMins']

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

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

  self.is_monthly_patching_enabled = attributes[:'isMonthlyPatchingEnabled'] unless attributes[:'isMonthlyPatchingEnabled'].nil?

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

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

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

  self.weeks_of_month = attributes[:'weeksOfMonth'] if attributes[:'weeksOfMonth']

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

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

  self.days_of_week = attributes[:'daysOfWeek'] if attributes[:'daysOfWeek']

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

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

  self.hours_of_day = attributes[:'hoursOfDay'] if attributes[:'hoursOfDay']

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

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

  self.lead_time_in_weeks = attributes[:'leadTimeInWeeks'] if attributes[:'leadTimeInWeeks']

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

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

Instance Attribute Details

#custom_action_timeout_in_minsInteger

Determines the amount of time the system will wait before the start of each Database Infrastructure server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive).

Returns:

  • (Integer)


72
73
74
# File 'lib/oci/datacc/models/maintenance_window.rb', line 72

def custom_action_timeout_in_mins
  @custom_action_timeout_in_mins
end

#days_of_weekArray<String>

Days during the week when maintenance should be performed.

Returns:

  • (Array<String>)


95
96
97
# File 'lib/oci/datacc/models/maintenance_window.rb', line 95

def days_of_week
  @days_of_week
end

#hours_of_dayArray<Integer>

The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC

Returns:

  • (Array<Integer>)


99
100
101
# File 'lib/oci/datacc/models/maintenance_window.rb', line 99

def hours_of_day
  @hours_of_day
end

#is_custom_action_timeout_enabledBOOLEAN

If true, enables the configuration of a custom action timeout (waiting period) between Database Infrastructure server patching operations.

Returns:

  • (BOOLEAN)


66
67
68
# File 'lib/oci/datacc/models/maintenance_window.rb', line 66

def is_custom_action_timeout_enabled
  @is_custom_action_timeout_enabled
end

#is_monthly_patching_enabledBOOLEAN

If true, enables the monthly patching option.

Returns:

  • (BOOLEAN)


76
77
78
# File 'lib/oci/datacc/models/maintenance_window.rb', line 76

def is_monthly_patching_enabled
  @is_monthly_patching_enabled
end

#lead_time_in_weeksInteger

Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4.

Returns:

  • (Integer)


105
106
107
# File 'lib/oci/datacc/models/maintenance_window.rb', line 105

def lead_time_in_weeks
  @lead_time_in_weeks
end

#monthsArray<String>

Months during the year when maintenance should be performed.

Returns:

  • (Array<String>)


80
81
82
# File 'lib/oci/datacc/models/maintenance_window.rb', line 80

def months
  @months
end

#patching_modeString

Cloud Database Infrastructure node patching method. IMPORTANT: Non-rolling infrastructure patching involves system down time. See Oracle-Managed Database Infrastructure Maintenance Updates for more information.

Returns:

  • (String)


62
63
64
# File 'lib/oci/datacc/models/maintenance_window.rb', line 62

def patching_mode
  @patching_mode
end

#preferenceString

The maintenance window scheduling preference.

Returns:

  • (String)


54
55
56
# File 'lib/oci/datacc/models/maintenance_window.rb', line 54

def preference
  @preference
end

#weeks_of_monthArray<Integer>

Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week.For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed.

Returns:

  • (Array<Integer>)


91
92
93
# File 'lib/oci/datacc/models/maintenance_window.rb', line 91

def weeks_of_month
  @weeks_of_month
end

Class Method Details

.attribute_mapObject

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



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/oci/datacc/models/maintenance_window.rb', line 108

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'preference': :'preference',
    'patching_mode': :'patchingMode',
    'is_custom_action_timeout_enabled': :'isCustomActionTimeoutEnabled',
    'custom_action_timeout_in_mins': :'customActionTimeoutInMins',
    'is_monthly_patching_enabled': :'isMonthlyPatchingEnabled',
    'months': :'months',
    'weeks_of_month': :'weeksOfMonth',
    'days_of_week': :'daysOfWeek',
    'hours_of_day': :'hoursOfDay',
    'lead_time_in_weeks': :'leadTimeInWeeks'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/datacc/models/maintenance_window.rb', line 126

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'preference': :'String',
    'patching_mode': :'String',
    'is_custom_action_timeout_enabled': :'BOOLEAN',
    'custom_action_timeout_in_mins': :'Integer',
    'is_monthly_patching_enabled': :'BOOLEAN',
    'months': :'Array<String>',
    'weeks_of_month': :'Array<Integer>',
    'days_of_week': :'Array<String>',
    'hours_of_day': :'Array<Integer>',
    'lead_time_in_weeks': :'Integer'
    # 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



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/oci/datacc/models/maintenance_window.rb', line 294

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

  self.class == other.class &&
    preference == other.preference &&
    patching_mode == other.patching_mode &&
    is_custom_action_timeout_enabled == other.is_custom_action_timeout_enabled &&
    custom_action_timeout_in_mins == other.custom_action_timeout_in_mins &&
    is_monthly_patching_enabled == other.is_monthly_patching_enabled &&
    months == other.months &&
    weeks_of_month == other.weeks_of_month &&
    days_of_week == other.days_of_week &&
    hours_of_day == other.hours_of_day &&
    lead_time_in_weeks == other.lead_time_in_weeks
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



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/oci/datacc/models/maintenance_window.rb', line 333

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


313
314
315
# File 'lib/oci/datacc/models/maintenance_window.rb', line 313

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



322
323
324
# File 'lib/oci/datacc/models/maintenance_window.rb', line 322

def hash
  [preference, patching_mode, is_custom_action_timeout_enabled, custom_action_timeout_in_mins, is_monthly_patching_enabled, months, weeks_of_month, days_of_week, hours_of_day, lead_time_in_weeks].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



366
367
368
369
370
371
372
373
374
375
# File 'lib/oci/datacc/models/maintenance_window.rb', line 366

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



360
361
362
# File 'lib/oci/datacc/models/maintenance_window.rb', line 360

def to_s
  to_hash.to_s
end