Class: Zilla::IoK8sApiCoreV1ISCSIPersistentVolumeSource
- Inherits:
-
Object
- Object
- Zilla::IoK8sApiCoreV1ISCSIPersistentVolumeSource
- Defined in:
- lib/zilla/models/io_k8s_api_core_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
-
#chap_auth_discovery ⇒ Object
chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication.
-
#chap_auth_session ⇒ Object
chapAuthSession defines whether support iSCSI Session CHAP authentication.
-
#fs_type ⇒ Object
fsType is the filesystem type of the volume that you want to mount.
-
#initiator_name ⇒ Object
initiatorName is the custom iSCSI Initiator Name.
-
#iqn ⇒ Object
iqn is Target iSCSI Qualified Name.
-
#iscsi_interface ⇒ Object
iscsiInterface is the interface Name that uses an iSCSI transport.
-
#lun ⇒ Object
lun is iSCSI Target Lun number.
-
#portals ⇒ Object
portals is the iSCSI Target Portal List.
-
#read_only ⇒ Object
readOnly here will force the ReadOnly setting in VolumeMounts.
-
#secret_ref ⇒ Object
Returns the value of attribute secret_ref.
-
#target_portal ⇒ Object
targetPortal is iSCSI Target Portal.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ IoK8sApiCoreV1ISCSIPersistentVolumeSource
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ IoK8sApiCoreV1ISCSIPersistentVolumeSource
Initializes the object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 97 def initialize(attributes = {}) unless attributes.is_a?(Hash) raise ArgumentError, 'The input argument (attributes) must be a hash in `Zilla::IoK8sApiCoreV1ISCSIPersistentVolumeSource` initialize method' end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) do |(k, v), h| unless self.class.attribute_map.key?(k.to_sym) raise ArgumentError, "`#{k}` is not a valid attribute in `Zilla::IoK8sApiCoreV1ISCSIPersistentVolumeSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v end self.chap_auth_discovery = attributes[:chap_auth_discovery] if attributes.key?(:chap_auth_discovery) self.chap_auth_session = attributes[:chap_auth_session] if attributes.key?(:chap_auth_session) self.fs_type = attributes[:fs_type] if attributes.key?(:fs_type) self.initiator_name = attributes[:initiator_name] if attributes.key?(:initiator_name) self.iqn = attributes[:iqn] if attributes.key?(:iqn) self.iscsi_interface = attributes[:iscsi_interface] if attributes.key?(:iscsi_interface) 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[:read_only] if attributes.key?(:read_only) self.secret_ref = attributes[:secret_ref] if attributes.key?(:secret_ref) return unless attributes.key?(:target_portal) self.target_portal = attributes[:target_portal] end |
Instance Attribute Details
#chap_auth_discovery ⇒ Object
chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication
20 21 22 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 20 def chap_auth_discovery @chap_auth_discovery end |
#chap_auth_session ⇒ Object
chapAuthSession defines whether support iSCSI Session CHAP authentication
23 24 25 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 23 def chap_auth_session @chap_auth_session end |
#fs_type ⇒ Object
fsType is the 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
26 27 28 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 26 def fs_type @fs_type end |
#initiator_name ⇒ Object
initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface <target portal>:<volume name> will be created for the connection.
29 30 31 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 29 def initiator_name @initiator_name end |
#iqn ⇒ Object
iqn is Target iSCSI Qualified Name.
32 33 34 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 32 def iqn @iqn end |
#iscsi_interface ⇒ Object
iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to ‘default’ (tcp).
35 36 37 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 35 def iscsi_interface @iscsi_interface end |
#lun ⇒ Object
lun is iSCSI Target Lun number.
38 39 40 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 38 def lun @lun end |
#portals ⇒ Object
portals is the 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).
41 42 43 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 41 def portals @portals end |
#read_only ⇒ Object
readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.
44 45 46 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 44 def read_only @read_only end |
#secret_ref ⇒ Object
Returns the value of attribute secret_ref.
46 47 48 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 46 def secret_ref @secret_ref end |
#target_portal ⇒ Object
targetPortal is 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/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 49 def target_portal @target_portal end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
69 70 71 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 69 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
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/zilla/models/io_k8s_api_core_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 |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
198 199 200 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 198 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
91 92 93 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 91 def self.openapi_nullable Set.new([]) end |
.openapi_types ⇒ Object
Attribute type mapping.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 74 def self.openapi_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: :IoK8sApiCoreV1SecretReference, target_portal: :String } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 165 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
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 232 def _deserialize(type, value) case type.to_sym when :Time Time.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 # models (e.g. Pet) or oneOf klass = Zilla.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
303 304 305 306 307 308 309 310 311 312 313 314 315 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 303 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
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 205 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that 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
184 185 186 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 184 def eql?(other) self == other end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
190 191 192 193 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 190 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_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
142 143 144 145 146 147 148 149 150 151 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 142 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? invalid_properties.push('invalid value for "target_portal", target_portal cannot be nil.') if @target_portal.nil? invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
279 280 281 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 279 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 285 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
273 274 275 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 273 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
155 156 157 158 159 160 161 |
# File 'lib/zilla/models/io_k8s_api_core_v1_iscsi_persistent_volume_source.rb', line 155 def valid? return false if @iqn.nil? return false if @lun.nil? return false if @target_portal.nil? true end |