Class: OCI::Optimizer::Models::HistorySummary
- Inherits:
-
Object
- Object
- OCI::Optimizer::Models::HistorySummary
- Defined in:
- lib/oci/optimizer/models/history_summary.rb
Overview
The metadata associated with the recommendation history and its related resources.
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze, LIFECYCLE_STATE_ATTACHING = 'ATTACHING'.freeze, LIFECYCLE_STATE_DETACHING = 'DETACHING'.freeze, LIFECYCLE_STATE_DELETING = 'DELETING'.freeze, LIFECYCLE_STATE_DELETED = 'DELETED'.freeze, LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze, LIFECYCLE_STATE_CREATING = 'CREATING'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- STATUS_ENUM =
[ STATUS_PENDING = 'PENDING'.freeze, STATUS_DISMISSED = 'DISMISSED'.freeze, STATUS_POSTPONED = 'POSTPONED'.freeze, STATUS_IMPLEMENTED = 'IMPLEMENTED'.freeze, STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#action ⇒ OCI::Optimizer::Models::Action
This attribute is required.
-
#category_id ⇒ String
**[Required]** The unique OCID associated with the category.
-
#compartment_id ⇒ String
**[Required]** The OCID of the compartment.
-
#compartment_name ⇒ String
**[Required]** The name assigned to the compartment.
-
#estimated_cost_saving ⇒ Float
**[Required]** The estimated cost savings, in dollars, for the resource action.
-
#extended_metadata ⇒ Hash<String, Object>
Additional metadata key/value pairs that you provide.
-
#id ⇒ String
**[Required]** The unique OCID associated with the recommendation history.
-
#lifecycle_state ⇒ String
**[Required]** The recommendation history's current state.
-
#metadata ⇒ Hash<String, String>
Custom metadata key/value pairs for the resource action.
-
#name ⇒ String
**[Required]** The name assigned to the resource.
-
#recommendation_id ⇒ String
**[Required]** The unique OCID associated with the recommendation.
-
#recommendation_name ⇒ String
**[Required]** The name assigned to the recommendation.
-
#resource_action_id ⇒ String
**[Required]** The unique OCID associated with the resource action.
-
#resource_id ⇒ String
**[Required]** The unique OCID associated with the resource.
-
#resource_type ⇒ String
**[Required]** The kind of resource.
-
#status ⇒ String
**[Required]** The current status of the resource action.
-
#time_created ⇒ DateTime
The date and time the recommendation history was created, in the format defined by RFC3339.
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 = {}) ⇒ HistorySummary
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 = {}) ⇒ HistorySummary
Initializes the object
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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 194 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.name = attributes[:'name'] if attributes[:'name'] self.resource_type = attributes[:'resourceType'] if attributes[:'resourceType'] raise 'You cannot provide both :resourceType and :resource_type' if attributes.key?(:'resourceType') && attributes.key?(:'resource_type') self.resource_type = attributes[:'resource_type'] if attributes[:'resource_type'] self.category_id = attributes[:'categoryId'] if attributes[:'categoryId'] raise 'You cannot provide both :categoryId and :category_id' if attributes.key?(:'categoryId') && attributes.key?(:'category_id') self.category_id = attributes[:'category_id'] if attributes[:'category_id'] self.recommendation_id = attributes[:'recommendationId'] if attributes[:'recommendationId'] raise 'You cannot provide both :recommendationId and :recommendation_id' if attributes.key?(:'recommendationId') && attributes.key?(:'recommendation_id') self.recommendation_id = attributes[:'recommendation_id'] if attributes[:'recommendation_id'] self.recommendation_name = attributes[:'recommendationName'] if attributes[:'recommendationName'] raise 'You cannot provide both :recommendationName and :recommendation_name' if attributes.key?(:'recommendationName') && attributes.key?(:'recommendation_name') self.recommendation_name = attributes[:'recommendation_name'] if attributes[:'recommendation_name'] self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId'] raise 'You cannot provide both :resourceId and :resource_id' if attributes.key?(:'resourceId') && attributes.key?(:'resource_id') self.resource_id = attributes[:'resource_id'] if attributes[:'resource_id'] self.resource_action_id = attributes[:'resourceActionId'] if attributes[:'resourceActionId'] raise 'You cannot provide both :resourceActionId and :resource_action_id' if attributes.key?(:'resourceActionId') && attributes.key?(:'resource_action_id') self.resource_action_id = attributes[:'resource_action_id'] if attributes[:'resource_action_id'] self.action = attributes[:'action'] if attributes[:'action'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.compartment_name = attributes[:'compartmentName'] if attributes[:'compartmentName'] raise 'You cannot provide both :compartmentName and :compartment_name' if attributes.key?(:'compartmentName') && attributes.key?(:'compartment_name') self.compartment_name = attributes[:'compartment_name'] if attributes[:'compartment_name'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] self.estimated_cost_saving = attributes[:'estimatedCostSaving'] if attributes[:'estimatedCostSaving'] raise 'You cannot provide both :estimatedCostSaving and :estimated_cost_saving' if attributes.key?(:'estimatedCostSaving') && attributes.key?(:'estimated_cost_saving') self.estimated_cost_saving = attributes[:'estimated_cost_saving'] if attributes[:'estimated_cost_saving'] self.status = attributes[:'status'] if attributes[:'status'] self. = attributes[:'metadata'] if attributes[:'metadata'] self. = attributes[:'extendedMetadata'] if attributes[:'extendedMetadata'] raise 'You cannot provide both :extendedMetadata and :extended_metadata' if attributes.key?(:'extendedMetadata') && attributes.key?(:'extended_metadata') self. = attributes[:'extended_metadata'] if attributes[:'extended_metadata'] self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] end |
Instance Attribute Details
#action ⇒ OCI::Optimizer::Models::Action
This attribute is required.
67 68 69 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 67 def action @action end |
#category_id ⇒ String
**[Required]** The unique OCID associated with the category.
47 48 49 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 47 def category_id @category_id end |
#compartment_id ⇒ String
**[Required]** The OCID of the compartment.
71 72 73 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 71 def compartment_id @compartment_id end |
#compartment_name ⇒ String
**[Required]** The name assigned to the compartment.
75 76 77 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 75 def compartment_name @compartment_name end |
#estimated_cost_saving ⇒ Float
**[Required]** The estimated cost savings, in dollars, for the resource action.
83 84 85 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 83 def estimated_cost_saving @estimated_cost_saving end |
#extended_metadata ⇒ Hash<String, Object>
Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the `metadata` object.
They are distinguished from `metadata` fields in that these can be nested JSON objects (whereas `metadata` fields are string/string maps only).
For example:
`{"name":"VM.Standard2.16", "RecommendedShape": OCI::Optimizer::Models::HistorySummary."name":"VM"name":"VM.Standard2"name":"VM.Standard2.8"}`
115 116 117 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 115 def @extended_metadata end |
#id ⇒ String
**[Required]** The unique OCID associated with the recommendation history.
35 36 37 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 35 def id @id end |
#lifecycle_state ⇒ String
**[Required]** The recommendation history's current state.
79 80 81 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 79 def lifecycle_state @lifecycle_state end |
#metadata ⇒ Hash<String, String>
Custom metadata key/value pairs for the resource action.
**Metadata Example**
\"metadata\" : {
\"cpuRecommendedShape\": \"VM.Standard1.1\",
\"computeMemoryUtilization\": \"26.05734124418388\",
\"currentShape\": \"VM.Standard1.2\",
\"instanceRecommendedShape\": \"VM.Standard1.1\",
\"computeCpuUtilization\": \"7.930035319720132\",
\"memoryRecommendedShape\": \"None\"
}
103 104 105 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 103 def @metadata end |
#name ⇒ String
**[Required]** The name assigned to the resource.
39 40 41 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 39 def name @name end |
#recommendation_id ⇒ String
**[Required]** The unique OCID associated with the recommendation.
51 52 53 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 51 def recommendation_id @recommendation_id end |
#recommendation_name ⇒ String
**[Required]** The name assigned to the recommendation.
55 56 57 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 55 def recommendation_name @recommendation_name end |
#resource_action_id ⇒ String
**[Required]** The unique OCID associated with the resource action.
63 64 65 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 63 def resource_action_id @resource_action_id end |
#resource_id ⇒ String
**[Required]** The unique OCID associated with the resource.
59 60 61 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 59 def resource_id @resource_id end |
#resource_type ⇒ String
**[Required]** The kind of resource.
43 44 45 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 43 def resource_type @resource_type end |
#status ⇒ String
**[Required]** The current status of the resource action.
87 88 89 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 87 def status @status end |
#time_created ⇒ DateTime
The date and time the recommendation history was created, in the format defined by RFC3339.
119 120 121 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 119 def time_created @time_created end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 122 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'name': :'name', 'resource_type': :'resourceType', 'category_id': :'categoryId', 'recommendation_id': :'recommendationId', 'recommendation_name': :'recommendationName', 'resource_id': :'resourceId', 'resource_action_id': :'resourceActionId', 'action': :'action', 'compartment_id': :'compartmentId', 'compartment_name': :'compartmentName', 'lifecycle_state': :'lifecycleState', 'estimated_cost_saving': :'estimatedCostSaving', 'status': :'status', 'metadata': :'metadata', 'extended_metadata': :'extendedMetadata', 'time_created': :'timeCreated' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 147 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'name': :'String', 'resource_type': :'String', 'category_id': :'String', 'recommendation_id': :'String', 'recommendation_name': :'String', 'resource_id': :'String', 'resource_action_id': :'String', 'action': :'OCI::Optimizer::Models::Action', 'compartment_id': :'String', 'compartment_name': :'String', 'lifecycle_state': :'String', 'estimated_cost_saving': :'Float', 'status': :'String', 'metadata': :'Hash<String, String>', 'extended_metadata': :'Hash<String, Object>', 'time_created': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 316 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && name == other.name && resource_type == other.resource_type && category_id == other.category_id && recommendation_id == other.recommendation_id && recommendation_name == other.recommendation_name && resource_id == other.resource_id && resource_action_id == other.resource_action_id && action == other.action && compartment_id == other.compartment_id && compartment_name == other.compartment_name && lifecycle_state == other.lifecycle_state && estimated_cost_saving == other.estimated_cost_saving && status == other.status && == other. && == other. && time_created == other.time_created end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 362 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
342 343 344 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 342 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
351 352 353 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 351 def hash [id, name, resource_type, category_id, recommendation_id, recommendation_name, resource_id, resource_action_id, action, compartment_id, compartment_name, lifecycle_state, estimated_cost_saving, status, , , time_created].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
395 396 397 398 399 400 401 402 403 404 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 395 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
389 390 391 |
# File 'lib/oci/optimizer/models/history_summary.rb', line 389 def to_s to_hash.to_s end |