Class: OCI::DatabaseManagement::Models::AwrQueryResult
- Inherits:
-
Object
- Object
- OCI::DatabaseManagement::Models::AwrQueryResult
- Defined in:
- lib/oci/database_management/models/awr_query_result.rb
Overview
The AWR query result. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
Direct Known Subclasses
AwrDbCollection, AwrDbCpuUsageCollection, AwrDbMetricCollection, AwrDbParameterChangeCollection, AwrDbParameterCollection, AwrDbReport, AwrDbSnapshotCollection, AwrDbSnapshotRangeCollection, AwrDbSqlReport, AwrDbSysstatCollection, AwrDbTopWaitEventCollection, AwrDbWaitEventBucketCollection, AwrDbWaitEventCollection
Constant Summary collapse
- AWR_RESULT_TYPE_ENUM =
[ AWR_RESULT_TYPE_AWRDB_SET = 'AWRDB_SET'.freeze, AWR_RESULT_TYPE_AWRDB_SNAPSHOT_RANGE_SET = 'AWRDB_SNAPSHOT_RANGE_SET'.freeze, AWR_RESULT_TYPE_AWRDB_SNAPSHOT_SET = 'AWRDB_SNAPSHOT_SET'.freeze, AWR_RESULT_TYPE_AWRDB_METRICS_SET = 'AWRDB_METRICS_SET'.freeze, AWR_RESULT_TYPE_AWRDB_SYSSTAT_SET = 'AWRDB_SYSSTAT_SET'.freeze, AWR_RESULT_TYPE_AWRDB_TOP_EVENT_SET = 'AWRDB_TOP_EVENT_SET'.freeze, AWR_RESULT_TYPE_AWRDB_EVENT_SET = 'AWRDB_EVENT_SET'.freeze, AWR_RESULT_TYPE_AWRDB_EVENT_HISTOGRAM = 'AWRDB_EVENT_HISTOGRAM'.freeze, AWR_RESULT_TYPE_AWRDB_DB_PARAMETER_SET = 'AWRDB_DB_PARAMETER_SET'.freeze, AWR_RESULT_TYPE_AWRDB_DB_PARAMETER_CHANGE = 'AWRDB_DB_PARAMETER_CHANGE'.freeze, AWR_RESULT_TYPE_AWRDB_ASH_CPU_USAGE_SET = 'AWRDB_ASH_CPU_USAGE_SET'.freeze, AWR_RESULT_TYPE_AWRDB_DB_REPORT = 'AWRDB_DB_REPORT'.freeze, AWR_RESULT_TYPE_AWRDB_SQL_REPORT = 'AWRDB_SQL_REPORT'.freeze, AWR_RESULT_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#awr_result_type ⇒ String
[Required] The result type of AWR query.
-
#db_query_time_in_secs ⇒ Float
The time taken to query the database tier (in seconds).
-
#name ⇒ String
[Required] The name of the query result.
-
#query_key ⇒ String
The ID assigned to the query instance.
-
#version ⇒ String
The version of the query result.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AwrQueryResult
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ AwrQueryResult
Initializes the object
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/database_management/models/awr_query_result.rb', line 114 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.name = attributes[:'name'] if attributes[:'name'] self.version = attributes[:'version'] if attributes[:'version'] self.query_key = attributes[:'queryKey'] if attributes[:'queryKey'] raise 'You cannot provide both :queryKey and :query_key' if attributes.key?(:'queryKey') && attributes.key?(:'query_key') self.query_key = attributes[:'query_key'] if attributes[:'query_key'] self.db_query_time_in_secs = attributes[:'dbQueryTimeInSecs'] if attributes[:'dbQueryTimeInSecs'] raise 'You cannot provide both :dbQueryTimeInSecs and :db_query_time_in_secs' if attributes.key?(:'dbQueryTimeInSecs') && attributes.key?(:'db_query_time_in_secs') self.db_query_time_in_secs = attributes[:'db_query_time_in_secs'] if attributes[:'db_query_time_in_secs'] self.awr_result_type = attributes[:'awrResultType'] if attributes[:'awrResultType'] raise 'You cannot provide both :awrResultType and :awr_result_type' if attributes.key?(:'awrResultType') && attributes.key?(:'awr_result_type') self.awr_result_type = attributes[:'awr_result_type'] if attributes[:'awr_result_type'] end |
Instance Attribute Details
#awr_result_type ⇒ String
[Required] The result type of AWR query.
48 49 50 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 48 def awr_result_type @awr_result_type end |
#db_query_time_in_secs ⇒ Float
The time taken to query the database tier (in seconds).
44 45 46 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 44 def db_query_time_in_secs @db_query_time_in_secs end |
#name ⇒ String
[Required] The name of the query result.
32 33 34 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 32 def name @name end |
#query_key ⇒ String
The ID assigned to the query instance.
40 41 42 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 40 def query_key @query_key end |
#version ⇒ String
The version of the query result.
36 37 38 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 36 def version @version end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 51 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'name': :'name', 'version': :'version', 'query_key': :'queryKey', 'db_query_time_in_secs': :'dbQueryTimeInSecs', 'awr_result_type': :'awrResultType' # rubocop:enable Style/SymbolLiteral } end |
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 81 def self.get_subtype(object_hash) type = object_hash[:'awrResultType'] # rubocop:disable Style/SymbolLiteral return 'OCI::DatabaseManagement::Models::AwrDbParameterChangeCollection' if type == 'AWRDB_DB_PARAMETER_CHANGE' return 'OCI::DatabaseManagement::Models::AwrDbCpuUsageCollection' if type == 'AWRDB_ASH_CPU_USAGE_SET' return 'OCI::DatabaseManagement::Models::AwrDbWaitEventBucketCollection' if type == 'AWRDB_EVENT_HISTOGRAM_SET' return 'OCI::DatabaseManagement::Models::AwrDbParameterCollection' if type == 'AWRDB_DB_PARAMETER_SET' return 'OCI::DatabaseManagement::Models::AwrDbSysstatCollection' if type == 'AWRDB_SYSSTAT_SET' return 'OCI::DatabaseManagement::Models::AwrDbTopWaitEventCollection' if type == 'AWRDB_TOP_EVENT_SET' return 'OCI::DatabaseManagement::Models::AwrDbSnapshotCollection' if type == 'AWRDB_SNAPSHOT_SET' return 'OCI::DatabaseManagement::Models::AwrDbCollection' if type == 'AWRDB_SET' return 'OCI::DatabaseManagement::Models::AwrDbSnapshotRangeCollection' if type == 'AWRDB_SNAPSHOT_RANGE_SET' return 'OCI::DatabaseManagement::Models::AwrDbReport' if type == 'AWRDB_DB_REPORT' return 'OCI::DatabaseManagement::Models::AwrDbMetricCollection' if type == 'AWRDB_METRICS_SET' return 'OCI::DatabaseManagement::Models::AwrDbWaitEventCollection' if type == 'AWRDB_EVENT_SET' return 'OCI::DatabaseManagement::Models::AwrDbSqlReport' if type == 'AWRDB_SQL_REPORT' # TODO: Log a warning when the subtype is not found. 'OCI::DatabaseManagement::Models::AwrQueryResult' end |
.swagger_types ⇒ Object
Attribute type mapping.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 64 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'name': :'String', 'version': :'String', 'query_key': :'String', 'db_query_time_in_secs': :'Float', 'awr_result_type': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
163 164 165 166 167 168 169 170 171 172 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 163 def ==(other) return true if equal?(other) self.class == other.class && name == other.name && version == other.version && query_key == other.query_key && db_query_time_in_secs == other.db_query_time_in_secs && awr_result_type == other.awr_result_type end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
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_query_result.rb', line 197 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
177 178 179 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 177 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
186 187 188 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 186 def hash [name, version, query_key, db_query_time_in_secs, awr_result_type].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
230 231 232 233 234 235 236 237 238 239 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 230 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_s ⇒ String
Returns the string representation of the object
224 225 226 |
# File 'lib/oci/database_management/models/awr_query_result.rb', line 224 def to_s to_hash.to_s end |