Class: OCI::Datacc::Models::StorageCapacityDetails

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

Overview

Capacity details of the Storage disk group.

Constant Summary collapse

STORAGE_DISK_REDUNDANCY_ENUM =
[
  STORAGE_DISK_REDUNDANCY_HIGH = 'HIGH'.freeze,
  STORAGE_DISK_REDUNDANCY_MIRROR = 'MIRROR'.freeze,
  STORAGE_DISK_REDUNDANCY_FLEX = 'FLEX'.freeze,
  STORAGE_DISK_REDUNDANCY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StorageCapacityDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
118
119
120
121
122
123
124
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 83

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

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

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

  self.disk_group = attributes[:'diskGroup'] if attributes[:'diskGroup']

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

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

  self.phy_total_space_in_gbs = attributes[:'phyTotalSpaceInGBs'] if attributes[:'phyTotalSpaceInGBs']

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

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

  self.phy_reserved_space_in_gbs = attributes[:'phyReservedSpaceInGBs'] if attributes[:'phyReservedSpaceInGBs']

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

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

  self.phy_free_space_in_gbs = attributes[:'phyFreeSpaceInGBs'] if attributes[:'phyFreeSpaceInGBs']

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

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

  self.logical_free_space_in_gbs = attributes[:'logicalFreeSpaceInGBs'] if attributes[:'logicalFreeSpaceInGBs']

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

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

Instance Attribute Details

#disk_groupString

Disk group name.

Returns:

  • (String)


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

def disk_group
  @disk_group
end

#logical_free_space_in_gbsInteger

The total amount of logical disk space that is currently available for use in a disk group, in gigabytes (GB).

Returns:

  • (Integer)


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

def logical_free_space_in_gbs
  @logical_free_space_in_gbs
end

#phy_free_space_in_gbsInteger

The total amount of physical disk space that is currently available for use in a disk group, in gigabytes (GB).

Returns:

  • (Integer)


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

def phy_free_space_in_gbs
  @phy_free_space_in_gbs
end

#phy_reserved_space_in_gbsInteger

The total amount of physical disk space that is reserved for system use in a disk group, in gigabytes (GB).

Returns:

  • (Integer)


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

def phy_reserved_space_in_gbs
  @phy_reserved_space_in_gbs
end

#phy_total_space_in_gbsInteger

The total amount of physical disk space available in a disk group, in gigabytes (GB).

Returns:

  • (Integer)


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

def phy_total_space_in_gbs
  @phy_total_space_in_gbs
end

#storage_disk_redundancyString

The Disk redundancy for Database Infrastructure storage.

Returns:

  • (String)


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

def storage_disk_redundancy
  @storage_disk_redundancy
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
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 44

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'storage_disk_redundancy': :'storageDiskRedundancy',
    'disk_group': :'diskGroup',
    'phy_total_space_in_gbs': :'phyTotalSpaceInGBs',
    'phy_reserved_space_in_gbs': :'phyReservedSpaceInGBs',
    'phy_free_space_in_gbs': :'phyFreeSpaceInGBs',
    'logical_free_space_in_gbs': :'logicalFreeSpaceInGBs'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 58

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'storage_disk_redundancy': :'String',
    'disk_group': :'String',
    'phy_total_space_in_gbs': :'Integer',
    'phy_reserved_space_in_gbs': :'Integer',
    'phy_free_space_in_gbs': :'Integer',
    'logical_free_space_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



146
147
148
149
150
151
152
153
154
155
156
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 146

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

  self.class == other.class &&
    storage_disk_redundancy == other.storage_disk_redundancy &&
    disk_group == other.disk_group &&
    phy_total_space_in_gbs == other.phy_total_space_in_gbs &&
    phy_reserved_space_in_gbs == other.phy_reserved_space_in_gbs &&
    phy_free_space_in_gbs == other.phy_free_space_in_gbs &&
    logical_free_space_in_gbs == other.logical_free_space_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



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 181

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


161
162
163
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 161

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



170
171
172
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 170

def hash
  [storage_disk_redundancy, disk_group, phy_total_space_in_gbs, phy_reserved_space_in_gbs, phy_free_space_in_gbs, logical_free_space_in_gbs].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



214
215
216
217
218
219
220
221
222
223
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 214

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



208
209
210
# File 'lib/oci/datacc/models/storage_capacity_details.rb', line 208

def to_s
  to_hash.to_s
end