Class: OCI::Database::Models::AutonomousContainerDatabaseResourceUsage

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

Overview

Associated autonomous container databases usages.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AutonomousContainerDatabaseResourceUsage

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 127

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

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

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

  self.reclaimable_cpus = attributes[:'reclaimableCpus'] if attributes[:'reclaimableCpus']

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

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

  self.available_cpus = attributes[:'availableCpus'] if attributes[:'availableCpus']

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

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

  self.largest_provisionable_autonomous_database_in_cpus = attributes[:'largestProvisionableAutonomousDatabaseInCpus'] if attributes[:'largestProvisionableAutonomousDatabaseInCpus']

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

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

  self.provisioned_cpus = attributes[:'provisionedCpus'] if attributes[:'provisionedCpus']

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

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

  self.reserved_cpus = attributes[:'reservedCpus'] if attributes[:'reservedCpus']

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

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

  self.used_cpus = attributes[:'usedCpus'] if attributes[:'usedCpus']

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

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

  self.provisionable_cpus = attributes[:'provisionableCpus'] if attributes[:'provisionableCpus']

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

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

  self.autonomous_container_database_vm_usage = attributes[:'autonomousContainerDatabaseVmUsage'] if attributes[:'autonomousContainerDatabaseVmUsage']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#autonomous_container_database_vm_usageArray<OCI::Database::Models::AcdAvmResourceStats>

List of autonomous container database resource usage per autonomous virtual machine.



53
54
55
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 53

def autonomous_container_database_vm_usage
  @autonomous_container_database_vm_usage
end

#available_cpusFloat

CPUs available for provisioning or scaling an Autonomous Database in the Autonomous Container Database.

Returns:

  • (Float)


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

def available_cpus
  @available_cpus
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Returns:

  • (Hash<String, Hash<String, Object>>)


67
68
69
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 67

def defined_tags
  @defined_tags
end

#display_nameString

[Required] The user-friendly name for the Autonomous Container Database. The name does not need to be unique.

Returns:

  • (String)


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

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


61
62
63
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 61

def freeform_tags
  @freeform_tags
end

#idString

The OCID of the Autonomous Container Database.

Returns:

  • (String)


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

def id
  @id
end

#largest_provisionable_autonomous_database_in_cpusFloat

Largest provisionable ADB in the Autonomous Container Database.

Returns:

  • (Float)


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

def largest_provisionable_autonomous_database_in_cpus
  @largest_provisionable_autonomous_database_in_cpus
end

#provisionable_cpusArray<Float>

Valid list of provisionable CPUs for Autonomous Database.

Returns:

  • (Array<Float>)


49
50
51
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 49

def provisionable_cpus
  @provisionable_cpus
end

#provisioned_cpusFloat

CPUs / cores assigned to ADBs in the Autonomous Container Database.

Returns:

  • (Float)


33
34
35
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 33

def provisioned_cpus
  @provisioned_cpus
end

#reclaimable_cpusFloat

Number of CPUs that are reclaimable or released to the AVMC on Autonomous Container Database restart.

Returns:

  • (Float)


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

def reclaimable_cpus
  @reclaimable_cpus
end

#reserved_cpusFloat

CPUs / cores reserved for scalability, resilliency and other overheads. This includes failover, autoscaling and idle instance overhead.

Returns:

  • (Float)


39
40
41
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 39

def reserved_cpus
  @reserved_cpus
end

#used_cpusFloat

CPUs / cores assigned to the Autonomous Container Database. Sum of provisioned, reserved and reclaimable CPUs/ cores.

Returns:

  • (Float)


45
46
47
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 45

def used_cpus
  @used_cpus
end

Class Method Details

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 70

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'reclaimable_cpus': :'reclaimableCpus',
    'available_cpus': :'availableCpus',
    'largest_provisionable_autonomous_database_in_cpus': :'largestProvisionableAutonomousDatabaseInCpus',
    'provisioned_cpus': :'provisionedCpus',
    'reserved_cpus': :'reservedCpus',
    'used_cpus': :'usedCpus',
    'provisionable_cpus': :'provisionableCpus',
    'autonomous_container_database_vm_usage': :'autonomousContainerDatabaseVmUsage',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 90

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'reclaimable_cpus': :'Float',
    'available_cpus': :'Float',
    'largest_provisionable_autonomous_database_in_cpus': :'Float',
    'provisioned_cpus': :'Float',
    'reserved_cpus': :'Float',
    'used_cpus': :'Float',
    'provisionable_cpus': :'Array<Float>',
    'autonomous_container_database_vm_usage': :'Array<OCI::Database::Models::AcdAvmResourceStats>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 209

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    reclaimable_cpus == other.reclaimable_cpus &&
    available_cpus == other.available_cpus &&
    largest_provisionable_autonomous_database_in_cpus == other.largest_provisionable_autonomous_database_in_cpus &&
    provisioned_cpus == other.provisioned_cpus &&
    reserved_cpus == other.reserved_cpus &&
    used_cpus == other.used_cpus &&
    provisionable_cpus == other.provisionable_cpus &&
    autonomous_container_database_vm_usage == other.autonomous_container_database_vm_usage &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 250

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


230
231
232
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 230

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



239
240
241
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 239

def hash
  [id, display_name, reclaimable_cpus, available_cpus, largest_provisionable_autonomous_database_in_cpus, provisioned_cpus, reserved_cpus, used_cpus, provisionable_cpus, autonomous_container_database_vm_usage, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



283
284
285
286
287
288
289
290
291
292
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 283

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



277
278
279
# File 'lib/oci/database/models/autonomous_container_database_resource_usage.rb', line 277

def to_s
  to_hash.to_s
end