Class: OCI::DatabaseManagement::Models::OptimizerStatisticsCollectionOperation

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

Overview

The summary of the Optimizer Statistics Collection tasks, which includes details of the Managed Database and the execution.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  STATUS_COMPLETED = 'COMPLETED'.freeze,
  STATUS_FAILED = 'FAILED'.freeze,
  STATUS_TIMED_OUT = 'TIMED_OUT'.freeze,
  STATUS_UNKNOWN = 'UNKNOWN'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OptimizerStatisticsCollectionOperation

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
220
221
222
223
224
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 149

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

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

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

  self.operation_name = attributes[:'operationName'] if attributes[:'operationName']

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

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

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

  self.job_name = attributes[:'jobName'] if attributes[:'jobName']

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

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

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

  self.start_time = attributes[:'startTime'] if attributes[:'startTime']

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

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

  self.end_time = attributes[:'endTime'] if attributes[:'endTime']

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

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

  self.duration_in_seconds = attributes[:'durationInSeconds'] if attributes[:'durationInSeconds']

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

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

  self.completed_count = attributes[:'completedCount'] if attributes[:'completedCount']

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

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

  self.in_progress_count = attributes[:'inProgressCount'] if attributes[:'inProgressCount']

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

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

  self.failed_count = attributes[:'failedCount'] if attributes[:'failedCount']

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

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

  self.timed_out_count = attributes[:'timedOutCount'] if attributes[:'timedOutCount']

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

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

  self.total_objects_count = attributes[:'totalObjectsCount'] if attributes[:'totalObjectsCount']

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

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

Instance Attribute Details

#completed_countInteger

The number of objects for which statistics collection is completed.

Returns:

  • (Integer)


62
63
64
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 62

def completed_count
  @completed_count
end

#databaseOCI::DatabaseManagement::Models::OptimizerDatabase



22
23
24
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 22

def database
  @database
end

#duration_in_secondsFloat

[Required] The time it takes to complete the operation (in seconds).

Returns:

  • (Float)


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

def duration_in_seconds
  @duration_in_seconds
end

#end_timeString

[Required] The end time of the operation.

Returns:

  • (String)


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

def end_time
  @end_time
end

#failed_countInteger

The number of objects for which statistics collection failed.

Returns:

  • (Integer)


70
71
72
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 70

def failed_count
  @failed_count
end

#idInteger

[Required] The ID of the operation.

Returns:

  • (Integer)


30
31
32
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 30

def id
  @id
end

#in_progress_countInteger

The number of objects for which statistics collection is in progress.

Returns:

  • (Integer)


66
67
68
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 66

def in_progress_count
  @in_progress_count
end

#job_nameString

[Required] The name of the job.

Returns:

  • (String)


42
43
44
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 42

def job_name
  @job_name
end

#operation_nameString

[Required] The name of the operation.

Returns:

  • (String)


34
35
36
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 34

def operation_name
  @operation_name
end

#start_timeString

[Required] The start time of the operation.

Returns:

  • (String)


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

def start_time
  @start_time
end

#statusString

[Required] The status of the operation such as Completed, and Failed.

Returns:

  • (String)


46
47
48
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 46

def status
  @status
end

#targetString

[Required] The target object type such as Table, Index, and Partition.

Returns:

  • (String)


38
39
40
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 38

def target
  @target
end

#tasksArray<OCI::DatabaseManagement::Models::OptimizerStatisticsOperationTask>

An array of Optimizer Statistics Collection task details.



26
27
28
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 26

def tasks
  @tasks
end

#timed_out_countInteger

The number of objects for which statistics collection timed out.

Returns:

  • (Integer)


74
75
76
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 74

def timed_out_count
  @timed_out_count
end

#total_objects_countInteger

The total number of objects for which statistics is collected. This number is the sum of all the objects with various statuses: completed, inProgress, failed, and timedOut.

Returns:

  • (Integer)


80
81
82
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 80

def total_objects_count
  @total_objects_count
end

Class Method Details

.attribute_mapObject

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



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 83

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'database': :'database',
    'tasks': :'tasks',
    'id': :'id',
    'operation_name': :'operationName',
    'target': :'target',
    'job_name': :'jobName',
    'status': :'status',
    'start_time': :'startTime',
    'end_time': :'endTime',
    'duration_in_seconds': :'durationInSeconds',
    'completed_count': :'completedCount',
    'in_progress_count': :'inProgressCount',
    'failed_count': :'failedCount',
    'timed_out_count': :'timedOutCount',
    'total_objects_count': :'totalObjectsCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 106

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'database': :'OCI::DatabaseManagement::Models::OptimizerDatabase',
    'tasks': :'Array<OCI::DatabaseManagement::Models::OptimizerStatisticsOperationTask>',
    'id': :'Integer',
    'operation_name': :'String',
    'target': :'String',
    'job_name': :'String',
    'status': :'String',
    'start_time': :'String',
    'end_time': :'String',
    'duration_in_seconds': :'Float',
    'completed_count': :'Integer',
    'in_progress_count': :'Integer',
    'failed_count': :'Integer',
    'timed_out_count': :'Integer',
    'total_objects_count': :'Integer'
    # 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



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 246

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

  self.class == other.class &&
    database == other.database &&
    tasks == other.tasks &&
    id == other.id &&
    operation_name == other.operation_name &&
    target == other.target &&
    job_name == other.job_name &&
    status == other.status &&
    start_time == other.start_time &&
    end_time == other.end_time &&
    duration_in_seconds == other.duration_in_seconds &&
    completed_count == other.completed_count &&
    in_progress_count == other.in_progress_count &&
    failed_count == other.failed_count &&
    timed_out_count == other.timed_out_count &&
    total_objects_count == other.total_objects_count
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



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 290

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


270
271
272
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 270

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



279
280
281
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 279

def hash
  [database, tasks, id, operation_name, target, job_name, status, start_time, end_time, duration_in_seconds, completed_count, in_progress_count, failed_count, timed_out_count, total_objects_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



323
324
325
326
327
328
329
330
331
332
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 323

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



317
318
319
# File 'lib/oci/database_management/models/optimizer_statistics_collection_operation.rb', line 317

def to_s
  to_hash.to_s
end