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

Inherits:
VolumeAttachment show all
Defined in:
lib/oci/core/models/i_scsi_volume_attachment.rb

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, #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



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 47

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

  if attributes[:'chapUsername']
    self.chap_username = attributes[:'chapUsername']
  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)


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

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)


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

def chap_username
  @chap_username
end

#ipv4String

The volume’s iSCSI IP address.

Example: ‘169.254.0.2`

Returns:

  • (String)


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

def ipv4
  @ipv4
end

#iqnString

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)


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

def iqn
  @iqn
end

#portInteger

The volume’s iSCSI port.

Example: ‘3260`

Returns:

  • (Integer)


42
43
44
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 42

def port
  @port
end

Instance Method Details

#==(other_object) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other_object (Object)

    to be compared



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 81

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 &&
      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



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 115

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_send("#{key}=", 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_send("#{key}=", 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


102
103
104
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 102

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



108
109
110
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 108

def hash
  [attachment_type, availability_domain, compartment_id, display_name, id, instance_id, 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



140
141
142
143
144
145
146
147
148
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 140

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_send(attr)
    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



134
135
136
# File 'lib/oci/core/models/i_scsi_volume_attachment.rb', line 134

def to_s
  to_hash.to_s
end