Class: OCI::DisasterRecovery::Models::CreateOkeClusterBackupConfigDetails
- Inherits:
-
Object
- Object
- OCI::DisasterRecovery::Models::CreateOkeClusterBackupConfigDetails
- Defined in:
- lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb
Overview
Create backup configuration properties for an OKE member.
Constant Summary collapse
- REPLICATE_IMAGES_ENUM =
[ REPLICATE_IMAGES_ENABLE = 'ENABLE'.freeze, REPLICATE_IMAGES_DISABLE = 'DISABLE'.freeze ].freeze
Instance Attribute Summary collapse
-
#backup_schedule ⇒ String
The schedule for backing up namespaces to the destination region.
-
#image_replication_vault_secret_id ⇒ String
The OCID of the vault secret that stores the image credential.
-
#max_number_of_backups_retained ⇒ Integer
The maximum number of backups that should be retained.
-
#namespaces ⇒ Array<String>
A list of namespaces that need to be backed up.
-
#replicate_images ⇒ String
Controls the behaviour of image replication across regions.
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 = {}) ⇒ CreateOkeClusterBackupConfigDetails
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 = {}) ⇒ CreateOkeClusterBackupConfigDetails
Initializes the object
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 118 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.namespaces = attributes[:'namespaces'] if attributes[:'namespaces'] self.backup_schedule = attributes[:'backupSchedule'] if attributes[:'backupSchedule'] self.backup_schedule = "FREQ=WEEKLY;BYDAY=SU;BYMINUTE=0;BYSECONDS=0;INTERVAL=1" if backup_schedule.nil? && !attributes.key?(:'backupSchedule') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :backupSchedule and :backup_schedule' if attributes.key?(:'backupSchedule') && attributes.key?(:'backup_schedule') self.backup_schedule = attributes[:'backup_schedule'] if attributes[:'backup_schedule'] self.backup_schedule = "FREQ=WEEKLY;BYDAY=SU;BYMINUTE=0;BYSECONDS=0;INTERVAL=1" if backup_schedule.nil? && !attributes.key?(:'backupSchedule') && !attributes.key?(:'backup_schedule') # rubocop:disable Style/StringLiterals self.replicate_images = attributes[:'replicateImages'] if attributes[:'replicateImages'] raise 'You cannot provide both :replicateImages and :replicate_images' if attributes.key?(:'replicateImages') && attributes.key?(:'replicate_images') self.replicate_images = attributes[:'replicate_images'] if attributes[:'replicate_images'] self.max_number_of_backups_retained = attributes[:'maxNumberOfBackupsRetained'] if attributes[:'maxNumberOfBackupsRetained'] self.max_number_of_backups_retained = 5 if max_number_of_backups_retained.nil? && !attributes.key?(:'maxNumberOfBackupsRetained') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :maxNumberOfBackupsRetained and :max_number_of_backups_retained' if attributes.key?(:'maxNumberOfBackupsRetained') && attributes.key?(:'max_number_of_backups_retained') self.max_number_of_backups_retained = attributes[:'max_number_of_backups_retained'] if attributes[:'max_number_of_backups_retained'] self.max_number_of_backups_retained = 5 if max_number_of_backups_retained.nil? && !attributes.key?(:'maxNumberOfBackupsRetained') && !attributes.key?(:'max_number_of_backups_retained') # rubocop:disable Style/StringLiterals self.image_replication_vault_secret_id = attributes[:'imageReplicationVaultSecretId'] if attributes[:'imageReplicationVaultSecretId'] raise 'You cannot provide both :imageReplicationVaultSecretId and :image_replication_vault_secret_id' if attributes.key?(:'imageReplicationVaultSecretId') && attributes.key?(:'image_replication_vault_secret_id') self.image_replication_vault_secret_id = attributes[:'image_replication_vault_secret_id'] if attributes[:'image_replication_vault_secret_id'] end |
Instance Attribute Details
#backup_schedule ⇒ String
The schedule for backing up namespaces to the destination region. If a backup schedule is not specified, only a single backup will be created. This format of the string specifying the backup schedule must conform with RFC-5545 (see examples below). This schedule will use the UTC timezone. This property applies to the OKE cluster member in primary region.
The backup frequency can be HOURLY, DAILY, WEEKLY or MONTHLY, and the upper and lower interval bounds are as follows HOURLY - Minimum = 1 - Maximum = 24 DAILY - Minimum = 1 - Maximum = 30 WEEKLY - Minimum = 1 - Maximum = 1 MONTHLY - Minimum = 1 - Maximum = 12
Examples: FREQ=WEEKLY;BYDAY=MO,WE;BYHOUR=10;INTERVAL=1 -> Run a backup every Monday and Wednesday at 10:00 AM. FREQ=WEEKLY;BYDAY=MO,WE;BYHOUR=10;INTERVAL=2 -> Invalid configuration (Cannot specify an interval of 2).
FREQ=HOURLY;INTERVAL=25 -> Invalid configuration (Cannot specify an interval of 25).
FREQ=HOURLY;INTERVAL=0 -> Invalid configuration (Cannot specify an interval of 0).
FREQ=HOURLY;INTERVAL=24 -> Run a backup every 24 hours.
FREQ=HOURLY;INTERVAL=1 -> Run a backup every hour.
FREQ=HOURLY;BYMINUTE=30;INTERVAL=15 -> Run a backup every 15 hours at the 30th minute.
FREQ=DAILY;INTERVAL=31 -> Invalid configuration (Cannot specify an interval of 31).
FREQ=DAILY;INTERVAL=0 -> Invalid configuration (Cannot specify an interval of 0).
FREQ=DAILY;INTERVAL=30 -> Run a backup every 30 days at 12:00 midnight.
FREQ=DAILY;BYHOUR=17;BYMINUTE=10;INTERVAL=1 -> Run a backup daily at 05:10 PM.
60 61 62 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 60 def backup_schedule @backup_schedule end |
#image_replication_vault_secret_id ⇒ String
The OCID of the vault secret that stores the image credential. This property applies to the OKE cluster member in both the primary and standby region.
79 80 81 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 79 def image_replication_vault_secret_id @image_replication_vault_secret_id end |
#max_number_of_backups_retained ⇒ Integer
The maximum number of backups that should be retained. This property applies to the OKE cluster member in primary region.
73 74 75 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 73 def max_number_of_backups_retained @max_number_of_backups_retained end |
#namespaces ⇒ Array<String>
A list of namespaces that need to be backed up. The default value is null. If a list of namespaces is not provided, all namespaces will be backed up. This property applies to the OKE cluster member in primary region.
Example: ["default", "pv-nginx"]
23 24 25 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 23 def namespaces @namespaces end |
#replicate_images ⇒ String
Controls the behaviour of image replication across regions. Image replication is enabled by default for DR Protection Groups with a primary role. This property applies to the OKE cluster member in primary region.
67 68 69 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 67 def replicate_images @replicate_images end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 82 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'namespaces': :'namespaces', 'backup_schedule': :'backupSchedule', 'replicate_images': :'replicateImages', 'max_number_of_backups_retained': :'maxNumberOfBackupsRetained', 'image_replication_vault_secret_id': :'imageReplicationVaultSecretId' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 95 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'namespaces': :'Array<String>', 'backup_schedule': :'String', 'replicate_images': :'String', 'max_number_of_backups_retained': :'Integer', 'image_replication_vault_secret_id': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 170 def ==(other) return true if equal?(other) self.class == other.class && namespaces == other.namespaces && backup_schedule == other.backup_schedule && replicate_images == other.replicate_images && max_number_of_backups_retained == other.max_number_of_backups_retained && image_replication_vault_secret_id == other.image_replication_vault_secret_id end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 204 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
184 185 186 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 184 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
193 194 195 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 193 def hash [namespaces, backup_schedule, replicate_images, max_number_of_backups_retained, image_replication_vault_secret_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
237 238 239 240 241 242 243 244 245 246 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 237 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
231 232 233 |
# File 'lib/oci/disaster_recovery/models/create_oke_cluster_backup_config_details.rb', line 231 def to_s to_hash.to_s end |