Class: OCI::DatabaseManagement::Models::AwrDbSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/awr_db_summary.rb

Overview

The AWR summary for a database.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AwrDbSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :awr_db_id (String)

    The value to assign to the #awr_db_id property

  • :db_name (String)

    The value to assign to the #db_name property

  • :instance_list (Array<Integer>)

    The value to assign to the #instance_list property

  • :time_db_startup (DateTime)

    The value to assign to the #time_db_startup property

  • :time_first_snapshot_begin (DateTime)

    The value to assign to the #time_first_snapshot_begin property

  • :time_latest_snapshot_end (DateTime)

    The value to assign to the #time_latest_snapshot_end property

  • :first_snapshot_id (Integer)

    The value to assign to the #first_snapshot_id property

  • :latest_snapshot_id (Integer)

    The value to assign to the #latest_snapshot_id property

  • :snapshot_count (Integer)

    The value to assign to the #snapshot_count property

  • :snapshot_interval_in_min (Integer)

    The value to assign to the #snapshot_interval_in_min property

  • :container_id (Integer)

    The value to assign to the #container_id property

  • :db_version (String)

    The value to assign to the #db_version property

  • :snapshot_timezone (String)

    The value to assign to the #snapshot_timezone property



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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
216
217
218
219
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 136

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

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

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

  self.db_name = attributes[:'dbName'] if attributes[:'dbName']

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

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

  self.instance_list = attributes[:'instanceList'] if attributes[:'instanceList']

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

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

  self.time_db_startup = attributes[:'timeDbStartup'] if attributes[:'timeDbStartup']

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

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

  self.time_first_snapshot_begin = attributes[:'timeFirstSnapshotBegin'] if attributes[:'timeFirstSnapshotBegin']

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

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

  self.time_latest_snapshot_end = attributes[:'timeLatestSnapshotEnd'] if attributes[:'timeLatestSnapshotEnd']

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

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

  self.first_snapshot_id = attributes[:'firstSnapshotId'] if attributes[:'firstSnapshotId']

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

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

  self.latest_snapshot_id = attributes[:'latestSnapshotId'] if attributes[:'latestSnapshotId']

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

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

  self.snapshot_count = attributes[:'snapshotCount'] if attributes[:'snapshotCount']

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

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

  self.snapshot_interval_in_min = attributes[:'snapshotIntervalInMin'] if attributes[:'snapshotIntervalInMin']

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

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

  self.container_id = attributes[:'containerId'] if attributes[:'containerId']

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

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

  self.db_version = attributes[:'dbVersion'] if attributes[:'dbVersion']

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

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

  self.snapshot_timezone = attributes[:'snapshotTimezone'] if attributes[:'snapshotTimezone']

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

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

Instance Attribute Details

#awr_db_idString

[Required] The internal ID of the database. The internal ID of the database is not the OCID. It can be retrieved from the following endpoint: /managedDatabases/managedDatabaseId/awrDbs

Returns:

  • (String)


16
17
18
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 16

def awr_db_id
  @awr_db_id
end

#container_idInteger

ID of the database container. The database container ID is not the OCID. It can be retrieved from the following endpoint: /managedDatabases/managedDatabaseId/awrDbSnapshotRanges

Returns:

  • (Integer)


65
66
67
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 65

def container_id
  @container_id
end

#db_nameString

[Required] The name of the database.

Returns:

  • (String)


20
21
22
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 20

def db_name
  @db_name
end

#db_versionString

The version of the database.

Returns:

  • (String)


69
70
71
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 69

def db_version
  @db_version
end

#first_snapshot_idInteger

The ID of the earliest snapshot. The snapshot ID is not the OCID. It can be retrieved from the following endpoint: /managedDatabases/managedDatabaseId/awrDbs/awrDbId/awrDbSnapshots

Returns:

  • (Integer)


43
44
45
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 43

def first_snapshot_id
  @first_snapshot_id
end

#instance_listArray<Integer>

The database instance numbers.

Returns:

  • (Array<Integer>)


24
25
26
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 24

def instance_list
  @instance_list
