Class: Kubernetes::V1ISCSIPersistentVolumeSource

Inherits:
Object
  • Object
show all
Defined in:
lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb

Overview

ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ V1ISCSIPersistentVolumeSource

Initializes the object



87
88
89
90
91
92
93
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
119
120
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 87

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.transform_keys(&:to_sym)

  if attributes.key?(:chapAuthDiscovery)
    self.chap_auth_discovery = attributes[:chapAuthDiscovery]
  end

  self.chap_auth_session = attributes[:chapAuthSession] if attributes.key?(:chapAuthSession)

  self.fs_type = attributes[:fsType] if attributes.key?(:fsType)

  self.initiator_name = attributes[:initiatorName] if attributes.key?(:initiatorName)

  self.iqn = attributes[:iqn] if attributes.key?(:iqn)

  self.iscsi_interface = attributes[:iscsiInterface] if attributes.key?(:iscsiInterface)

  self.lun = attributes[:lun] if attributes.key?(:lun)

  if attributes.key?(:portals) && (value = attributes[:portals]).is_a?(Array)
    self.portals = value
  end

  self.read_only = attributes[:readOnly] if attributes.key?(:readOnly)

  self.secret_ref = attributes[:secretRef] if attributes.key?(:secretRef)

  return unless attributes.key?(:targetPortal)

  self.target_portal = attributes[:targetPortal]
end

Instance Attribute Details

#chap_auth_discoveryObject

whether support iSCSI Discovery CHAP authentication



19
20
21
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 19

def chap_auth_discovery
  @chap_auth_discovery
end

#chap_auth_sessionObject

whether support iSCSI Session CHAP authentication



22
23
24
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 22

def chap_auth_session
  @chap_auth_session
end

#fs_typeObject

Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: kubernetes.io/docs/concepts/storage/volumes#iscsi



25
26
27
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 25

def fs_type
  @fs_type
end

#initiator_nameObject

Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface <target portal>:<volume name> will be created for the connection.



28
29
30
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 28

def initiator_name
  @initiator_name
end

#iqnObject

Target iSCSI Qualified Name.



31
32
33
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 31

def iqn
  @iqn
end

#iscsi_interfaceObject

iSCSI Interface Name that uses an iSCSI transport. Defaults to ‘default’ (tcp).



34
35
36
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 34

def iscsi_interface
  @iscsi_interface
end

#lunObject

iSCSI Target Lun number.



37
38
39
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 37

def lun
  @lun
end

#portalsObject

iSCSI Target Portal List. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).



40
41
42
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 40

def portals
  @portals
end

#read_onlyObject

ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.



43
44
45
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 43

def read_only
  @read_only
end

#secret_refObject

CHAP Secret for iSCSI target and initiator authentication



46
47
48
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 46

def secret_ref
  @secret_ref
end

#target_portalObject

iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).



49
50
51
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 49

def target_portal
  @target_portal
end

Class Method Details

.attribute_mapObject

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



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 52

def self.attribute_map
  {
    chap_auth_discovery: :chapAuthDiscovery,
    chap_auth_session: :chapAuthSession,
    fs_type: :fsType,
    initiator_name: :initiatorName,
    iqn: :iqn,
    iscsi_interface: :iscsiInterface,
    lun: :lun,
    portals: :portals,
    read_only: :readOnly,
    secret_ref: :secretRef,
    target_portal: :targetPortal
  }
end

.swagger_typesObject

Attribute type mapping.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 69

def self.swagger_types
  {
    chap_auth_discovery: :BOOLEAN,
    chap_auth_session: :BOOLEAN,
    fs_type: :String,
    initiator_name: :String,
    iqn: :String,
    iscsi_interface: :String,
    lun: :Integer,
    portals: :'Array<String>',
    read_only: :BOOLEAN,
    secret_ref: :V1SecretReference,
    target_portal: :String
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 149

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

  self.class == other.class &&
    chap_auth_discovery == other.chap_auth_discovery &&
    chap_auth_session == other.chap_auth_session &&
    fs_type == other.fs_type &&
    initiator_name == other.initiator_name &&
    iqn == other.iqn &&
    iscsi_interface == other.iscsi_interface &&
    lun == other.lun &&
    portals == other.portals &&
    read_only == other.read_only &&
    secret_ref == other.secret_ref &&
    target_portal == other.target_portal
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type



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
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 206

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = Kubernetes.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value



273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 273

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 182

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/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)
        send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
                          _deserialize(Regexp.last_match(1), v)
                        end)
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(other) ⇒ Boolean

See Also:

  • `==` method


168
169
170
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 168

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.



174
175
176
177
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 174

def hash
  [chap_auth_discovery, chap_auth_session, fs_type, initiator_name, iqn, iscsi_interface, lun,
   portals, read_only, secret_ref, target_portal].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?



124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 124

def list_invalid_properties
  invalid_properties = []
  invalid_properties.push("invalid value for 'iqn', iqn cannot be nil.") if @iqn.nil?

  invalid_properties.push("invalid value for 'lun', lun cannot be nil.") if @lun.nil?

  if @target_portal.nil?
    invalid_properties.push("invalid value for 'target_portal', target_portal cannot be nil.")
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)



252
253
254
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 252

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash



258
259
260
261
262
263
264
265
266
267
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 258

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = send(attr)
    next if value.nil?

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object



246
247
248
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 246

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid



139
140
141
142
143
144
145
# File 'lib/kubernetes/models/v1_iscsi_persistent_volume_source.rb', line 139

def valid?
  return false if @iqn.nil?
  return false if @lun.nil?
  return false if @target_portal.nil?

  true
end