Class: OCI::Recovery::Models::Metrics

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/recovery/models/metrics.rb

Overview

Backup performance and storage utilization metrics for the protected database.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Metrics

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



93
94
95
96
97
98
99
100
101
102
103
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
142
143
144
145
146
# File 'lib/oci/recovery/models/metrics.rb', line 93

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_space_used_in_gbs = attributes[:'backupSpaceUsedInGBs'] if attributes[:'backupSpaceUsedInGBs']

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

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

  self.backup_space_estimate_in_gbs = attributes[:'backupSpaceEstimateInGBs'] if attributes[:'backupSpaceEstimateInGBs']

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

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

  self.unprotected_window_in_seconds = attributes[:'unprotectedWindowInSeconds'] if attributes[:'unprotectedWindowInSeconds']

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

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

  self.db_size_in_gbs = attributes[:'dbSizeInGBs'] if attributes[:'dbSizeInGBs']

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

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

  self.is_redo_logs_enabled = attributes[:'isRedoLogsEnabled'] unless attributes[:'isRedoLogsEnabled'].nil?

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

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

  self.retention_period_in_days = attributes[:'retentionPeriodInDays'] if attributes[:'retentionPeriodInDays']

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

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

  self.current_retention_period_in_seconds = attributes[:'currentRetentionPeriodInSeconds'] if attributes[:'currentRetentionPeriodInSeconds']

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

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

  self.minimum_recovery_needed_in_days = attributes[:'minimumRecoveryNeededInDays'] if attributes[:'minimumRecoveryNeededInDays']

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

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

Instance Attribute Details

#backup_space_estimate_in_gbsFloat

The estimated backup storage space, in gigabytes, required to meet the recovery window goal, including foot print and backups for the protected database.

Returns:

  • (Float)


17
18
19
# File 'lib/oci/recovery/models/metrics.rb', line 17

def backup_space_estimate_in_gbs
  @backup_space_estimate_in_gbs
end

#backup_space_used_in_gbsFloat

Backup storage space, in gigabytes, utilized by the protected database. Oracle charges for the total storage used.

Returns:

  • (Float)


13
14
15
# File 'lib/oci/recovery/models/metrics.rb', line 13

def backup_space_used_in_gbs
  @backup_space_used_in_gbs
end

#current_retention_period_in_secondsFloat

Number of seconds backups are currently retained for this database.

Returns:

  • (Float)


41
42
43
# File 'lib/oci/recovery/models/metrics.rb', line 41

def current_retention_period_in_seconds
  @current_retention_period_in_seconds
end

#db_size_in_gbsFloat

The estimated space, in gigabytes, consumed by the protected database. The database size is based on the size of the data files in the catalog, and does not include archive logs.

Returns:

  • (Float)


27
28
29
# File 'lib/oci/recovery/models/metrics.rb', line 27

def db_size_in_gbs
  @db_size_in_gbs
end

#is_redo_logs_enabledBOOLEAN

The value TRUE indicates that the protected database is configured to use Real-time data protection, and redo-data is sent from the protected database to Recovery Service. Real-time data protection substantially reduces the window of potential data loss that exists between successive archived redo log backups.

Returns:

  • (BOOLEAN)


33
34
35
# File 'lib/oci/recovery/models/metrics.rb', line 33

def is_redo_logs_enabled
  @is_redo_logs_enabled
end

#minimum_recovery_needed_in_daysFloat

Number of days of redo/archive to be applied to recover database.

Returns:

  • (Float)


45
46
47
# File 'lib/oci/recovery/models/metrics.rb', line 45

def minimum_recovery_needed_in_days
  @minimum_recovery_needed_in_days
end

#retention_period_in_daysFloat

The maximum number of days to retain backups for a protected database.

Returns:

  • (Float)


37
38
39
# File 'lib/oci/recovery/models/metrics.rb', line 37

def retention_period_in_days
  @retention_period_in_days
end

#unprotected_window_in_secondsFloat

This is the time window when there is data loss exposure. The point after which recovery is impossible unless additional redo is available. This is the time we received the last backup or last redo-log shipped.

Returns:

  • (Float)


23
24
25
# File 'lib/oci/recovery/models/metrics.rb', line 23

def unprotected_window_in_seconds
  @unprotected_window_in_seconds
end

Class Method Details

.attribute_mapObject

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



48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/recovery/models/metrics.rb', line 48

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'backup_space_used_in_gbs': :'backupSpaceUsedInGBs',
    'backup_space_estimate_in_gbs': :'backupSpaceEstimateInGBs',
    'unprotected_window_in_seconds': :'unprotectedWindowInSeconds',
    'db_size_in_gbs': :'dbSizeInGBs',
    'is_redo_logs_enabled': :'isRedoLogsEnabled',
    'retention_period_in_days': :'retentionPeriodInDays',
    'current_retention_period_in_seconds': :'currentRetentionPeriodInSeconds',
    'minimum_recovery_needed_in_days': :'minimumRecoveryNeededInDays'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/oci/recovery/models/metrics.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'backup_space_used_in_gbs': :'Float',
    'backup_space_estimate_in_gbs': :'Float',
    'unprotected_window_in_seconds': :'Float',
    'db_size_in_gbs': :'Float',
    'is_redo_logs_enabled': :'BOOLEAN',
    'retention_period_in_days': :'Float',
    'current_retention_period_in_seconds': :'Float',
    'minimum_recovery_needed_in_days': :'Float'
    # 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



155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/recovery/models/metrics.rb', line 155

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

  self.class == other.class &&
    backup_space_used_in_gbs == other.backup_space_used_in_gbs &&
    backup_space_estimate_in_gbs == other.backup_space_estimate_in_gbs &&
    unprotected_window_in_seconds == other.unprotected_window_in_seconds &&
    db_size_in_gbs == other.db_size_in_gbs &&
    is_redo_logs_enabled == other.is_redo_logs_enabled &&
    retention_period_in_days == other.retention_period_in_days &&
    current_retention_period_in_seconds == other.current_retention_period_in_seconds &&
    minimum_recovery_needed_in_days == other.minimum_recovery_needed_in_days
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



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/oci/recovery/models/metrics.rb', line 192

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


172
173
174
# File 'lib/oci/recovery/models/metrics.rb', line 172

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



181
182
183
# File 'lib/oci/recovery/models/metrics.rb', line 181

def hash
  [backup_space_used_in_gbs, backup_space_estimate_in_gbs, unprotected_window_in_seconds, db_size_in_gbs, is_redo_logs_enabled, retention_period_in_days, current_retention_period_in_seconds, minimum_recovery_needed_in_days].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



225
226
227
228
229
230
231
232
233
234
# File 'lib/oci/recovery/models/metrics.rb', line 225

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



219
220
221
# File 'lib/oci/recovery/models/metrics.rb', line 219

def to_s
  to_hash.to_s
end