Class: OCI::Core::Models::VolumeBackupSchedule
- Inherits:
-
Object
- Object
- OCI::Core::Models::VolumeBackupSchedule
- Defined in:
- lib/oci/core/models/volume_backup_schedule.rb
Overview
Defines a chronological recurrence pattern for creating scheduled backups at a particular periodicity.
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
-
#backup_type ⇒ String
[Required] The type of backup to create.
-
#day_of_month ⇒ Integer
The day of the month to schedule the backup.
-
#day_of_week ⇒ String
The day of the week to schedule the backup.
-
#hour_of_day ⇒ Integer
The hour of the day to schedule the backup.
-
#month ⇒ String
The month of the year to schedule the backup.
-
#offset_seconds ⇒ Integer
The number of seconds that the backup time should be shifted from the default interval boundaries specified by the period.
-
#offset_type ⇒ String
Indicates how offset is defined.
-
#period ⇒ String
[Required] How often the backup should occur.
-
#retention_seconds ⇒ Integer
[Required] How long, in seconds, backups created by this schedule should be kept until being automatically deleted.
-
#time_zone ⇒ String
Specifies what time zone is the schedule in.
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 = {}) ⇒ VolumeBackupSchedule
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 = {}) ⇒ VolumeBackupSchedule
Initializes the object
156 157 158 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 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 156 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 end |
Instance Attribute Details
#backup_type ⇒ String
[Required] The type of backup to create.
66 67 68 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 66 def backup_type @backup_type end |
#day_of_month ⇒ Integer
The day of the month to schedule the backup
90 91 92 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 90 def day_of_month @day_of_month end |
#day_of_week ⇒ String
The day of the week to schedule the backup
86 87 88 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 86 def day_of_week @day_of_week end |
#hour_of_day ⇒ Integer
The hour of the day to schedule the backup
82 83 84 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 82 def hour_of_day @hour_of_day end |
#month ⇒ String
The month of the year to schedule the backup
94 95 96 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 94 def month @month end |
#offset_seconds ⇒ Integer
The number of seconds that the backup time should be shifted from the default interval boundaries specified by the period. Backup time = Frequency start time + Offset.
70 71 72 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 70 def offset_seconds @offset_seconds end |
#offset_type ⇒ String
Indicates how 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 respones. `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 respones. For clients using older versions of Apis and not sending `offsetType` in their requests, the behaviour is just like `NUMERIC_SECONDS`.
78 79 80 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 78 def offset_type @offset_type end |
#period ⇒ String
[Required] How often the backup should occur.
74 75 76 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 74 def period @period end |
#retention_seconds ⇒ Integer
[Required] How long, in seconds, backups created by this schedule should be kept until being automatically deleted.
98 99 100 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 98 def retention_seconds @retention_seconds end |
#time_zone ⇒ String
Specifies what time zone is the schedule in
102 103 104 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 102 def time_zone @time_zone end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 105 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' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 123 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' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 302 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 end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 341 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
321 322 323 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 321 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
330 331 332 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 330 def hash [backup_type, offset_seconds, period, offset_type, hour_of_day, day_of_week, day_of_month, month, retention_seconds, time_zone].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
374 375 376 377 378 379 380 381 382 383 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 374 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
368 369 370 |
# File 'lib/oci/core/models/volume_backup_schedule.rb', line 368 def to_s to_hash.to_s end |