Class: OCI::Core::Models::IScsiVolumeAttachment

Inherits:
VolumeAttachment show all
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

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

Methods inherited from VolumeAttachment

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ IScsiVolumeAttachment

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :availability_domain (String)

    The value to assign to the #availability_domain proprety

  • :compartment_id (String)

    The value to assign to the #compartment_id proprety

  • :display_name (String)

    The value to assign to the #display_name proprety

  • :id (String)

    The value to assign to the #id proprety

  • :instance_id (String)

    The value to assign to the #instance_id proprety

  • :is_read_only (BOOLEAN)

    The value to assign to the #is_read_only proprety

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state proprety

  • :time_created (DateTime)

    The value to assign to the #time_created proprety

  • :volume_id (String)

    The value to assign to the #volume_id proprety

  • :chap_secret (String)

    The value to assign to the #chap_secret property

  • :chap_username (String)

    The value to assign to the #chap_username property

  • :ipv4 (String)

    The value to assign to the #ipv4 property

  • :iqn (String)

    The value to assign to the #iqn property

  • :port (Integer)

    The value to assign to the #port property



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_secretString

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`

Returns:

  • (String)


15
16
17
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 15

def chap_secret
  @chap_secret
end

#chap_usernameString

The volume’s system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name.

Example: ‘ocid1.volume.oc1.phx.abyhqljrgvttnlx73nmrwfaux7kcvzfs3s66izvxf2h4lgvyndsdsnoiwr5q`

Returns:

  • (String)


22
23
24
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 22

def chap_username
  @chap_username
end

#ipv4String

[Required] The volume’s iSCSI IP address.

Example: ‘169.254.0.2`

Returns:

  • (String)


29
30
31
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 29

def ipv4
  @ipv4
end

#iqnString

[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`

Returns:

  • (String)


36
37
38
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 36

def iqn
  @iqn
end

#portInteger

[Required] The volume’s iSCSI port.

Example: ‘3260`

Returns:

  • (Integer)


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.

Parameters:

  • other_object (Object)

    to be compared



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 &&
      attachment_type == other_object.attachment_type &&
      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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



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

Parameters:

  • other_object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


130
131
132
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 130

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



136
137
138
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 136

def hash
  [attachment_type, 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_hashHash

Returns the object in the form of hash

Returns:

  • (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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation 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