Class: OCI::Core::Models::VolumeBackupSchedule

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

Overview

Defines the backup frequency and retention period for a volume backup policy. For more information, see Policy-Based Backups.

Constant Summary collapse

BACKUP_TYPE_ENUM =
[
  BACKUP_TYPE_FULL = 'FULL'.freeze,
  BACKUP_TYPE_INCREMENTAL = 'INCREMENTAL'.freeze,
  BACKUP_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PERIOD_ENUM =
[
  PERIOD_ONE_HOUR = 'ONE_HOUR'.freeze,
  PERIOD_ONE_DAY = 'ONE_DAY'.freeze,
  PERIOD_ONE_WEEK = 'ONE_WEEK'.freeze,
  PERIOD_ONE_MONTH = 'ONE_MONTH'.freeze,
  PERIOD_ONE_YEAR = 'ONE_YEAR'.freeze,
  PERIOD_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OFFSET_TYPE_ENUM =
[
  OFFSET_TYPE_STRUCTURED = 'STRUCTURED'.freeze,
  OFFSET_TYPE_NUMERIC_SECONDS = 'NUMERIC_SECONDS'.freeze,
  OFFSET_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DAY_OF_WEEK_ENUM =
[
  DAY_OF_WEEK_MONDAY = 'MONDAY'.freeze,
  DAY_OF_WEEK_TUESDAY = 'TUESDAY'.freeze,
  DAY_OF_WEEK_WEDNESDAY = 'WEDNESDAY'.freeze,
  DAY_OF_WEEK_THURSDAY = 'THURSDAY'.freeze,
  DAY_OF_WEEK_FRIDAY = 'FRIDAY'.freeze,
  DAY_OF_WEEK_SATURDAY = 'SATURDAY'.freeze,
  DAY_OF_WEEK_SUNDAY = 'SUNDAY'.freeze,
  DAY_OF_WEEK_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MONTH_ENUM =
[
  MONTH_JANUARY = 'JANUARY'.freeze,
  MONTH_FEBRUARY = 'FEBRUARY'.freeze,
  MONTH_MARCH = 'MARCH'.freeze,
  MONTH_APRIL = 'APRIL'.freeze,
  MONTH_MAY = 'MAY'.freeze,
  MONTH_JUNE = 'JUNE'.freeze,
  MONTH_JULY = 'JULY'.freeze,
  MONTH_AUGUST = 'AUGUST'.freeze,
  MONTH_SEPTEMBER = 'SEPTEMBER'.freeze,
  MONTH_OCTOBER = 'OCTOBER'.freeze,
  MONTH_NOVEMBER = 'NOVEMBER'.freeze,
  MONTH_DECEMBER = 'DECEMBER'.freeze,
  MONTH_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
TIME_ZONE_ENUM =
[
  TIME_ZONE_UTC = 'UTC'.freeze,
  TIME_ZONE_REGIONAL_DATA_CENTER_TIME = 'REGIONAL_DATA_CENTER_TIME'.freeze,
  TIME_ZONE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VolumeBackupSchedule

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
281
282
283
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 206

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

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

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

  self.offset_seconds = attributes[:'offsetSeconds'] if attributes[:'offsetSeconds']

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

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

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

  self.offset_type = attributes[:'offsetType'] if attributes[:'offsetType']

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

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

  self.hour_of_day = attributes[:'hourOfDay'] if attributes[:'hourOfDay']

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

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

  self.day_of_week = attributes[:'dayOfWeek'] if attributes[:'dayOfWeek']

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

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

  self.day_of_month = attributes[:'dayOfMonth'] if attributes[:'dayOfMonth']

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

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

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

  self.retention_seconds = attributes[:'retentionSeconds'] if attributes[:'retentionSeconds']

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

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

  self.time_zone = attributes[:'timeZone'] if attributes[:'timeZone']
  self.time_zone = "UTC" if time_zone.nil? && !attributes.key?(:'timeZone') # rubocop:disable Style/StringLiterals

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

  self.time_zone = attributes[:'time_zone'] if attributes[:'time_zone']
  self.time_zone = "UTC" if time_zone.nil? && !attributes.key?(:'timeZone') && !attributes.key?(:'time_zone') # rubocop:disable Style/StringLiterals

  self.retention_period = attributes[:'retentionPeriod'] if attributes[:'retentionPeriod']

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

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

  self.is_prevent_deletion_enabled = attributes[:'isPreventDeletionEnabled'] unless attributes[:'isPreventDeletionEnabled'].nil?

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

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

  self.is_retention_lock_enabled = attributes[:'isRetentionLockEnabled'] unless attributes[:'isRetentionLockEnabled'].nil?

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

  self.is_retention_lock_enabled = attributes[:'is_retention_lock_enabled'] unless attributes[:'is_retention_lock_enabled'].nil?
end

Instance Attribute Details

#backup_typeString

[Required] The type of volume backup to create.

Returns:

  • (String)


70
71
72
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 70

def backup_type
  @backup_type
end

#day_of_monthInteger

The day of the month to schedule the volume backup.

Returns:

  • (Integer)


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

def day_of_month
  @day_of_month
end

#day_of_weekString

The day of the week to schedule the volume backup.

Returns:

  • (String)


116
117
118
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 116

def day_of_week
  @day_of_week
end

#hour_of_dayInteger

The hour of the day to schedule the volume backup.

Returns:

  • (Integer)


112
113
114
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 112

def hour_of_day
  @hour_of_day
end

#is_prevent_deletion_enabledBOOLEAN

Prevent backups from being deleted during the configured retention period. This is an optional field. If it is not specified, it is set to null, prevent deletion will not be applied to the backups.

Returns:

  • (BOOLEAN)


139
140
141
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 139

def is_prevent_deletion_enabled
  @is_prevent_deletion_enabled
end

#is_retention_lock_enabledBOOLEAN

feature that prevents deletion or alteration of backup data for a specified period to ensure data protection and regulatory compliance. This is an optional field. If it is not specified, it is set to null, no retention lock will be applied to the backups. This feature should be used in conjunction with the retention-period field.

Returns:

  • (BOOLEAN)


143
144
145
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 143

def is_retention_lock_enabled
  @is_retention_lock_enabled
end

#monthString

The month of the year to schedule the volume backup.

Returns:

  • (String)


124
125
126
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 124

def month
  @month
end

#offset_secondsInteger

The number of seconds that the volume backup start time should be shifted from the default interval boundaries specified by the period. The volume backup start time is the frequency start time plus the offset.

Returns:

  • (Integer)


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

def offset_seconds
  @offset_seconds
end

#offset_typeString

Indicates how the offset is defined. If value is STRUCTURED, then hourOfDay, dayOfWeek, dayOfMonth, and month fields are used and offsetSeconds will be ignored in requests and users should ignore its value from the responses.

hourOfDay is applicable for periods ONE_DAY, ONE_WEEK, ONE_MONTH and ONE_YEAR.

dayOfWeek is applicable for period ONE_WEEK.

dayOfMonth is applicable for periods ONE_MONTH and ONE_YEAR.

'month' is applicable for period 'ONE_YEAR'.

They will be ignored in the requests for inapplicable periods.

If value is NUMERIC_SECONDS, then offsetSeconds will be used for both requests and responses and the structured fields will be ignored in the requests and users should ignore their values from the responses.

For clients using older versions of Apis and not sending offsetType in their requests, the behaviour is just like NUMERIC_SECONDS.

Returns:

  • (String)


108
109
110
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 108

def offset_type
  @offset_type
end

#periodString

[Required] The volume backup frequency.

Returns:

  • (String)


81
82
83
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 81

def period
  @period
end

#retention_periodOCI::Core::Models::RetentionDuration



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

def retention_period
  @retention_period
end

#retention_secondsInteger

[Required] How long, in seconds, to keep the volume backups created by this schedule.

Returns:

  • (Integer)


128
129
130
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 128

def retention_seconds
  @retention_seconds
end

#time_zoneString

Specifies what time zone is the schedule in

Returns:

  • (String)


132
133
134
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 132

def time_zone
  @time_zone
end

Class Method Details

.attribute_mapObject

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



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 146

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'backup_type': :'backupType',
    'offset_seconds': :'offsetSeconds',
    'period': :'period',
    'offset_type': :'offsetType',
    'hour_of_day': :'hourOfDay',
    'day_of_week': :'dayOfWeek',
    'day_of_month': :'dayOfMonth',
    'month': :'month',
    'retention_seconds': :'retentionSeconds',
    'time_zone': :'timeZone',
    'retention_period': :'retentionPeriod',
    'is_prevent_deletion_enabled': :'isPreventDeletionEnabled',
    'is_retention_lock_enabled': :'isRetentionLockEnabled'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 167

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'backup_type': :'String',
    'offset_seconds': :'Integer',
    'period': :'String',
    'offset_type': :'String',
    'hour_of_day': :'Integer',
    'day_of_week': :'String',
    'day_of_month': :'Integer',
    'month': :'String',
    'retention_seconds': :'Integer',
    'time_zone': :'String',
    'retention_period': :'OCI::Core::Models::RetentionDuration',
    'is_prevent_deletion_enabled': :'BOOLEAN',
    'is_retention_lock_enabled': :'BOOLEAN'
    # 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



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 370

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

  self.class == other.class &&
    backup_type == other.backup_type &&
    offset_seconds == other.offset_seconds &&
    period == other.period &&
    offset_type == other.offset_type &&
    hour_of_day == other.hour_of_day &&
    day_of_week == other.day_of_week &&
    day_of_month == other.day_of_month &&
    month == other.month &&
    retention_seconds == other.retention_seconds &&
    time_zone == other.time_zone &&
    retention_period == other.retention_period &&
    is_prevent_deletion_enabled == other.is_prevent_deletion_enabled &&
    is_retention_lock_enabled == other.is_retention_lock_enabled
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



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 412

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


392
393
394
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 392

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



401
402
403
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 401

def hash
  [backup_type, offset_seconds, period, offset_type, hour_of_day, day_of_week, day_of_month, month, retention_seconds, time_zone, retention_period, is_prevent_deletion_enabled, is_retention_lock_enabled].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



445
446
447
448
449
450
451
452
453
454
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 445

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



439
440
441
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 439

def to_s
  to_hash.to_s
end