Class: OCI::CloudBridge::Models::LogicalUnit
- Inherits:
-
Object
- Object
- OCI::CloudBridge::Models::LogicalUnit
- Defined in:
- lib/oci/cloud_bridge/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
-
#address ⇒ String
Address of the logical unit.
-
#discard_max_size_in_bytes ⇒ Integer
The maximum number of bytes that can be discarded by the logical unitu2019s underlying storage in a single operation.
-
#disk_id ⇒ String
Disk ID of the logical unit.
-
#id ⇒ String
a unique identifier.
-
#is_discard_zeroes_data ⇒ BOOLEAN
True, if previously discarded blocks in the logical unitu2019s underlying storage are read back as zeros.
-
#lun_mapping ⇒ Integer
LUN Mapping.
-
#lun_status ⇒ String
LUN Status.
-
#password ⇒ String
Password of the logical unit.
-
#paths ⇒ Integer
Paths of the logical unit.
-
#port ⇒ Integer
Port of the logical unit.
-
#portal ⇒ String
Portal of the logical unit.
-
#product_id ⇒ String
Product ID of the logical unit.
-
#serial ⇒ String
Serial of the logical unit.
-
#size ⇒ Integer
Size of the logical unit.
-
#storage_domain_id ⇒ String
Storage Domain ID of the logical unit.
-
#target ⇒ String
Target of the logical unit.
-
#username ⇒ String
Username of the logical unit.
-
#vendor_id ⇒ String
Vendor ID of the logical unit.
-
#volume_group_id ⇒ String
Volume Group ID of the logical unit.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ LogicalUnit
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ LogicalUnit
Initializes the object
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_bridge/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
#address ⇒ String
Address of the logical unit.
19 20 21 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 19 def address @address end |
#discard_max_size_in_bytes ⇒ Integer
The maximum number of bytes that can be discarded by the logical unitu2019s underlying storage in a single operation.
23 24 25 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 23 def discard_max_size_in_bytes @discard_max_size_in_bytes end |
#disk_id ⇒ String
Disk ID of the logical unit.
31 32 33 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 31 def disk_id @disk_id end |
#id ⇒ String
a unique identifier.
35 36 37 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 35 def id @id end |
#is_discard_zeroes_data ⇒ BOOLEAN
True, if previously discarded blocks in the logical unitu2019s underlying storage are read back as zeros.
27 28 29 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 27 def is_discard_zeroes_data @is_discard_zeroes_data end |
#lun_mapping ⇒ Integer
LUN Mapping
39 40 41 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 39 def lun_mapping @lun_mapping end |
#lun_status ⇒ String
LUN Status
43 44 45 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 43 def lun_status @lun_status end |
#password ⇒ String
Password of the logical unit.
47 48 49 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 47 def password @password end |
#paths ⇒ Integer
Paths of the logical unit.
51 52 53 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 51 def paths @paths end |
#port ⇒ Integer
Port of the logical unit.
55 56 57 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 55 def port @port end |
#portal ⇒ String
Portal of the logical unit.
59 60 61 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 59 def portal @portal end |
#product_id ⇒ String
Product ID of the logical unit.
63 64 65 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 63 def product_id @product_id end |
#serial ⇒ String
Serial of the logical unit.
67 68 69 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 67 def serial @serial end |
#size ⇒ Integer
Size of the logical unit.
71 72 73 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 71 def size @size end |
#storage_domain_id ⇒ String
Storage Domain ID of the logical unit.
75 76 77 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 75 def storage_domain_id @storage_domain_id end |
#target ⇒ String
Target of the logical unit.
79 80 81 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 79 def target @target end |
#username ⇒ String
Username of the logical unit.
83 84 85 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 83 def username @username end |
#vendor_id ⇒ String
Vendor ID of the logical unit.
87 88 89 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 87 def vendor_id @vendor_id end |
#volume_group_id ⇒ String
Volume Group ID of the logical unit.
91 92 93 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 91 def volume_group_id @volume_group_id end |
Class Method Details
.attribute_map ⇒ Object
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_bridge/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_types ⇒ Object
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_bridge/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.
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/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
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_bridge/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
296 297 298 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 296 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
305 306 307 |
# File 'lib/oci/cloud_bridge/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_hash ⇒ Hash
Returns the object in the form of hash
349 350 351 352 353 354 355 356 357 358 |
# File 'lib/oci/cloud_bridge/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_s ⇒ String
Returns the string representation of the object
343 344 345 |
# File 'lib/oci/cloud_bridge/models/logical_unit.rb', line 343 def to_s to_hash.to_s end |