Class: NutanixClustermgmt::ClustermgmtV40ConfigDisk
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- NutanixClustermgmt::ClustermgmtV40ConfigDisk
- Defined in:
- lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb
Overview
A model that represents the Disk resources.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#cluster_ext_id ⇒ Object
The external identifier of the cluster on which Disk will be added.
-
#cluster_name ⇒ Object
Cluster name of the Disk it belongs to.
-
#cvm_ip_address ⇒ Object
Returns the value of attribute cvm_ip_address.
-
#disk_advance_config ⇒ Object
Returns the value of attribute disk_advance_config.
-
#disk_size_bytes ⇒ Object
Size of the Disk in bytes.
-
#ext_id ⇒ Object
A globally unique identifier of an instance that is suitable for external consumption.
-
#firmware_version ⇒ Object
Represents the current firmware version.
-
#host_name ⇒ Object
Host name of the Disk to which it belongs.
-
#links ⇒ Object
A HATEOAS style link for the response.
-
#location ⇒ Object
Indicates the location of the Disk in a node.
-
#model ⇒ Object
Represents the Disk model.
-
#mount_path ⇒ Object
Represents the mount path of the Disk.
-
#node_ext_id ⇒ Object
The external identifier of the node.
-
#node_ip_address ⇒ Object
Returns the value of attribute node_ip_address.
-
#nvme_pcie_path ⇒ Object
Indicates the PCIe path of NVMe devices.
-
#physical_capacity_bytes ⇒ Object
Physical capacity of the Disk in bytes.
-
#serial_number ⇒ Object
Represents the Disk serial number.
-
#service_vmid ⇒ Object
The service VM ID of the node.
-
#status ⇒ Object
Returns the value of attribute status.
-
#storage_pool_ext_id ⇒ Object
The external identifier of a storage pool.
-
#storage_tier ⇒ Object
Returns the value of attribute storage_tier.
-
#target_firmware_version ⇒ Object
Represents the target firmware version.
-
#tenant_id ⇒ Object
A globally unique identifier that represents the tenant that owns this entity.
-
#vendor ⇒ Object
Represents the Disk vendor.
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_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.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 = {}) ⇒ ClustermgmtV40ConfigDisk
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 = {}) ⇒ ClustermgmtV40ConfigDisk
Initializes the object
194 195 196 197 198 199 200 201 202 203 204 205 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 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 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 194 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `NutanixClustermgmt::ClustermgmtV40ConfigDisk` 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 `NutanixClustermgmt::ClustermgmtV40ConfigDisk`. 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?(:'tenant_id') self.tenant_id = attributes[:'tenant_id'] end if attributes.key?(:'ext_id') self.ext_id = attributes[:'ext_id'] end if attributes.key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end end if attributes.key?(:'cluster_name') self.cluster_name = attributes[:'cluster_name'] end if attributes.key?(:'cluster_ext_id') self.cluster_ext_id = attributes[:'cluster_ext_id'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'storage_tier') self.storage_tier = attributes[:'storage_tier'] end if attributes.key?(:'storage_pool_ext_id') self.storage_pool_ext_id = attributes[:'storage_pool_ext_id'] end if attributes.key?(:'service_vmid') self.service_vmid = attributes[:'service_vmid'] end if attributes.key?(:'node_ext_id') self.node_ext_id = attributes[:'node_ext_id'] end if attributes.key?(:'cvm_ip_address') self.cvm_ip_address = attributes[:'cvm_ip_address'] end if attributes.key?(:'node_ip_address') self.node_ip_address = attributes[:'node_ip_address'] end if attributes.key?(:'mount_path') self.mount_path = attributes[:'mount_path'] end if attributes.key?(:'location') self.location = attributes[:'location'] end if attributes.key?(:'serial_number') self.serial_number = attributes[:'serial_number'] end if attributes.key?(:'disk_size_bytes') self.disk_size_bytes = attributes[:'disk_size_bytes'] end if attributes.key?(:'physical_capacity_bytes') self.physical_capacity_bytes = attributes[:'physical_capacity_bytes'] end if attributes.key?(:'model') self.model = attributes[:'model'] end if attributes.key?(:'vendor') self.vendor = attributes[:'vendor'] end if attributes.key?(:'nvme_pcie_path') self.nvme_pcie_path = attributes[:'nvme_pcie_path'] end if attributes.key?(:'firmware_version') self.firmware_version = attributes[:'firmware_version'] end if attributes.key?(:'target_firmware_version') self.target_firmware_version = attributes[:'target_firmware_version'] end if attributes.key?(:'host_name') self.host_name = attributes[:'host_name'] end if attributes.key?(:'disk_advance_config') self.disk_advance_config = attributes[:'disk_advance_config'] end end |
Instance Attribute Details
#cluster_ext_id ⇒ Object
The external identifier of the cluster on which Disk will be added.
32 33 34 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 32 def cluster_ext_id @cluster_ext_id end |
#cluster_name ⇒ Object
Cluster name of the Disk it belongs to.
29 30 31 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 29 def cluster_name @cluster_name end |
#cvm_ip_address ⇒ Object
Returns the value of attribute cvm_ip_address.
47 48 49 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 47 def cvm_ip_address @cvm_ip_address end |
#disk_advance_config ⇒ Object
Returns the value of attribute disk_advance_config.
84 85 86 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 84 def disk_advance_config @disk_advance_config end |
#disk_size_bytes ⇒ Object
Size of the Disk in bytes.
61 62 63 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 61 def disk_size_bytes @disk_size_bytes end |
#ext_id ⇒ Object
A globally unique identifier of an instance that is suitable for external consumption.
23 24 25 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 23 def ext_id @ext_id end |
#firmware_version ⇒ Object
Represents the current firmware version.
76 77 78 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 76 def firmware_version @firmware_version end |
#host_name ⇒ Object
Host name of the Disk to which it belongs.
82 83 84 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 82 def host_name @host_name end |
#links ⇒ Object
A HATEOAS style link for the response. Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource.
26 27 28 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 26 def links @links end |
#location ⇒ Object
Indicates the location of the Disk in a node.
55 56 57 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 55 def location @location end |
#model ⇒ Object
Represents the Disk model.
67 68 69 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 67 def model @model end |
#mount_path ⇒ Object
Represents the mount path of the Disk.
52 53 54 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 52 def mount_path @mount_path end |
#node_ext_id ⇒ Object
The external identifier of the node.
45 46 47 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 45 def node_ext_id @node_ext_id end |
#node_ip_address ⇒ Object
Returns the value of attribute node_ip_address.
49 50 51 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 49 def node_ip_address @node_ip_address end |
#nvme_pcie_path ⇒ Object
Indicates the PCIe path of NVMe devices.
73 74 75 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 73 def nvme_pcie_path @nvme_pcie_path end |
#physical_capacity_bytes ⇒ Object
Physical capacity of the Disk in bytes.
64 65 66 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 64 def physical_capacity_bytes @physical_capacity_bytes end |
#serial_number ⇒ Object
Represents the Disk serial number.
58 59 60 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 58 def serial_number @serial_number end |
#service_vmid ⇒ Object
The service VM ID of the node.
42 43 44 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 42 def service_vmid @service_vmid end |
#status ⇒ Object
Returns the value of attribute status.
34 35 36 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 34 def status @status end |
#storage_pool_ext_id ⇒ Object
The external identifier of a storage pool.
39 40 41 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 39 def storage_pool_ext_id @storage_pool_ext_id end |
#storage_tier ⇒ Object
Returns the value of attribute storage_tier.
36 37 38 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 36 def storage_tier @storage_tier end |
#target_firmware_version ⇒ Object
Represents the target firmware version.
79 80 81 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 79 def target_firmware_version @target_firmware_version end |
#tenant_id ⇒ Object
A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
20 21 22 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 20 def tenant_id @tenant_id end |
#vendor ⇒ Object
Represents the Disk vendor.
70 71 72 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 70 def vendor @vendor end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
139 140 141 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 139 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
144 145 146 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 144 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 109 def self.attribute_map { :'tenant_id' => :'tenantId', :'ext_id' => :'extId', :'links' => :'links', :'cluster_name' => :'clusterName', :'cluster_ext_id' => :'clusterExtId', :'status' => :'status', :'storage_tier' => :'storageTier', :'storage_pool_ext_id' => :'storagePoolExtId', :'service_vmid' => :'serviceVMId', :'node_ext_id' => :'nodeExtId', :'cvm_ip_address' => :'cvmIpAddress', :'node_ip_address' => :'nodeIpAddress', :'mount_path' => :'mountPath', :'location' => :'location', :'serial_number' => :'serialNumber', :'disk_size_bytes' => :'diskSizeBytes', :'physical_capacity_bytes' => :'physicalCapacityBytes', :'model' => :'model', :'vendor' => :'vendor', :'nvme_pcie_path' => :'nvmePciePath', :'firmware_version' => :'firmwareVersion', :'target_firmware_version' => :'targetFirmwareVersion', :'host_name' => :'hostName', :'disk_advance_config' => :'diskAdvanceConfig' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 710 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_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
186 187 188 189 190 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 186 def self.openapi_all_of [ :'CommonV10ResponseExternalizableAbstractModel' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
179 180 181 182 183 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 179 def self.openapi_nullable Set.new([ :'ext_id', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 149 def self.openapi_types { :'tenant_id' => :'String', :'ext_id' => :'String', :'links' => :'Array<CommonV10ResponseApiLink>', :'cluster_name' => :'String', :'cluster_ext_id' => :'String', :'status' => :'ClustermgmtV40ConfigDiskStatus', :'storage_tier' => :'ClustermgmtV40ConfigStorageTier', :'storage_pool_ext_id' => :'String', :'service_vmid' => :'String', :'node_ext_id' => :'String', :'cvm_ip_address' => :'CommonV10ConfigIPAddress', :'node_ip_address' => :'CommonV10ConfigIPAddress', :'mount_path' => :'String', :'location' => :'Integer', :'serial_number' => :'String', :'disk_size_bytes' => :'Integer', :'physical_capacity_bytes' => :'Integer', :'model' => :'String', :'vendor' => :'String', :'nvme_pcie_path' => :'String', :'firmware_version' => :'String', :'target_firmware_version' => :'String', :'host_name' => :'String', :'disk_advance_config' => :'ClustermgmtV40ConfigDiskAdvanceConfig' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 666 def ==(o) return true if self.equal?(o) self.class == o.class && tenant_id == o.tenant_id && ext_id == o.ext_id && links == o.links && cluster_name == o.cluster_name && cluster_ext_id == o.cluster_ext_id && status == o.status && storage_tier == o.storage_tier && storage_pool_ext_id == o.storage_pool_ext_id && service_vmid == o.service_vmid && node_ext_id == o.node_ext_id && cvm_ip_address == o.cvm_ip_address && node_ip_address == o.node_ip_address && mount_path == o.mount_path && location == o.location && serial_number == o.serial_number && disk_size_bytes == o.disk_size_bytes && physical_capacity_bytes == o.physical_capacity_bytes && model == o.model && vendor == o.vendor && nvme_pcie_path == o.nvme_pcie_path && firmware_version == o.firmware_version && target_firmware_version == o.target_firmware_version && host_name == o.host_name && disk_advance_config == o.disk_advance_config end |
#eql?(o) ⇒ Boolean
697 698 699 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 697 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
703 704 705 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 703 def hash [tenant_id, ext_id, links, cluster_name, cluster_ext_id, status, storage_tier, storage_pool_ext_id, service_vmid, node_ext_id, cvm_ip_address, node_ip_address, mount_path, location, serial_number, disk_size_bytes, physical_capacity_bytes, model, vendor, nvme_pcie_path, firmware_version, target_firmware_version, host_name, disk_advance_config].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 309 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@tenant_id.nil? && @tenant_id !~ pattern invalid_properties.push("invalid value for \"tenant_id\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@ext_id.nil? && @ext_id !~ pattern invalid_properties.push("invalid value for \"ext_id\", must conform to the pattern #{pattern}.") end if !@links.nil? && @links.length > 20 invalid_properties.push('invalid value for "links", number of items must be less than or equal to 20.') end if !@links.nil? && @links.length < 0 invalid_properties.push('invalid value for "links", number of items must be greater than or equal to 0.') end if !@cluster_name.nil? && @cluster_name.to_s.length > 256 invalid_properties.push('invalid value for "cluster_name", the character length must be smaller than or equal to 256.') end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@cluster_ext_id.nil? && @cluster_ext_id !~ pattern invalid_properties.push("invalid value for \"cluster_ext_id\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@storage_pool_ext_id.nil? && @storage_pool_ext_id !~ pattern invalid_properties.push("invalid value for \"storage_pool_ext_id\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}::[0-9]{1,}$/) if !@service_vmid.nil? && @service_vmid !~ pattern invalid_properties.push("invalid value for \"service_vmid\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@node_ext_id.nil? && @node_ext_id !~ pattern invalid_properties.push("invalid value for \"node_ext_id\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^\/home\/nutanix\/data\/stargate-storage\/disks\/[A-Z0-9]{8}$/) if !@mount_path.nil? && @mount_path !~ pattern invalid_properties.push("invalid value for \"mount_path\", must conform to the pattern #{pattern}.") end if !@serial_number.nil? && @serial_number.to_s.length > 256 invalid_properties.push('invalid value for "serial_number", the character length must be smaller than or equal to 256.') end if !@disk_size_bytes.nil? && @disk_size_bytes < 524288 invalid_properties.push('invalid value for "disk_size_bytes", must be greater than or equal to 524288.') end if !@physical_capacity_bytes.nil? && @physical_capacity_bytes < 524288 invalid_properties.push('invalid value for "physical_capacity_bytes", must be greater than or equal to 524288.') end if !@model.nil? && @model.to_s.length > 256 invalid_properties.push('invalid value for "model", the character length must be smaller than or equal to 256.') end if !@vendor.nil? && @vendor.to_s.length > 256 invalid_properties.push('invalid value for "vendor", the character length must be smaller than or equal to 256.') end if !@firmware_version.nil? && @firmware_version.to_s.length > 256 invalid_properties.push('invalid value for "firmware_version", the character length must be smaller than or equal to 256.') end if !@target_firmware_version.nil? && @target_firmware_version.to_s.length > 256 invalid_properties.push('invalid value for "target_firmware_version", the character length must be smaller than or equal to 256.') end if !@host_name.nil? && @host_name.to_s.length > 256 invalid_properties.push('invalid value for "host_name", the character length must be smaller than or equal to 256.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
732 733 734 735 736 737 738 739 740 741 742 743 744 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 732 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
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk.rb', line 396 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@tenant_id.nil? && @tenant_id !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) return false if !@ext_id.nil? && @ext_id !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) return false if !@links.nil? && @links.length > 20 return false if !@links.nil? && @links.length < 0 return false if !@cluster_name.nil? && @cluster_name.to_s.length > 256 return false if !@cluster_ext_id.nil? && @cluster_ext_id !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) return false if !@storage_pool_ext_id.nil? && @storage_pool_ext_id !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) return false if !@service_vmid.nil? && @service_vmid !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}::[0-9]{1,}$/) return false if !@node_ext_id.nil? && @node_ext_id !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) return false if !@mount_path.nil? && @mount_path !~ Regexp.new(/^\/home\/nutanix\/data\/stargate-storage\/disks\/[A-Z0-9]{8}$/) return false if !@serial_number.nil? && @serial_number.to_s.length > 256 return false if !@disk_size_bytes.nil? && @disk_size_bytes < 524288 return false if !@physical_capacity_bytes.nil? && @physical_capacity_bytes < 524288 return false if !@model.nil? && @model.to_s.length > 256 return false if !@vendor.nil? && @vendor.to_s.length > 256 return false if !@firmware_version.nil? && @firmware_version.to_s.length > 256 return false if !@target_firmware_version.nil? && @target_firmware_version.to_s.length > 256 return false if !@host_name.nil? && @host_name.to_s.length > 256 true end |