Class: OCI::Opsi::Models::AddmDbRecommendationAggregation
- Inherits:
-
Object
- Object
- OCI::Opsi::Models::AddmDbRecommendationAggregation
- Defined in:
- lib/oci/opsi/models/addm_db_recommendation_aggregation.rb
Overview
Summarizes a specific ADDM recommendation
Instance Attribute Summary collapse
-
#frequency_count ⇒ Integer
Number of occurrences for this recommendation.
-
#id ⇒ String
[Required] The OCID of the Database insight.
-
#implement_actions ⇒ Array<String>
Actions that can be performed to implement the recommendation (such as 'ALTER PARAMETER', 'RUN SQL TUNING ADVISOR').
-
#max_benefit_avg_active_sessions ⇒ Float
Maximum estimated benefit in terms of average active sessions.
-
#max_benefit_percent ⇒ Float
Maximum estimated benefit in terms of percentage of total activity.
-
#message ⇒ String
[Required] Recommendation message.
-
#overall_benefit_percent ⇒ Float
Overall estimated benefit in terms of percentage of total activity.
-
#rationale ⇒ String
Recommendation message.
- #related_object ⇒ OCI::Opsi::Models::RelatedObjectTypeDetails
-
#requires_db_restart ⇒ String
Indicates implementation of the recommended action requires a database restart in order for it to take effect.
-
#type ⇒ String
Type of recommendation.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.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 = {}) ⇒ AddmDbRecommendationAggregation
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 = {}) ⇒ AddmDbRecommendationAggregation
Initializes the object
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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 113 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.id = attributes[:'id'] if attributes[:'id'] self.type = attributes[:'type'] if attributes[:'type'] self. = attributes[:'message'] if attributes[:'message'] self.requires_db_restart = attributes[:'requiresDbRestart'] if attributes[:'requiresDbRestart'] raise 'You cannot provide both :requiresDbRestart and :requires_db_restart' if attributes.key?(:'requiresDbRestart') && attributes.key?(:'requires_db_restart') self.requires_db_restart = attributes[:'requires_db_restart'] if attributes[:'requires_db_restart'] self.implement_actions = attributes[:'implementActions'] if attributes[:'implementActions'] raise 'You cannot provide both :implementActions and :implement_actions' if attributes.key?(:'implementActions') && attributes.key?(:'implement_actions') self.implement_actions = attributes[:'implement_actions'] if attributes[:'implement_actions'] self.rationale = attributes[:'rationale'] if attributes[:'rationale'] self.max_benefit_percent = attributes[:'maxBenefitPercent'] if attributes[:'maxBenefitPercent'] raise 'You cannot provide both :maxBenefitPercent and :max_benefit_percent' if attributes.key?(:'maxBenefitPercent') && attributes.key?(:'max_benefit_percent') self.max_benefit_percent = attributes[:'max_benefit_percent'] if attributes[:'max_benefit_percent'] self.overall_benefit_percent = attributes[:'overallBenefitPercent'] if attributes[:'overallBenefitPercent'] raise 'You cannot provide both :overallBenefitPercent and :overall_benefit_percent' if attributes.key?(:'overallBenefitPercent') && attributes.key?(:'overall_benefit_percent') self.overall_benefit_percent = attributes[:'overall_benefit_percent'] if attributes[:'overall_benefit_percent'] self.max_benefit_avg_active_sessions = attributes[:'maxBenefitAvgActiveSessions'] if attributes[:'maxBenefitAvgActiveSessions'] raise 'You cannot provide both :maxBenefitAvgActiveSessions and :max_benefit_avg_active_sessions' if attributes.key?(:'maxBenefitAvgActiveSessions') && attributes.key?(:'max_benefit_avg_active_sessions') self.max_benefit_avg_active_sessions = attributes[:'max_benefit_avg_active_sessions'] if attributes[:'max_benefit_avg_active_sessions'] self.frequency_count = attributes[:'frequencyCount'] if attributes[:'frequencyCount'] raise 'You cannot provide both :frequencyCount and :frequency_count' if attributes.key?(:'frequencyCount') && attributes.key?(:'frequency_count') self.frequency_count = attributes[:'frequency_count'] if attributes[:'frequency_count'] self. = attributes[:'relatedObject'] if attributes[:'relatedObject'] raise 'You cannot provide both :relatedObject and :related_object' if attributes.key?(:'relatedObject') && attributes.key?(:'related_object') self. = attributes[:'related_object'] if attributes[:'related_object'] end |
Instance Attribute Details
#frequency_count ⇒ Integer
Number of occurrences for this recommendation
53 54 55 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 53 def frequency_count @frequency_count end |
#id ⇒ String
[Required] The OCID of the Database insight.
13 14 15 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 13 def id @id end |
#implement_actions ⇒ Array<String>
Actions that can be performed to implement the recommendation (such as 'ALTER PARAMETER', 'RUN SQL TUNING ADVISOR')
33 34 35 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 33 def implement_actions @implement_actions end |
#max_benefit_avg_active_sessions ⇒ Float
Maximum estimated benefit in terms of average active sessions
49 50 51 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 49 def max_benefit_avg_active_sessions @max_benefit_avg_active_sessions end |
#max_benefit_percent ⇒ Float
Maximum estimated benefit in terms of percentage of total activity
41 42 43 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 41 def max_benefit_percent @max_benefit_percent end |
#message ⇒ String
[Required] Recommendation message
21 22 23 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 21 def @message end |
#overall_benefit_percent ⇒ Float
Overall estimated benefit in terms of percentage of total activity
45 46 47 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 45 def overall_benefit_percent @overall_benefit_percent end |
#rationale ⇒ String
Recommendation message
37 38 39 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 37 def rationale @rationale end |
#related_object ⇒ OCI::Opsi::Models::RelatedObjectTypeDetails
56 57 58 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 56 def @related_object end |
#requires_db_restart ⇒ String
Indicates implementation of the recommended action requires a database restart in order for it to take effect. Possible values "Y", "N" and null.
27 28 29 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 27 def requires_db_restart @requires_db_restart end |
#type ⇒ String
Type of recommendation
17 18 19 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 17 def type @type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 59 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'type': :'type', 'message': :'message', 'requires_db_restart': :'requiresDbRestart', 'implement_actions': :'implementActions', 'rationale': :'rationale', 'max_benefit_percent': :'maxBenefitPercent', 'overall_benefit_percent': :'overallBenefitPercent', 'max_benefit_avg_active_sessions': :'maxBenefitAvgActiveSessions', 'frequency_count': :'frequencyCount', 'related_object': :'relatedObject' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 78 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'type': :'String', 'message': :'String', 'requires_db_restart': :'String', 'implement_actions': :'Array<String>', 'rationale': :'String', 'max_benefit_percent': :'Float', 'overall_benefit_percent': :'Float', 'max_benefit_avg_active_sessions': :'Float', 'frequency_count': :'Integer', 'related_object': :'OCI::Opsi::Models::RelatedObjectTypeDetails' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 177 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && type == other.type && == other. && requires_db_restart == other.requires_db_restart && implement_actions == other.implement_actions && rationale == other.rationale && max_benefit_percent == other.max_benefit_percent && overall_benefit_percent == other.overall_benefit_percent && max_benefit_avg_active_sessions == other.max_benefit_avg_active_sessions && frequency_count == other.frequency_count && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 217 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
197 198 199 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 197 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
206 207 208 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 206 def hash [id, type, , requires_db_restart, implement_actions, rationale, max_benefit_percent, overall_benefit_percent, max_benefit_avg_active_sessions, frequency_count, ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
250 251 252 253 254 255 256 257 258 259 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 250 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
244 245 246 |
# File 'lib/oci/opsi/models/addm_db_recommendation_aggregation.rb', line 244 def to_s to_hash.to_s end |