Class: OCI::Database::Models::ResourcePoolSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/models/resource_pool_summary.rb

Overview

The configuration details for resource pool

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ResourcePoolSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



76
77
78
79
80
81
82
83
84
85
86
87
88
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
# File 'lib/oci/database/models/resource_pool_summary.rb', line 76

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

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

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

  self.pool_storage_size_in_tbs = attributes[:'poolStorageSizeInTBs'] if attributes[:'poolStorageSizeInTBs']

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

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

  self.available_storage_capacity_in_tbs = attributes[:'availableStorageCapacityInTBs'] if attributes[:'availableStorageCapacityInTBs']

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

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

  self.total_compute_capacity = attributes[:'totalComputeCapacity'] if attributes[:'totalComputeCapacity']

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

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

  self.available_compute_capacity = attributes[:'availableComputeCapacity'] if attributes[:'availableComputeCapacity']

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

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

  self.is_disabled = attributes[:'isDisabled'] unless attributes[:'isDisabled'].nil?

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

  self.is_disabled = attributes[:'is_disabled'] unless attributes[:'is_disabled'].nil?
end

Instance Attribute Details

#available_compute_capacityInteger

Available capacity left for new elastic pool members provision

Returns:

  • (Integer)


29
30
31
# File 'lib/oci/database/models/resource_pool_summary.rb', line 29

def available_compute_capacity
  @available_compute_capacity
end

#available_storage_capacity_in_tbsFloat

Available storage capacity (in TB) that can be used for adding new members or scaling existing members in a dedicated elastic pool.

Returns:

  • (Float)


21
22
23
# File 'lib/oci/database/models/resource_pool_summary.rb', line 21

def available_storage_capacity_in_tbs
  @available_storage_capacity_in_tbs
end

#is_disabledBOOLEAN

Indicates if the resource pool should be deleted for the Autonomous AI Database.

Returns:

  • (BOOLEAN)


34
35
36
# File 'lib/oci/database/models/resource_pool_summary.rb', line 34

def is_disabled
  @is_disabled
end

#pool_sizeInteger

Resource pool size.

Returns:

  • (Integer)


13
14
15
# File 'lib/oci/database/models/resource_pool_summary.rb', line 13

def pool_size
  @pool_size
end

#pool_storage_size_in_tbsInteger

Resource pool storage size in TBs.

Returns:

  • (Integer)


17
18
19
# File 'lib/oci/database/models/resource_pool_summary.rb', line 17

def pool_storage_size_in_tbs
  @pool_storage_size_in_tbs
end

#total_compute_capacityInteger

Resource Pool total capacity, it's currently 4x of pool size

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/database/models/resource_pool_summary.rb', line 25

def total_compute_capacity
  @total_compute_capacity
end

Class Method Details

.attribute_mapObject

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



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/oci/database/models/resource_pool_summary.rb', line 37

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'pool_size': :'poolSize',
    'pool_storage_size_in_tbs': :'poolStorageSizeInTBs',
    'available_storage_capacity_in_tbs': :'availableStorageCapacityInTBs',
    'total_compute_capacity': :'totalComputeCapacity',
    'available_compute_capacity': :'availableComputeCapacity',
    'is_disabled': :'isDisabled'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/database/models/resource_pool_summary.rb', line 51

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'pool_size': :'Integer',
    'pool_storage_size_in_tbs': :'Integer',
    'available_storage_capacity_in_tbs': :'Float',
    'total_compute_capacity': :'Integer',
    'available_compute_capacity': :'Integer',
    'is_disabled': :'BOOLEAN'
    # 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



126
127
128
129
130
131
132
133
134
135
136
# File 'lib/oci/database/models/resource_pool_summary.rb', line 126

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

  self.class == other.class &&
    pool_size == other.pool_size &&
    pool_storage_size_in_tbs == other.pool_storage_size_in_tbs &&
    available_storage_capacity_in_tbs == other.available_storage_capacity_in_tbs &&
    total_compute_capacity == other.total_compute_capacity &&
    available_compute_capacity == other.available_compute_capacity &&
    is_disabled == other.is_disabled
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



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/database/models/resource_pool_summary.rb', line 161

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


141
142
143
# File 'lib/oci/database/models/resource_pool_summary.rb', line 141

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



150
151
152
# File 'lib/oci/database/models/resource_pool_summary.rb', line 150

def hash
  [pool_size, pool_storage_size_in_tbs, available_storage_capacity_in_tbs, total_compute_capacity, available_compute_capacity, is_disabled].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/database/models/resource_pool_summary.rb', line 194

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



188
189
190
# File 'lib/oci/database/models/resource_pool_summary.rb', line 188

def to_s
  to_hash.to_s
end