Class: OCI::Datacc::Models::ComputeCapacityDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/datacc/models/compute_capacity_details.rb

Overview

Capacity details of the Database Infrastructure.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ComputeCapacityDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 89

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

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

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

  self.allocated_cores = attributes[:'allocatedCores'] if attributes[:'allocatedCores']

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

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

  self.reserved_cores = attributes[:'reservedCores'] if attributes[:'reservedCores']

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

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

  self.available_cores = attributes[:'availableCores'] if attributes[:'availableCores']

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

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

  self.total_memory_in_gbs = attributes[:'totalMemoryInGBs'] if attributes[:'totalMemoryInGBs']

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

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

  self.used_memory_in_gbs = attributes[:'usedMemoryInGBs'] if attributes[:'usedMemoryInGBs']

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

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

  self.reserved_memory_in_gbs = attributes[:'reservedMemoryInGBs'] if attributes[:'reservedMemoryInGBs']

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

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

  self.available_memory_in_gbs = attributes[:'availableMemoryInGBs'] if attributes[:'availableMemoryInGBs']

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

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

Instance Attribute Details

#allocated_coresInteger

Total CPU cores count allocated..

Returns:

  • (Integer)


17
18
19
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 17

def allocated_cores
  @allocated_cores
end

#available_coresInteger

Total available CPU cores count.

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 25

def available_cores
  @available_cores
end

#available_memory_in_gbsInteger

Available memory, in gigabytes (GB).

Returns:

  • (Integer)


41
42
43
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 41

def available_memory_in_gbs
  @available_memory_in_gbs
end

#reserved_coresInteger

Total Reserved CPU cores count.

Returns:

  • (Integer)


21
22
23
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 21

def reserved_cores
  @reserved_cores
end

#reserved_memory_in_gbsInteger

Reserved memory, in gigabytes (GB).

Returns:

  • (Integer)


37
38
39
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 37

def reserved_memory_in_gbs
  @reserved_memory_in_gbs
end

#total_coresInteger

Total CPU cores count.

Returns:

  • (Integer)


13
14
15
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 13

def total_cores
  @total_cores
end

#total_memory_in_gbsInteger

Total memory allocated, in gigabytes (GB).

Returns:

  • (Integer)


29
30
31
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 29

def total_memory_in_gbs
  @total_memory_in_gbs
end

#used_memory_in_gbsInteger

Memory allocated to Oracle database virtual machine cluster or Instance, in gigabytes (GB).

Returns:

  • (Integer)


33
34
35
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 33

def used_memory_in_gbs
  @used_memory_in_gbs
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 44

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'total_cores': :'totalCores',
    'allocated_cores': :'allocatedCores',
    'reserved_cores': :'reservedCores',
    'available_cores': :'availableCores',
    'total_memory_in_gbs': :'totalMemoryInGBs',
    'used_memory_in_gbs': :'usedMemoryInGBs',
    'reserved_memory_in_gbs': :'reservedMemoryInGBs',
    'available_memory_in_gbs': :'availableMemoryInGBs'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 60

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'total_cores': :'Integer',
    'allocated_cores': :'Integer',
    'reserved_cores': :'Integer',
    'available_cores': :'Integer',
    'total_memory_in_gbs': :'Integer',
    'used_memory_in_gbs': :'Integer',
    'reserved_memory_in_gbs': :'Integer',
    'available_memory_in_gbs': :'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



151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 151

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

  self.class == other.class &&
    total_cores == other.total_cores &&
    allocated_cores == other.allocated_cores &&
    reserved_cores == other.reserved_cores &&
    available_cores == other.available_cores &&
    total_memory_in_gbs == other.total_memory_in_gbs &&
    used_memory_in_gbs == other.used_memory_in_gbs &&
    reserved_memory_in_gbs == other.reserved_memory_in_gbs &&
    available_memory_in_gbs == other.available_memory_in_gbs
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



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 188

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


168
169
170
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 168

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



177
178
179
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 177

def hash
  [total_cores, allocated_cores, reserved_cores, available_cores, total_memory_in_gbs, used_memory_in_gbs, reserved_memory_in_gbs, available_memory_in_gbs].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 221

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



215
216
217
# File 'lib/oci/datacc/models/compute_capacity_details.rb', line 215

def to_s
  to_hash.to_s
end