Class: OCI::DisasterRecovery::Models::UpdateOkeClusterBackupConfigDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb

Overview

Update 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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateOkeClusterBackupConfigDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 104

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

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

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

  self.backup_schedule = attributes[:'backupSchedule'] if attributes[:'backupSchedule']

  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.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']

  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.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_scheduleString

The schedule for backing up namespaces to the destination region. If abackupSchedule is not specified, only a single backup will be created. This format of the string specifying the backupSchedule must conform with RFC-5545. This schedule will use the UTC timezone. This property applies to the OKE cluster member in primary region.

Example: FREQ=WEEKLY;BYDAY=MO,TU,WE,TH;BYHOUR=10;INTERVAL=1

Returns:

  • (String)


44
45
46
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 44

def backup_schedule
  @backup_schedule
end

#exclude_namespacesArray<String>

A list of namespaces to be excluded from the backup. The default value is null. If a list of namespaces to exclude is not provided, all namespaces will be backed up. Specify either the namespaces or the excludeNamespaces parameter, but not both. This property applies to OKE cluster members in the primary region.

Example: ["namespace_string_3", "namespace_string_4"]

Returns:

  • (Array<String>)


34
35
36
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 34

def exclude_namespaces
  @exclude_namespaces
end

#image_replication_vault_secret_idString

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.

Returns:

  • (String)


62
63
64
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 62

def image_replication_vault_secret_id
  @image_replication_vault_secret_id
end

#max_number_of_backups_retainedInteger

The maximum number of backups that should be retained. This property applies to the OKE cluster member in primary region.

Returns:

  • (Integer)


56
57
58
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 56

def max_number_of_backups_retained
  @max_number_of_backups_retained
end

#namespacesArray<String>

A list of namespaces to be included in the backup. The default value is null. If a list of namespaces to include is not provided, all namespaces will be backed up. Specify either the namespaces or the excludeNamespaces parameter, but not both. This property applies to the OKE cluster member in primary region.

Example: ["default", "pv-nginx"]

Returns:

  • (Array<String>)


24
25
26
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 24

def namespaces
  @namespaces
end

#replicate_imagesString

Controls the behaviour of image replication across regions. This property applies to the OKE cluster member in primary region.

Returns:

  • (String)


50
51
52
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 50

def replicate_images
  @replicate_images
end

Class Method Details

.attribute_mapObject

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



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 65

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'namespaces': :'namespaces',
    'exclude_namespaces': :'excludeNamespaces',
    'backup_schedule': :'backupSchedule',
    'replicate_images': :'replicateImages',
    'max_number_of_backups_retained': :'maxNumberOfBackupsRetained',
    'image_replication_vault_secret_id': :'imageReplicationVaultSecretId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 79

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'namespaces': :'Array<String>',
    'exclude_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.

Parameters:

  • other (Object)

    the other object to be compared



158
159
160
161
162
163
164
165
166
167
168
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 158

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

  self.class == other.class &&
    namespaces == other.namespaces &&
    exclude_namespaces == other.exclude_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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



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/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 193

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


173
174
175
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 173

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



182
183
184
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 182

def hash
  [namespaces, exclude_namespaces, backup_schedule, replicate_images, max_number_of_backups_retained, image_replication_vault_secret_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



226
227
228
229
230
231
232
233
234
235
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 226

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



220
221
222
# File 'lib/oci/disaster_recovery/models/update_oke_cluster_backup_config_details.rb', line 220

def to_s
  to_hash.to_s
end