Class: OCI::CloudMigrations::Models::LogicalUnit

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_migrations/models/logical_unit.rb

Overview

Logical unit of the host storage.

Constant Summary collapse

LUN_STATUS_ENUM =
[
  LUN_STATUS_FREE = 'FREE'.freeze,
  LUN_STATUS_UNUSABLE = 'UNUSABLE'.freeze,
  LUN_STATUS_USED = 'USED'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LogicalUnit

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :address (String)

    The value to assign to the #address property

  • :discard_max_size_in_bytes (Integer)

    The value to assign to the #discard_max_size_in_bytes property

  • :is_discard_zeroes_data (BOOLEAN)

    The value to assign to the #is_discard_zeroes_data property

  • :disk_id (String)

    The value to assign to the #disk_id property

  • :id (String)

    The value to assign to the #id property

  • :lun_mapping (Integer)

    The value to assign to the #lun_mapping property

  • :lun_status (String)

    The value to assign to the #lun_status property

  • :password (String)

    The value to assign to the #password property

  • :paths (Integer)

    The value to assign to the #paths property

  • :port (Integer)

    The value to assign to the #port property

  • :portal (String)

    The value to assign to the #portal property

  • :product_id (String)

    The value to assign to the #product_id property

  • :serial (String)

    The value to assign to the #serial property

  • :size (Integer)

    The value to assign to the #size property

  • :storage_domain_id (String)

    The value to assign to the #storage_domain_id property

  • :target (String)

    The value to assign to the #target property

  • :username (String)

    The value to assign to the #username property

  • :vendor_id (String)

    The value to assign to the #vendor_id property

  • :volume_group_id (String)

    The value to assign to the #volume_group_id property



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
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 172

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

  self.discard_max_size_in_bytes = attributes[:'discardMaxSizeInBytes'] if attributes[:'discardMaxSizeInBytes']

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

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

  self.is_discard_zeroes_data = attributes[:'isDiscardZeroesData'] unless attributes[:'isDiscardZeroesData'].nil?

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

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

  self.disk_id = attributes[:'diskId'] if attributes[:'diskId']

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

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

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

  self.lun_mapping = attributes[:'lunMapping'] if attributes[:'lunMapping']

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

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

  self.lun_status = attributes[:'lunStatus'] if attributes[:'lunStatus']

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

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

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

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

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

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

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

  self.storage_domain_id = attributes[:'storageDomainId'] if attributes[:'storageDomainId']

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

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

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

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

  self.vendor_id = attributes[:'vendorId'] if attributes[:'vendorId']

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

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

  self.volume_group_id = attributes[:'volumeGroupId'] if attributes[:'volumeGroupId']

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

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

Instance Attribute Details

#addressString

Address of the logical unit.

Returns:

  • (String)


19
20
21
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 19

def address
  @address
end

#discard_max_size_in_bytesInteger

The maximum number of bytes that can be discarded by the logical unit???s underlying storage in a single operation.

Returns:

  • (Integer)


23
24
25
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 23

def discard_max_size_in_bytes
  @discard_max_size_in_bytes
end

#disk_idString

Disk ID of the logical unit.

Returns:

  • (String)


31
32
33
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 31

def disk_id
  @disk_id
end

#idString

a unique identifier.

Returns:

  • (String)


35
36
37
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 35

def id
  @id
end

#is_discard_zeroes_dataBOOLEAN

True, if previously discarded blocks in the logical unit???s underlying storage are read back as zeros.

Returns:

  • (BOOLEAN)


27
28
29
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 27

def is_discard_zeroes_data
  @is_discard_zeroes_data
end

#lun_mappingInteger

LUN Mapping

Returns:

  • (Integer)


39
40
41
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 39

def lun_mapping
  @lun_mapping
end

#lun_statusString

LUN Status

Returns:

  • (String)


43
44
45
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 43

def lun_status
  @lun_status
end

#passwordString

Password of the logical unit.

Returns:

  • (String)


47
48
49
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 47

def password
  @password
end

#pathsInteger

Paths of the logical unit.

Returns:

  • (Integer)


51
52
53
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 51

def paths
  @paths
end

#portInteger

Port of the logical unit.

Returns:

  • (Integer)


55
56
57
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 55

def port
  @port
end

#portalString

Portal of the logical unit.

Returns:

  • (String)


59
60
61
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 59

def portal
  @portal
end

#product_idString

Product ID of the logical unit.

Returns:

  • (String)


63
64
65
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 63

def product_id
  @product_id
end

#serialString

Serial of the logical unit.

Returns:

  • (String)


67
68
69
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 67

def serial
  @serial
end

#sizeInteger

Size of the logical unit.

Returns:

  • (Integer)


71
72
73
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 71

def size
  @size
end

#storage_domain_idString

Storage Domain ID of the logical unit.

Returns:

  • (String)


75
76
77
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 75

def storage_domain_id
  @storage_domain_id
end

#targetString

Target of the logical unit.

Returns:

  • (String)


79
80
81
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 79

def target
  @target
end

#usernameString

Username of the logical unit.

Returns:

  • (String)


83
84
85
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 83

def username
  @username
end

#vendor_idString

Vendor ID of the logical unit.

Returns:

  • (String)


87
88
89
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 87

def vendor_id
  @vendor_id
end

#volume_group_idString

Volume Group ID of the logical unit.

Returns:

  • (String)


91
92
93
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 91

def volume_group_id
  @volume_group_id
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 94

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'address': :'address',
    'discard_max_size_in_bytes': :'discardMaxSizeInBytes',
    'is_discard_zeroes_data': :'isDiscardZeroesData',
    'disk_id': :'diskId',
    'id': :'id',
    'lun_mapping': :'lunMapping',
    'lun_status': :'lunStatus',
    'password': :'password',
    'paths': :'paths',
    'port': :'port',
    'portal': :'portal',
    'product_id': :'productId',
    'serial': :'serial',
    'size': :'size',
    'storage_domain_id': :'storageDomainId',
    'target': :'target',
    'username': :'username',
    'vendor_id': :'vendorId',
    'volume_group_id': :'volumeGroupId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 121

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'address': :'String',
    'discard_max_size_in_bytes': :'Integer',
    'is_discard_zeroes_data': :'BOOLEAN',
    'disk_id': :'String',
    'id': :'String',
    'lun_mapping': :'Integer',
    'lun_status': :'String',
    'password': :'String',
    'paths': :'Integer',
    'port': :'Integer',
    'portal': :'String',
    'product_id': :'String',
    'serial': :'String',
    'size': :'Integer',
    'storage_domain_id': :'String',
    'target': :'String',
    'username': :'String',
    'vendor_id': :'String',
    'volume_group_id': :'String'
    # 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



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_migrations/models/logical_unit.rb', line 268

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

  self.class == other.class &&
    address == other.address &&
    discard_max_size_in_bytes == other.discard_max_size_in_bytes &&
    is_discard_zeroes_data == other.is_discard_zeroes_data &&
    disk_id == other.disk_id &&
    id == other.id &&
    lun_mapping == other.lun_mapping &&
    lun_status == other.lun_status &&
    password == other.password &&
    paths == other.paths &&
    port == other.port &&
    portal == other.portal &&
    product_id == other.product_id &&
    serial == other.serial &&
    size == other.size &&
    storage_domain_id == other.storage_domain_id &&
    target == other.target &&
    username == other.username &&
    vendor_id == other.vendor_id &&
    volume_group_id == other.volume_group_id
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



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

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


296
297
298
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 296

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



305
306
307
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 305

def hash
  [address, discard_max_size_in_bytes, is_discard_zeroes_data, disk_id, id, lun_mapping, lun_status, password, paths, port, portal, product_id, serial, size, storage_domain_id, target, username, vendor_id, volume_group_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



349
350
351
352
353
354
355
356
357
358
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 349

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



343
344
345
# File 'lib/oci/cloud_migrations/models/logical_unit.rb', line 343

def to_s
  to_hash.to_s
end