Class: OCI::Opsi::Models::SummarizeOperationsInsightsWarehouseResourceUsageAggregation

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb

Overview

Details of resource usage by an Operations Insights Warehouse resource.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SummarizeOperationsInsightsWarehouseResourceUsageAggregation

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :cpu_used (Float)

    The value to assign to the #cpu_used property

  • :storage_used_in_gbs (Float)

    The value to assign to the #storage_used_in_gbs property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 74

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

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

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

  self.storage_used_in_gbs = attributes[:'storageUsedInGBs'] if attributes[:'storageUsedInGBs']

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

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

  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']
end

Instance Attribute Details

#cpu_usedFloat

Number of OCPUs used by OPSI Warehouse ADW. Can be fractional.

Returns:

  • (Float)


29
30
31
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 29

def cpu_used
  @cpu_used
end

#idString

[Required] OPSI Warehouse OCID

Returns:

  • (String)


24
25
26
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 24

def id
  @id
end

#lifecycle_stateString

[Required] Possible lifecycle states

Returns:

  • (String)


38
39
40
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 38

def lifecycle_state
  @lifecycle_state
end

#storage_used_in_gbsFloat

Storage by OPSI Warehouse ADW in GB.

Returns:

  • (Float)


34
35
36
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 34

def storage_used_in_gbs
  @storage_used_in_gbs
end

Class Method Details

.attribute_mapObject

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



41
42
43
44
45
46
47
48
49
50
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 41

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'cpu_used': :'cpuUsed',
    'storage_used_in_gbs': :'storageUsedInGBs',
    'lifecycle_state': :'lifecycleState'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 53

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'cpu_used': :'Float',
    'storage_used_in_gbs': :'Float',
    'lifecycle_state': :'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



121
122
123
124
125
126
127
128
129
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 121

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

  self.class == other.class &&
    id == other.id &&
    cpu_used == other.cpu_used &&
    storage_used_in_gbs == other.storage_used_in_gbs &&
    lifecycle_state == other.lifecycle_state
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



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 154

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


134
135
136
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 134

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



143
144
145
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 143

def hash
  [id, cpu_used, storage_used_in_gbs, lifecycle_state].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



187
188
189
190
191
192
193
194
195
196
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 187

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



181
182
183
# File 'lib/oci/opsi/models/summarize_operations_insights_warehouse_resource_usage_aggregation.rb', line 181

def to_s
  to_hash.to_s
end