end

#latest_snapshot_idInteger

The ID of the latest snapshot. The snapshot ID is not the OCID. It can be retrieved from the following endpoint: /managedDatabases/managedDatabaseId/awrDbs/awrDbId/awrDbSnapshots

Returns:

  • (Integer)


50
51
52
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 50

def latest_snapshot_id
  @latest_snapshot_id
end

#snapshot_countInteger

The total number of snapshots.

Returns:

  • (Integer)


54
55
56
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 54

def snapshot_count
  @snapshot_count
end

#snapshot_interval_in_minInteger

The interval time between snapshots (in minutes).

Returns:

  • (Integer)


58
59
60
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 58

def snapshot_interval_in_min
  @snapshot_interval_in_min
end

#snapshot_timezoneString

The time zone of the snapshot.

Returns:

  • (String)


73
74
75
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 73

def snapshot_timezone
  @snapshot_timezone
end

#time_db_startupDateTime

The timestamp of the database startup.

Returns:

  • (DateTime)


28
29
30
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 28

def time_db_startup
  @time_db_startup
end

#time_first_snapshot_beginDateTime

The start time of the earliest snapshot.

Returns:

  • (DateTime)


32
33
34
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 32

def time_first_snapshot_begin
  @time_first_snapshot_begin
end

#time_latest_snapshot_endDateTime

The end time of the latest snapshot.

Returns:

  • (DateTime)


36
37
38
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 36

def time_latest_snapshot_end
  @time_latest_snapshot_end
end

Class Method Details

.attribute_mapObject

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



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 76

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'awr_db_id': :'awrDbId',
    'db_name': :'dbName',
    'instance_list': :'instanceList',
    'time_db_startup': :'timeDbStartup',
    'time_first_snapshot_begin': :'timeFirstSnapshotBegin',
    'time_latest_snapshot_end': :'timeLatestSnapshotEnd',
    'first_snapshot_id': :'firstSnapshotId',
    'latest_snapshot_id': :'latestSnapshotId',
    'snapshot_count': :'snapshotCount',
    'snapshot_interval_in_min': :'snapshotIntervalInMin',
    'container_id': :'containerId',
    'db_version': :'dbVersion',
    'snapshot_timezone': :'snapshotTimezone'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 97

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'awr_db_id': :'String',
    'db_name': :'String',
    'instance_list': :'Array<Integer>',
    'time_db_startup': :'DateTime',
    'time_first_snapshot_begin': :'DateTime',
    'time_latest_snapshot_end': :'DateTime',
    'first_snapshot_id': :'Integer',
    'latest_snapshot_id': :'Integer',
    'snapshot_count': :'Integer',
    'snapshot_interval_in_min': :'Integer',
    'container_id': :'Integer',
    'db_version': :'String',
    'snapshot_timezone': :'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



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 228

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

  self.class == other.class &&
    awr_db_id == other.awr_db_id &&
    db_name == other.db_name &&
    instance_list == other.instance_list &&
    time_db_startup == other.time_db_startup &&
    time_first_snapshot_begin == other.time_first_snapshot_begin &&
    time_latest_snapshot_end == other.time_latest_snapshot_end &&
    first_snapshot_id == other.first_snapshot_id &&
    latest_snapshot_id == other.latest_snapshot_id &&
    snapshot_count == other.snapshot_count &&
    snapshot_interval_in_min == other.snapshot_interval_in_min &&
    container_id == other.container_id &&
    db_version == other.db_version &&
    snapshot_timezone == other.snapshot_timezone
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



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 270

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


250
251
252
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 250

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



259
260
261
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 259

def hash
  [awr_db_id, db_name, instance_list, time_db_startup, time_first_snapshot_begin, time_latest_snapshot_end, first_snapshot_id, latest_snapshot_id, snapshot_count, snapshot_interval_in_min, container_id, db_version, snapshot_timezone].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



303
304
305
306
307
308
309
310
311
312
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 303

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



297
298
299
# File 'lib/oci/database_management/models/awr_db_summary.rb', line 297

def to_s
  to_hash.to_s
end