Class: Kubevirt::V1Volume
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Kubevirt::V1Volume
- Defined in:
- lib/kubevirt/models/v1_volume.rb
Overview
Volume represents a named volume in a vmi.
Instance Attribute Summary collapse
-
#cloud_init_config_drive ⇒ Object
Returns the value of attribute cloud_init_config_drive.
-
#cloud_init_no_cloud ⇒ Object
Returns the value of attribute cloud_init_no_cloud.
-
#config_map ⇒ Object
Returns the value of attribute config_map.
-
#container_disk ⇒ Object
Returns the value of attribute container_disk.
-
#data_volume ⇒ Object
Returns the value of attribute data_volume.
-
#downward_api ⇒ Object
Returns the value of attribute downward_api.
-
#downward_metrics ⇒ Object
DownwardMetricsVolumeSource adds a very small disk to VMIs which contains a limited view of host and guest metrics.
-
#empty_disk ⇒ Object
Returns the value of attribute empty_disk.
-
#ephemeral ⇒ Object
Returns the value of attribute ephemeral.
-
#host_disk ⇒ Object
Returns the value of attribute host_disk.
-
#memory_dump ⇒ Object
Returns the value of attribute memory_dump.
-
#name ⇒ Object
Volume’s name.
-
#persistent_volume_claim ⇒ Object
Returns the value of attribute persistent_volume_claim.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#service_account ⇒ Object
Returns the value of attribute service_account.
-
#sysprep ⇒ Object
Returns the value of attribute sysprep.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.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
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ V1Volume
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ V1Volume
Initializes the object
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/kubevirt/models/v1_volume.rb', line 115 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1Volume` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Kubevirt::V1Volume`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'cloud_init_config_drive') self.cloud_init_config_drive = attributes[:'cloud_init_config_drive'] end if attributes.key?(:'cloud_init_no_cloud') self.cloud_init_no_cloud = attributes[:'cloud_init_no_cloud'] end if attributes.key?(:'config_map') self.config_map = attributes[:'config_map'] end if attributes.key?(:'container_disk') self.container_disk = attributes[:'container_disk'] end if attributes.key?(:'data_volume') self.data_volume = attributes[:'data_volume'] end if attributes.key?(:'downward_api') self.downward_api = attributes[:'downward_api'] end if attributes.key?(:'downward_metrics') self.downward_metrics = attributes[:'downward_metrics'] end if attributes.key?(:'empty_disk') self.empty_disk = attributes[:'empty_disk'] end if attributes.key?(:'ephemeral') self.ephemeral = attributes[:'ephemeral'] end if attributes.key?(:'host_disk') self.host_disk = attributes[:'host_disk'] end if attributes.key?(:'memory_dump') self.memory_dump = attributes[:'memory_dump'] end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = '' end if attributes.key?(:'persistent_volume_claim') self.persistent_volume_claim = attributes[:'persistent_volume_claim'] end if attributes.key?(:'secret') self.secret = attributes[:'secret'] end if attributes.key?(:'service_account') self.service_account = attributes[:'service_account'] end if attributes.key?(:'sysprep') self.sysprep = attributes[:'sysprep'] end end |
Instance Attribute Details
#cloud_init_config_drive ⇒ Object
Returns the value of attribute cloud_init_config_drive.
19 20 21 |
# File 'lib/kubevirt/models/v1_volume.rb', line 19 def cloud_init_config_drive @cloud_init_config_drive end |
#cloud_init_no_cloud ⇒ Object
Returns the value of attribute cloud_init_no_cloud.
21 22 23 |
# File 'lib/kubevirt/models/v1_volume.rb', line 21 def cloud_init_no_cloud @cloud_init_no_cloud end |
#config_map ⇒ Object
Returns the value of attribute config_map.
23 24 25 |
# File 'lib/kubevirt/models/v1_volume.rb', line 23 def config_map @config_map end |
#container_disk ⇒ Object
Returns the value of attribute container_disk.
25 26 27 |
# File 'lib/kubevirt/models/v1_volume.rb', line 25 def container_disk @container_disk end |
#data_volume ⇒ Object
Returns the value of attribute data_volume.
27 28 29 |
# File 'lib/kubevirt/models/v1_volume.rb', line 27 def data_volume @data_volume end |
#downward_api ⇒ Object
Returns the value of attribute downward_api.
29 30 31 |
# File 'lib/kubevirt/models/v1_volume.rb', line 29 def downward_api @downward_api end |
#downward_metrics ⇒ Object
DownwardMetricsVolumeSource adds a very small disk to VMIs which contains a limited view of host and guest metrics. The disk content is compatible with vhostmd (github.com/vhostmd/vhostmd) and vm-dump-metrics.
32 33 34 |
# File 'lib/kubevirt/models/v1_volume.rb', line 32 def downward_metrics @downward_metrics end |
#empty_disk ⇒ Object
Returns the value of attribute empty_disk.
34 35 36 |
# File 'lib/kubevirt/models/v1_volume.rb', line 34 def empty_disk @empty_disk end |
#ephemeral ⇒ Object
Returns the value of attribute ephemeral.
36 37 38 |
# File 'lib/kubevirt/models/v1_volume.rb', line 36 def ephemeral @ephemeral end |
#host_disk ⇒ Object
Returns the value of attribute host_disk.
38 39 40 |
# File 'lib/kubevirt/models/v1_volume.rb', line 38 def host_disk @host_disk end |
#memory_dump ⇒ Object
Returns the value of attribute memory_dump.
40 41 42 |
# File 'lib/kubevirt/models/v1_volume.rb', line 40 def memory_dump @memory_dump end |
#name ⇒ Object
Volume’s name. Must be a DNS_LABEL and unique within the vmi. More info: kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
43 44 45 |
# File 'lib/kubevirt/models/v1_volume.rb', line 43 def name @name end |
#persistent_volume_claim ⇒ Object
Returns the value of attribute persistent_volume_claim.
45 46 47 |
# File 'lib/kubevirt/models/v1_volume.rb', line 45 def persistent_volume_claim @persistent_volume_claim end |
#secret ⇒ Object
Returns the value of attribute secret.
47 48 49 |
# File 'lib/kubevirt/models/v1_volume.rb', line 47 def secret @secret end |
#service_account ⇒ Object
Returns the value of attribute service_account.
49 50 51 |
# File 'lib/kubevirt/models/v1_volume.rb', line 49 def service_account @service_account end |
#sysprep ⇒ Object
Returns the value of attribute sysprep.
51 52 53 |
# File 'lib/kubevirt/models/v1_volume.rb', line 51 def sysprep @sysprep end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
76 77 78 |
# File 'lib/kubevirt/models/v1_volume.rb', line 76 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
81 82 83 |
# File 'lib/kubevirt/models/v1_volume.rb', line 81 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/kubevirt/models/v1_volume.rb', line 54 def self.attribute_map { :'cloud_init_config_drive' => :'cloudInitConfigDrive', :'cloud_init_no_cloud' => :'cloudInitNoCloud', :'config_map' => :'configMap', :'container_disk' => :'containerDisk', :'data_volume' => :'dataVolume', :'downward_api' => :'downwardAPI', :'downward_metrics' => :'downwardMetrics', :'empty_disk' => :'emptyDisk', :'ephemeral' => :'ephemeral', :'host_disk' => :'hostDisk', :'memory_dump' => :'memoryDump', :'name' => :'name', :'persistent_volume_claim' => :'persistentVolumeClaim', :'secret' => :'secret', :'service_account' => :'serviceAccount', :'sysprep' => :'sysprep' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/kubevirt/models/v1_volume.rb', line 264 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
108 109 110 111 |
# File 'lib/kubevirt/models/v1_volume.rb', line 108 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/kubevirt/models/v1_volume.rb', line 86 def self.openapi_types { :'cloud_init_config_drive' => :'V1CloudInitConfigDriveSource', :'cloud_init_no_cloud' => :'V1CloudInitNoCloudSource', :'config_map' => :'V1ConfigMapVolumeSource', :'container_disk' => :'V1ContainerDiskSource', :'data_volume' => :'V1DataVolumeSource', :'downward_api' => :'V1DownwardAPIVolumeSource', :'downward_metrics' => :'Object', :'empty_disk' => :'V1EmptyDiskSource', :'ephemeral' => :'V1EphemeralVolumeSource', :'host_disk' => :'V1HostDisk', :'memory_dump' => :'V1MemoryDumpVolumeSource', :'name' => :'String', :'persistent_volume_claim' => :'V1PersistentVolumeClaimVolumeSource', :'secret' => :'V1SecretVolumeSource', :'service_account' => :'V1ServiceAccountVolumeSource', :'sysprep' => :'V1SysprepSource' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/kubevirt/models/v1_volume.rb', line 228 def ==(o) return true if self.equal?(o) self.class == o.class && cloud_init_config_drive == o.cloud_init_config_drive && cloud_init_no_cloud == o.cloud_init_no_cloud && config_map == o.config_map && container_disk == o.container_disk && data_volume == o.data_volume && downward_api == o.downward_api && downward_metrics == o.downward_metrics && empty_disk == o.empty_disk && ephemeral == o.ephemeral && host_disk == o.host_disk && memory_dump == o.memory_dump && name == o.name && persistent_volume_claim == o.persistent_volume_claim && secret == o.secret && service_account == o.service_account && sysprep == o.sysprep end |
#eql?(o) ⇒ Boolean
251 252 253 |
# File 'lib/kubevirt/models/v1_volume.rb', line 251 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
257 258 259 |
# File 'lib/kubevirt/models/v1_volume.rb', line 257 def hash [cloud_init_config_drive, cloud_init_no_cloud, config_map, container_disk, data_volume, downward_api, downward_metrics, empty_disk, ephemeral, host_disk, memory_dump, name, persistent_volume_claim, secret, service_account, sysprep].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
198 199 200 201 202 203 204 205 206 |
# File 'lib/kubevirt/models/v1_volume.rb', line 198 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
286 287 288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/kubevirt/models/v1_volume.rb', line 286 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.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 |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
210 211 212 213 214 |
# File 'lib/kubevirt/models/v1_volume.rb', line 210 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? true end |