Class: OCI::CloudBridge::Models::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_bridge/models/storage.rb

Overview

Host storage information

Constant Summary collapse

NFS_VERSION_ENUM =
[
  NFS_VERSION_AUTO = 'AUTO'.freeze,
  NFS_VERSION_V3 = 'V3'.freeze,
  NFS_VERSION_V4 = 'V4'.freeze,
  NFS_VERSION_V4_0 = 'V4_0'.freeze,
  NFS_VERSION_V4_1 = 'V4_1'.freeze,
  NFS_VERSION_V4_2 = 'V4_2'.freeze
].freeze
TYPE_ENUM =
[
  TYPE_CINDER = 'CINDER'.freeze,
  TYPE_FCP = 'FCP'.freeze,
  TYPE_GLANCE = 'GLANCE'.freeze,
  TYPE_GLUSTERFS = 'GLUSTERFS'.freeze,
  TYPE_ISCSI = 'ISCSI'.freeze,
  TYPE_LOCALFS = 'LOCALFS'.freeze,
  TYPE_MANAGED_BLOCK_STORAGE = 'MANAGED_BLOCK_STORAGE'.freeze,
  TYPE_NFS = 'NFS'.freeze,
  TYPE_POSIXFS = 'POSIXFS'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Storage

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/oci/cloud_bridge/models/storage.rb', line 200

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

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

  self.storage_description = attributes[:'storageDescription'] if attributes[:'storageDescription']

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

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

  self.driver_options = attributes[:'driverOptions'] if attributes[:'driverOptions']

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

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

  self.driver_sensitive_options = attributes[:'driverSensitiveOptions'] if attributes[:'driverSensitiveOptions']

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

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

  self.logical_units = attributes[:'logicalUnits'] if attributes[:'logicalUnits']

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

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

  self.mount_options = attributes[:'mountOptions'] if attributes[:'mountOptions']

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

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

  self.nfs_retrans = attributes[:'nfsRetrans'] if attributes[:'nfsRetrans']

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

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

  self.nfs_timeo = attributes[:'nfsTimeo'] if attributes[:'nfsTimeo']

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

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

  self.nfs_version = attributes[:'nfsVersion'] if attributes[:'nfsVersion']

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

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

  self.is_override_luns = attributes[:'isOverrideLuns'] unless attributes[:'isOverrideLuns'].nil?

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

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

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

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

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

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

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

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

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

  self.vfs_type = attributes[:'vfsType'] if attributes[:'vfsType']

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

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

  self.volume_group = attributes[:'volumeGroup'] if attributes[:'volumeGroup']

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

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

Instance Attribute Details

#addressString

Address of storage domain.

Returns:

  • (String)


38
39
40
# File 'lib/oci/cloud_bridge/models/storage.rb', line 38

def address
  @address
end

#commentString

Free text containing comments about this object.

Returns:

  • (String)


42
43
44
# File 'lib/oci/cloud_bridge/models/storage.rb', line 42

def comment
  @comment
end

#driver_optionsArray<OCI::CloudBridge::Models::OlvmProperty>

The options to be passed when creating a storage domain using a cinder driver.



50
51
52
# File 'lib/oci/cloud_bridge/models/storage.rb', line 50

def driver_options
  @driver_options
end

#driver_sensitive_optionsArray<OCI::CloudBridge::Models::OlvmProperty>

The options containing sensitive information to be passed when creating a storage domain using a cinder driver.



54
55
56
# File 'lib/oci/cloud_bridge/models/storage.rb', line 54

def driver_sensitive_options
  @driver_sensitive_options
end

#idString

A unique identifier.

Returns:

  • (String)


34
35
36
# File 'lib/oci/cloud_bridge/models/storage.rb', line 34

def id
  @id
end

#is_override_lunsBOOLEAN

Whether to override LUNs

Returns:

  • (BOOLEAN)


78
79
80
# File 'lib/oci/cloud_bridge/models/storage.rb', line 78

def is_override_luns
  @is_override_luns
end

#logical_unitsArray<OCI::CloudBridge::Models::LogicalUnit>

Logical Units of the host storage



58
59
60
# File 'lib/oci/cloud_bridge/models/storage.rb', line 58

def logical_units
  @logical_units
end

#mount_optionsString

Mount options

Returns:

  • (String)


62
63
64
# File 'lib/oci/cloud_bridge/models/storage.rb', line 62

def mount_options
  @mount_options
end

#nfs_retransInteger

The number of times to retry a request before attempting further recovery actions.

Returns:

  • (Integer)


66
67
68
# File 'lib/oci/cloud_bridge/models/storage.rb', line 66

def nfs_retrans
  @nfs_retrans
end

#nfs_timeoInteger

The time in tenths of a second to wait for a response before retrying NFS requests.

Returns:

  • (Integer)


70
71
72
# File 'lib/oci/cloud_bridge/models/storage.rb', line 70

def nfs_timeo
  @nfs_timeo
end

#nfs_versionString

Version of NFS used.

Returns:

  • (String)


74
75
76
# File 'lib/oci/cloud_bridge/models/storage.rb', line 74

def nfs_version
  @nfs_version
end

#passwordString

Password of the host storage.

Returns:

  • (String)


82
83
84
# File 'lib/oci/cloud_bridge/models/storage.rb', line 82

def password
  @password
end

#pathsInteger

Paths of the host storage.

Returns:

  • (Integer)


86
87
88
# File 'lib/oci/cloud_bridge/models/storage.rb', line 86

def paths
  @paths
end

#portInteger

Port of the host storage.

Returns:

  • (Integer)


90
91
92
# File 'lib/oci/cloud_bridge/models/storage.rb', line 90

def port
  @port
end

#portalString

Portal of the host storage.

Returns:

  • (String)


94
95
96
# File 'lib/oci/cloud_bridge/models/storage.rb', line 94

def portal
  @portal
end

#storage_descriptionString

A human-readable description in plain text.

Returns:

  • (String)


46
47
48
# File 'lib/oci/cloud_bridge/models/storage.rb', line 46

def storage_description
  @storage_description
end

#targetString

Target of the host storage.

Returns:

  • (String)


98
99
100
# File 'lib/oci/cloud_bridge/models/storage.rb', line 98

def target
  @target
end

#typeString

Type representing a storage domain type.

Returns:

  • (String)


106
107
108
# File 'lib/oci/cloud_bridge/models/storage.rb', line 106

def type
  @type
end

#usernameString

Username of the host storage.

Returns:

  • (String)


102
103
104
# File 'lib/oci/cloud_bridge/models/storage.rb', line 102

def username
  @username
end

#vfs_typeString

Type of VFS

Returns:

  • (String)


110
111
112
# File 'lib/oci/cloud_bridge/models/storage.rb', line 110

def vfs_type
  @vfs_type
end

#volume_groupOCI::CloudBridge::Models::VolumeGroup



113
114
115
# File 'lib/oci/cloud_bridge/models/storage.rb', line 113

def volume_group
  @volume_group
end

Class Method Details

.attribute_mapObject

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



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/cloud_bridge/models/storage.rb', line 116

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'address': :'address',
    'comment': :'comment',
    'storage_description': :'storageDescription',
    'driver_options': :'driverOptions',
    'driver_sensitive_options': :'driverSensitiveOptions',
    'logical_units': :'logicalUnits',
    'mount_options': :'mountOptions',
    'nfs_retrans': :'nfsRetrans',
    'nfs_timeo': :'nfsTimeo',
    'nfs_version': :'nfsVersion',
    'is_override_luns': :'isOverrideLuns',
    'password': :'password',
    'paths': :'paths',
    'port': :'port',
    'portal': :'portal',
    'target': :'target',
    'username': :'username',
    'type': :'type',
    'vfs_type': :'vfsType',
    'volume_group': :'volumeGroup'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/cloud_bridge/models/storage.rb', line 145

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'address': :'String',
    'comment': :'String',
    'storage_description': :'String',
    'driver_options': :'Array<OCI::CloudBridge::Models::OlvmProperty>',
    'driver_sensitive_options': :'Array<OCI::CloudBridge::Models::OlvmProperty>',
    'logical_units': :'Array<OCI::CloudBridge::Models::LogicalUnit>',
    'mount_options': :'String',
    'nfs_retrans': :'Integer',
    'nfs_timeo': :'Integer',
    'nfs_version': :'String',
    'is_override_luns': :'BOOLEAN',
    'password': :'String',
    'paths': :'Integer',
    'port': :'Integer',
    'portal': :'String',
    'target': :'String',
    'username': :'String',
    'type': :'String',
    'vfs_type': :'String',
    'volume_group': :'OCI::CloudBridge::Models::VolumeGroup'
    # 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



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/oci/cloud_bridge/models/storage.rb', line 316

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

  self.class == other.class &&
    id == other.id &&
    address == other.address &&
    comment == other.comment &&
    storage_description == other.storage_description &&
    driver_options == other.driver_options &&
    driver_sensitive_options == other.driver_sensitive_options &&
    logical_units == other.logical_units &&
    mount_options == other.mount_options &&
    nfs_retrans == other.nfs_retrans &&
    nfs_timeo == other.nfs_timeo &&
    nfs_version == other.nfs_version &&
    is_override_luns == other.is_override_luns &&
    password == other.password &&
    paths == other.paths &&
    port == other.port &&
    portal == other.portal &&
    target == other.target &&
    username == other.username &&
    type == other.type &&
    vfs_type == other.vfs_type &&
    volume_group == other.volume_group
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



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/oci/cloud_bridge/models/storage.rb', line 366

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


346
347
348
# File 'lib/oci/cloud_bridge/models/storage.rb', line 346

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



355
356
357
# File 'lib/oci/cloud_bridge/models/storage.rb', line 355

def hash
  [id, address, comment, storage_description, driver_options, driver_sensitive_options, logical_units, mount_options, nfs_retrans, nfs_timeo, nfs_version, is_override_luns, password, paths, port, portal, target, username, type, vfs_type, volume_group].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



399
400
401
402
403
404
405
406
407
408
# File 'lib/oci/cloud_bridge/models/storage.rb', line 399

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



393
394
395
# File 'lib/oci/cloud_bridge/models/storage.rb', line 393

def to_s
  to_hash.to_s
end