Class: OCI::Core::Models::IScsiVolumeAttachment
- Inherits:
-
VolumeAttachment
- Object
- VolumeAttachment
- OCI::Core::Models::IScsiVolumeAttachment
- Defined in:
- lib/oci/core/models/i_scsi_volume_attachment.rb
Overview
An ISCSI volume attachment.
Constant Summary
Constants inherited from VolumeAttachment
VolumeAttachment::LIFECYCLE_STATE_ENUM
Instance Attribute Summary collapse
-
#chap_secret ⇒ String
The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name.
-
#chap_username ⇒ String
The volume’s system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name.
-
#ipv4 ⇒ String
[Required] The volume’s iSCSI IP address.
-
#iqn ⇒ String
[Required] The target volume’s iSCSI Qualified Name in the format defined by RFC 3720.
-
#port ⇒ Integer
[Required] The volume’s iSCSI port.
Attributes inherited from VolumeAttachment
#attachment_type, #availability_domain, #compartment_id, #display_name, #id, #instance_id, #is_read_only, #lifecycle_state, #time_created, #volume_id
Instance Method Summary collapse
-
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other_object) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ IScsiVolumeAttachment
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.
Methods inherited from VolumeAttachment
Constructor Details
#initialize(attributes = {}) ⇒ IScsiVolumeAttachment
Initializes the object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 62 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['attachmentType'] = 'iscsi' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes[:'chapSecret'] self.chap_secret = attributes[:'chapSecret'] end raise 'You cannot provide both :chapSecret and :chap_secret' if attributes.key?(:'chapSecret') && attributes.key?(:'chap_secret') if attributes[:'chap_secret'] self.chap_secret = attributes[:'chap_secret'] end if attributes[:'chapUsername'] self.chap_username = attributes[:'chapUsername'] end raise 'You cannot provide both :chapUsername and :chap_username' if attributes.key?(:'chapUsername') && attributes.key?(:'chap_username') if attributes[:'chap_username'] self.chap_username = attributes[:'chap_username'] end if attributes[:'ipv4'] self.ipv4 = attributes[:'ipv4'] end if attributes[:'iqn'] self.iqn = attributes[:'iqn'] end if attributes[:'port'] self.port = attributes[:'port'] end end |
Instance Attribute Details
#chap_secret ⇒ String
The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name. (Also called the "CHAP password".)
Example: ‘d6866c0d-298b-48ba-95af-309b4faux45e`
15 16 17 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 15 def chap_secret @chap_secret end |
#chap_username ⇒ String
The volume’s system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name.
Example: ‘ocid1.volume.oc1.phx.abyhqljrgvttnlx73nmrwfaux7kcvzfs3s66izvxf2h4lgvyndsdsnoiwr5q`
22 23 24 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 22 def chap_username @chap_username end |
#ipv4 ⇒ String
[Required] The volume’s iSCSI IP address.
Example: ‘169.254.0.2`
29 30 31 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 29 def ipv4 @ipv4 end |
#iqn ⇒ String
[Required] The target volume’s iSCSI Qualified Name in the format defined by RFC 3720.
Example: ‘iqn.2015-12.us.oracle.com:456b0391-17b8-4122-bbf1-f85fc0bb97d9`
36 37 38 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 36 def iqn @iqn end |
#port ⇒ Integer
[Required] The volume’s iSCSI port.
Example: ‘3260`
43 44 45 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 43 def port @port end |
Instance Method Details
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 108 def ==(other_object) return true if self.equal?(other_object) self.class == other_object.class && == other_object. && availability_domain == other_object.availability_domain && compartment_id == other_object.compartment_id && display_name == other_object.display_name && id == other_object.id && instance_id == other_object.instance_id && is_read_only == other_object.is_read_only && lifecycle_state == other_object.lifecycle_state && time_created == other_object.time_created && volume_id == other_object.volume_id && chap_secret == other_object.chap_secret && chap_username == other_object.chap_username && ipv4 == other_object.ipv4 && iqn == other_object.iqn && port == other_object.port end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 143 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) self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.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_object) ⇒ Boolean
130 131 132 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 130 def eql?(other_object) self == other_object end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
136 137 138 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 136 def hash [, availability_domain, compartment_id, display_name, id, instance_id, is_read_only, lifecycle_state, time_created, volume_id, chap_secret, chap_username, ipv4, iqn, port].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
168 169 170 171 172 173 174 175 176 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 168 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
162 163 164 |
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 162 def to_s to_hash.to_s end |