Class: OCI::CloudBridge::Models::OlvmIscsiDetails

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

Overview

The host iSCSI details.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OlvmIscsiDetails

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

  • :disk_id (String)

    The value to assign to the #disk_id property

  • :initiator (String)

    The value to assign to the #initiator property

  • :lun_mapping (Integer)

    The value to assign to the #lun_mapping 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_in_bytes (Integer)

    The value to assign to the #size_in_bytes property

  • :status (String)

    The value to assign to the #status 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



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
201
202
203
204
205
206
207
208
209
210
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 145

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

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

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

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

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

  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 iSCSI

Returns:

  • (String)


13
14
15
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 13

def address
  @address
end

#disk_idString

Disk ID of iSCSI

Returns:

  • (String)


17
18
19
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 17

def disk_id
  @disk_id
end

#initiatorString

Initiator of iSCSI

Returns:

  • (String)


21
22
23
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 21

def initiator
  @initiator
end

#lun_mappingInteger

LUN Mapping of iSCSI

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 25

def lun_mapping
  @lun_mapping
end

#pathsInteger

Number of paths of iSCSI

Returns:

  • (Integer)


29
30
31
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 29

def paths
  @paths
end

#portInteger

Port number of iSCSI

Returns:

  • (Integer)


33
34
35
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 33

def port
  @port
end

#portalString

Portal of iSCSI

Returns:

  • (String)


37
38
39
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 37

def portal
  @portal
end

#product_idString

Product ID of iSCSI

Returns:

  • (String)


41
42
43
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 41

def product_id
  @product_id
end

#serialString

Serial of iSCSI

Returns:

  • (String)


45
46
47
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 45

def serial
  @serial
end

#size_in_bytesInteger

size of iSCSI

Returns:

  • (Integer)


49
50
51
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 49

def size_in_bytes
  @size_in_bytes
end

#statusString

Status of iSCSI

Returns:

  • (String)


53
54
55
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 53

def status
  @status
end

#storage_domain_idString

Storage Domain ID of iSCSI

Returns:

  • (String)


57
58
59
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 57

def storage_domain_id
  @storage_domain_id
end

#targetString

target of iSCSI

Returns:

  • (String)


61
62
63
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 61

def target
  @target
end

#usernameString

Username of iSCSI

Returns:

  • (String)


65
66
67
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 65

def username
  @username
end

#vendor_idString

Vendor ID of iSCSI

Returns:

  • (String)


69
70
71
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 69

def vendor_id
  @vendor_id
end

#volume_group_idString

Volume Group ID of iSCSI

Returns:

  • (String)


73
74
75
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 73

def volume_group_id
  @volume_group_id
end

Class Method Details

.attribute_mapObject

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



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 76

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'address': :'address',
    'disk_id': :'diskId',
    'initiator': :'initiator',
    'lun_mapping': :'lunMapping',
    'paths': :'paths',
    'port': :'port',
    'portal': :'portal',
    'product_id': :'productId',
    'serial': :'serial',
    'size_in_bytes': :'sizeInBytes',
    'status': :'status',
    '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.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 100

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'address': :'String',
    'disk_id': :'String',
    'initiator': :'String',
    'lun_mapping': :'Integer',
    'paths': :'Integer',
    'port': :'Integer',
    'portal': :'String',
    'product_id': :'String',
    'serial': :'String',
    'size_in_bytes': :'Integer',
    'status': :'String',
    '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



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 219

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

  self.class == other.class &&
    address == other.address &&
    disk_id == other.disk_id &&
    initiator == other.initiator &&
    lun_mapping == other.lun_mapping &&
    paths == other.paths &&
    port == other.port &&
    portal == other.portal &&
    product_id == other.product_id &&
    serial == other.serial &&
    size_in_bytes == other.size_in_bytes &&
    status == other.status &&
    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



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 264

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


244
245
246
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 244

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



253
254
255
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 253

def hash
  [address, disk_id, initiator, lun_mapping, paths, port, portal, product_id, serial, size_in_bytes, status, 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



297
298
299
300
301
302
303
304
305
306
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 297

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



291
292
293
# File 'lib/oci/cloud_bridge/models/olvm_iscsi_details.rb', line 291

def to_s
  to_hash.to_s
end