Class: OCI::Recovery::Models::MetricsSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/recovery/models/metrics_summary.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 = {}) ⇒ MetricsSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



86
87
88
89
90
91
92
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
# File 'lib/oci/recovery/models/metrics_summary.rb', line 86

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']
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_summary.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_summary.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_summary.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_summary.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_summary.rb', line 33

def is_redo_logs_enabled
  @is_redo_logs_enabled
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_summary.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_summary.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.



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/oci/recovery/models/metrics_summary.rb', line 44

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'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/oci/recovery/models/metrics_summary.rb', line 59

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'
    # 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



142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/oci/recovery/models/metrics_summary.rb', line 142

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



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/recovery/models/metrics_summary.rb', line 178

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


158
159
160
# File 'lib/oci/recovery/models/metrics_summary.rb', line 158

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



167
168
169
# File 'lib/oci/recovery/models/metrics_summary.rb', line 167

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].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



211
212
213
214
215
216
217
218
219
220
# File 'lib/oci/recovery/models/metrics_summary.rb', line 211

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



205
206
207
# File 'lib/oci/recovery/models/metrics_summary.rb', line 205

def to_s
  to_hash.to_s
end