Class: OCI::FileStorage::Models::SnapshotSchedule

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/file_storage/models/snapshot_schedule.rb

Overview

The snapshot schedule is a structure within a parent file system snapshot policy. It contains data about the frequency of snapshot creation and the retention time of the taken snapshots.

Constant Summary collapse

PERIOD_ENUM =
[
  PERIOD_HOURLY = 'HOURLY'.freeze,
  PERIOD_DAILY = 'DAILY'.freeze,
  PERIOD_WEEKLY = 'WEEKLY'.freeze,
  PERIOD_MONTHLY = 'MONTHLY'.freeze,
  PERIOD_YEARLY = 'YEARLY'.freeze,
  PERIOD_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
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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SnapshotSchedule

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
220
221
222
223
224
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 167

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

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

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

  self.time_schedule_start = attributes[:'timeScheduleStart'] if attributes[:'timeScheduleStart']

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

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

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

  self.retention_duration_in_seconds = attributes[:'retentionDurationInSeconds'] if attributes[:'retentionDurationInSeconds']

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

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

  self.time_zone = attributes[:'timeZone'] if attributes[:'timeZone']

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

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

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

Instance Attribute Details

#day_of_monthInteger

The day of the month to create a scheduled snapshot. If the day does not exist for the month, snapshot creation will be skipped. Used for MONTHLY and YEARLY snapshot schedules. If not set, the system chooses a value at creation time.

Returns:

  • (Integer)


103
104
105
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 103

def day_of_month
  @day_of_month
end

#day_of_weekString

The day of the week to create a scheduled snapshot. Used for WEEKLY snapshot schedules. If not set, the system chooses a value at creation time.

Returns:

  • (String)


95
96
97
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 95

def day_of_week
  @day_of_week
end

#hour_of_dayInteger

The hour of the day to create a DAILY, WEEKLY, MONTHLY, or YEARLY snapshot. If not set, the system chooses a value at creation time.

Returns:

  • (Integer)


88
89
90
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 88

def hour_of_day
  @hour_of_day
end

#lock_duration_detailsOCI::FileStorage::Models::LockDurationDetails



113
114
115
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 113

def lock_duration_details
  @lock_duration_details
end

#monthString

The month to create a scheduled snapshot. Used only for YEARLY snapshot schedules. If not set, the system chooses a value at creation time.

Returns:

  • (String)


110
111
112
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 110

def month
  @month
end

#periodString

[Required] The frequency of scheduled snapshots.

Returns:

  • (String)


72
73
74
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 72

def period
  @period
end

#retention_duration_in_secondsInteger

The number of seconds to retain snapshots created with this schedule. Snapshot expiration time will not be set if this value is empty.

Returns:

  • (Integer)


78
79
80
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 78

def retention_duration_in_seconds
  @retention_duration_in_seconds
end

#schedule_prefixString

A name prefix to be applied to snapshots created by this schedule.

Example: compliance1

Returns:

  • (String)


61
62
63
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 61

def schedule_prefix
  @schedule_prefix
end

#time_schedule_startDateTime

The starting point used to begin the scheduling of the snapshots based upon recurrence string in RFC 3339 timestamp format. If no timeScheduleStart is provided, the value will be set to the time when the schedule was created.

Returns:

  • (DateTime)


68
69
70
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 68

def time_schedule_start
  @time_schedule_start
end

#time_zoneString

[Required] Time zone used for scheduling the snapshot.

Returns:

  • (String)


82
83
84
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 82

def time_zone
  @time_zone
end

Class Method Details

.attribute_mapObject

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



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 116

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'schedule_prefix': :'schedulePrefix',
    'time_schedule_start': :'timeScheduleStart',
    'period': :'period',
    'retention_duration_in_seconds': :'retentionDurationInSeconds',
    'time_zone': :'timeZone',
    'hour_of_day': :'hourOfDay',
    'day_of_week': :'dayOfWeek',
    'day_of_month': :'dayOfMonth',
    'month': :'month',
    'lock_duration_details': :'lockDurationDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 134

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'schedule_prefix': :'String',
    'time_schedule_start': :'DateTime',
    'period': :'String',
    'retention_duration_in_seconds': :'Integer',
    'time_zone': :'String',
    'hour_of_day': :'Integer',
    'day_of_week': :'String',
    'day_of_month': :'Integer',
    'month': :'String',
    'lock_duration_details': :'OCI::FileStorage::Models::LockDurationDetails'
    # 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



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 285

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

  self.class == other.class &&
    schedule_prefix == other.schedule_prefix &&
    time_schedule_start == other.time_schedule_start &&
    period == other.period &&
    retention_duration_in_seconds == other.retention_duration_in_seconds &&
    time_zone == other.time_zone &&
    hour_of_day == other.hour_of_day &&
    day_of_week == other.day_of_week &&
    day_of_month == other.day_of_month &&
    month == other.month &&
    lock_duration_details == other.lock_duration_details
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



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 324

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


304
305
306
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 304

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



313
314
315
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 313

def hash
  [schedule_prefix, time_schedule_start, period, retention_duration_in_seconds, time_zone, hour_of_day, day_of_week, day_of_month, month, lock_duration_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



357
358
359
360
361
362
363
364
365
366
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 357

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



351
352
353
# File 'lib/oci/file_storage/models/snapshot_schedule.rb', line 351

def to_s
  to_hash.to_s
end