Class: OCI::DatabaseManagement::Models::Datafile

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/datafile.rb

Overview

The details of a data file.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_AVAILABLE = 'AVAILABLE'.freeze,
  STATUS_INVALID = 'INVALID'.freeze,
  STATUS_OFFLINE = 'OFFLINE'.freeze,
  STATUS_ONLINE = 'ONLINE'.freeze,
  STATUS_UNKNOWN = 'UNKNOWN'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ONLINE_STATUS_ENUM =
[
  ONLINE_STATUS_SYSOFF = 'SYSOFF'.freeze,
  ONLINE_STATUS_SYSTEM = 'SYSTEM'.freeze,
  ONLINE_STATUS_OFFLINE = 'OFFLINE'.freeze,
  ONLINE_STATUS_ONLINE = 'ONLINE'.freeze,
  ONLINE_STATUS_RECOVER = 'RECOVER'.freeze,
  ONLINE_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LOST_WRITE_PROTECT_ENUM =
[
  LOST_WRITE_PROTECT_ENABLED = 'ENABLED'.freeze,
  LOST_WRITE_PROTECT_PROTECT_OFF = 'PROTECT_OFF'.freeze,
  LOST_WRITE_PROTECT_SUSPEND = 'SUSPEND'.freeze,
  LOST_WRITE_PROTECT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
SHARED_ENUM =
[
  SHARED_SHARED = 'SHARED'.freeze,
  SHARED_LOCAL_FOR_RIM = 'LOCAL_FOR_RIM'.freeze,
  SHARED_LOCAL_FOR_ALL = 'LOCAL_FOR_ALL'.freeze,
  SHARED_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Datafile

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :status (String)

    The value to assign to the #status property

  • :online_status (String)

    The value to assign to the #online_status property

  • :is_auto_extensible (BOOLEAN)

    The value to assign to the #is_auto_extensible property

  • :lost_write_protect (String)

    The value to assign to the #lost_write_protect property

  • :shared (String)

    The value to assign to the #shared property

  • :instance_id (Float)

    The value to assign to the #instance_id property

  • :max_size_kb (Float)

    The value to assign to the #max_size_kb property

  • :allocated_size_kb (Float)

    The value to assign to the #allocated_size_kb property

  • :user_size_kb (Float)

    The value to assign to the #user_size_kb property

  • :increment_by (Float)

    The value to assign to the #increment_by property

  • :free_space_kb (Float)

    The value to assign to the #free_space_kb property

  • :used_space_kb (Float)

    The value to assign to the #used_space_kb property

  • :used_percent_available (Float)

    The value to assign to the #used_percent_available property

  • :used_percent_allocated (Float)

    The value to assign to the #used_percent_allocated property



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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/oci/database_management/models/datafile.rb', line 171

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

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

  self.online_status = attributes[:'onlineStatus'] if attributes[:'onlineStatus']

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

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

  self.is_auto_extensible = attributes[:'isAutoExtensible'] unless attributes[:'isAutoExtensible'].nil?

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

  self.is_auto_extensible = attributes[:'is_auto_extensible'] unless attributes[:'is_auto_extensible'].nil?

  self.lost_write_protect = attributes[:'lostWriteProtect'] if attributes[:'lostWriteProtect']

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

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

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

  self.instance_id = attributes[:'instanceId'] if attributes[:'instanceId']

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

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

  self.max_size_kb = attributes[:'maxSizeKB'] if attributes[:'maxSizeKB']

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

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

  self.allocated_size_kb = attributes[:'allocatedSizeKB'] if attributes[:'allocatedSizeKB']

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

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

  self.user_size_kb = attributes[:'userSizeKB'] if attributes[:'userSizeKB']

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

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

  self.increment_by = attributes[:'incrementBy'] if attributes[:'incrementBy']

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

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

  self.free_space_kb = attributes[:'freeSpaceKB'] if attributes[:'freeSpaceKB']

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

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

  self.used_space_kb = attributes[:'usedSpaceKB'] if attributes[:'usedSpaceKB']

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

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

  self.used_percent_available = attributes[:'usedPercentAvailable'] if attributes[:'usedPercentAvailable']

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

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

  self.used_percent_allocated = attributes[:'usedPercentAllocated'] if attributes[:'usedPercentAllocated']

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

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

Instance Attribute Details

#allocated_size_kbFloat

The allocated file size in KB.

Returns:

  • (Float)


78
79
80
# File 'lib/oci/database_management/models/datafile.rb', line 78

def allocated_size_kb
  @allocated_size_kb
end

#free_space_kbFloat

The free space available in the data file in KB.

Returns:

  • (Float)


90
91
92
# File 'lib/oci/database_management/models/datafile.rb', line 90

def free_space_kb
  @free_space_kb
end

#increment_byFloat

The number of blocks used as auto-extension increment.

Returns:

  • (Float)


86
87
88
# File 'lib/oci/database_management/models/datafile.rb', line 86

def increment_by
  @increment_by
end

#instance_idFloat

Instance ID of the instance to which the temp file belongs. This column has a NULL value for temp files that belong to shared tablespaces.

Returns:

  • (Float)


70
71
72
# File 'lib/oci/database_management/models/datafile.rb', line 70

def instance_id
  @instance_id
end

#is_auto_extensibleBOOLEAN

Indicates whether the data file is auto-extensible.

Returns:

  • (BOOLEAN)


58
59
60
# File 'lib/oci/database_management/models/datafile.rb', line 58

def is_auto_extensible
  @is_auto_extensible
end

#lost_write_protectString

The lost write protection status of the file.

Returns:

  • (String)


62
63
64
# File 'lib/oci/database_management/models/datafile.rb', line 62

def lost_write_protect
  @lost_write_protect
end

#max_size_kbFloat

The maximum file size in KB.

Returns:

  • (Float)


74
75
76
# File 'lib/oci/database_management/models/datafile.rb', line 74

def max_size_kb
  @max_size_kb
end

#nameString

[Required] The filename (including the path) of the data file or temp file.

Returns:

  • (String)


46
47
48
# File 'lib/oci/database_management/models/datafile.rb', line 46

def name
  @name
end

#online_statusString

The online status of the file.

Returns:

  • (String)


54
55
56
# File 'lib/oci/database_management/models/datafile.rb', line 54

def online_status
  @online_status
end

#sharedString

Type of tablespace this file belongs to. If it's for a shared tablespace, for a local temporary tablespace for RIM (read-only) instances, or for local temporary tablespace for all instance types.

Returns:

  • (String)


66
67
68
# File 'lib/oci/database_management/models/datafile.rb', line 66

def shared
  @shared
end

#statusString

The status of the file. INVALID status is used when the file number is not in use, for example, a file in a tablespace that was removed.

Returns:

  • (String)


50
51
52
# File 'lib/oci/database_management/models/datafile.rb', line 50

def status
  @status
end

#used_percent_allocatedFloat

The percentage of used space out of the total allocated space in the file.

Returns:

  • (Float)


102
103
104
# File 'lib/oci/database_management/models/datafile.rb', line 102

def used_percent_allocated
  @used_percent_allocated
end

#used_percent_availableFloat

The percentage of used space out of the maximum available space in the file.

Returns:

  • (Float)


98
99
100
# File 'lib/oci/database_management/models/datafile.rb', line 98

def used_percent_available
  @used_percent_available
end

#used_space_kbFloat

The total space used in the data file in KB.

Returns:

  • (Float)


94
95
96
# File 'lib/oci/database_management/models/datafile.rb', line 94

def used_space_kb
  @used_space_kb
end

#user_size_kbFloat

The size of the file available for user data in KB. The actual size of the file minus the USER_BYTES value is used to store file-related metadata.

Returns:

  • (Float)


82
83
84
# File 'lib/oci/database_management/models/datafile.rb', line 82

def user_size_kb
  @user_size_kb
end

Class Method Details

.attribute_mapObject

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



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/database_management/models/datafile.rb', line 105

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'status': :'status',
    'online_status': :'onlineStatus',
    'is_auto_extensible': :'isAutoExtensible',
    'lost_write_protect': :'lostWriteProtect',
    'shared': :'shared',
    'instance_id': :'instanceId',
    'max_size_kb': :'maxSizeKB',
    'allocated_size_kb': :'allocatedSizeKB',
    'user_size_kb': :'userSizeKB',
    'increment_by': :'incrementBy',
    'free_space_kb': :'freeSpaceKB',
    'used_space_kb': :'usedSpaceKB',
    'used_percent_available': :'usedPercentAvailable',
    'used_percent_allocated': :'usedPercentAllocated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/oci/database_management/models/datafile.rb', line 128

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'status': :'String',
    'online_status': :'String',
    'is_auto_extensible': :'BOOLEAN',
    'lost_write_protect': :'String',
    'shared': :'String',
    'instance_id': :'Float',
    'max_size_kb': :'Float',
    'allocated_size_kb': :'Float',
    'user_size_kb': :'Float',
    'increment_by': :'Float',
    'free_space_kb': :'Float',
    'used_space_kb': :'Float',
    'used_percent_available': :'Float',
    'used_percent_allocated': :'Float'
    # 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



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/oci/database_management/models/datafile.rb', line 315

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

  self.class == other.class &&
    name == other.name &&
    status == other.status &&
    online_status == other.online_status &&
    is_auto_extensible == other.is_auto_extensible &&
    lost_write_protect == other.lost_write_protect &&
    shared == other.shared &&
    instance_id == other.instance_id &&
    max_size_kb == other.max_size_kb &&
    allocated_size_kb == other.allocated_size_kb &&
    user_size_kb == other.user_size_kb &&
    increment_by == other.increment_by &&
    free_space_kb == other.free_space_kb &&
    used_space_kb == other.used_space_kb &&
    used_percent_available == other.used_percent_available &&
    used_percent_allocated == other.used_percent_allocated
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



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/oci/database_management/models/datafile.rb', line 359

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


339
340
341
# File 'lib/oci/database_management/models/datafile.rb', line 339

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



348
349
350
# File 'lib/oci/database_management/models/datafile.rb', line 348

def hash
  [name, status, online_status, is_auto_extensible, lost_write_protect, shared, instance_id, max_size_kb, allocated_size_kb, user_size_kb, increment_by, free_space_kb, used_space_kb, used_percent_available, used_percent_allocated].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



392
393
394
395
396
397
398
399
400
401
# File 'lib/oci/database_management/models/datafile.rb', line 392

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



386
387
388
# File 'lib/oci/database_management/models/datafile.rb', line 386

def to_s
  to_hash.to_s
end