Class: IbmCloudPower::PVMInstance
- Inherits:
-
Object
- Object
- IbmCloudPower::PVMInstance
- Defined in:
- lib/ibm_cloud_power/models/pvm_instance.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#addresses ⇒ Object
(deprecated - replaced by networks) The list of addresses and their network information.
-
#creation_date ⇒ Object
Date/Time of PVM creation.
-
#disk_size ⇒ Object
Size of allocated disk (in GB).
-
#fault ⇒ Object
Returns the value of attribute fault.
-
#health ⇒ Object
Returns the value of attribute health.
-
#image_id ⇒ Object
The ImageID used by the server.
-
#maxmem ⇒ Object
Maximum amount of memory that can be allocated (in GB, for resize).
-
#maxproc ⇒ Object
Maximum number of processors that can be allocated (for resize).
-
#memory ⇒ Object
Amount of memory allocated (in GB).
-
#migratable ⇒ Object
whether the instance can be migrated.
-
#minmem ⇒ Object
Minimum amount of memory that can be allocated (in GB, for resize).
-
#minproc ⇒ Object
Minimum number of processors that can be allocated (for resize).
-
#network_ids ⇒ Object
(deprecated - replaced by networks) List of Network IDs.
-
#networks ⇒ Object
The pvm instance networks information.
-
#operating_system ⇒ Object
OS system information (usually version and build).
-
#os_type ⇒ Object
Type of the OS [aix, ibmi, rhel, sles].
-
#pin_policy ⇒ Object
VM pinning policy to use [none, soft, hard].
-
#placement_group ⇒ Object
The placement group of the server.
-
#proc_type ⇒ Object
Processor type (dedicated, shared, capped).
-
#processors ⇒ Object
Number of processors allocated.
-
#progress ⇒ Object
The progress of an operation.
-
#pvm_instance_id ⇒ Object
PCloud PVM Instance ID.
-
#sap_profile ⇒ Object
Returns the value of attribute sap_profile.
-
#server_name ⇒ Object
Name of the server.
-
#software_licenses ⇒ Object
Returns the value of attribute software_licenses.
-
#srcs ⇒ Object
The pvm instance SRC lists.
-
#status ⇒ Object
The status of the instance.
-
#storage_pool_affinity ⇒ Object
Indicates if all volumes attached to the server must reside in the same storage pool; Defaults to true when initially deploying a PVMInstance.
-
#storage_type ⇒ Object
Storage type for server deployment; will be ignored if storagePool or storageAffinity is provided; Only valid when you deploy one of the IBM supplied stock images.
-
#sys_type ⇒ Object
System type used to host the instance.
-
#updated_date ⇒ Object
Date/Time of PVM last update.
-
#virtual_cores ⇒ Object
Returns the value of attribute virtual_cores.
-
#volume_ids ⇒ Object
List of volume IDs; if provided then all the volumes must reside in the same storage pool and identify the deployment storage pool.
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
-
#==(o) ⇒ 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?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PVMInstance
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 = {}) ⇒ PVMInstance
Initializes the object
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 306 307 308 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 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 225 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::PVMInstance` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::PVMInstance`. 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 } if attributes.key?(:'pvm_instance_id') self.pvm_instance_id = attributes[:'pvm_instance_id'] end if attributes.key?(:'server_name') self.server_name = attributes[:'server_name'] end if attributes.key?(:'image_id') self.image_id = attributes[:'image_id'] end if attributes.key?(:'processors') self.processors = attributes[:'processors'] end if attributes.key?(:'minproc') self.minproc = attributes[:'minproc'] end if attributes.key?(:'maxproc') self.maxproc = attributes[:'maxproc'] end if attributes.key?(:'proc_type') self.proc_type = attributes[:'proc_type'] else self.proc_type = 'dedicated' end if attributes.key?(:'memory') self.memory = attributes[:'memory'] end if attributes.key?(:'minmem') self.minmem = attributes[:'minmem'] end if attributes.key?(:'maxmem') self.maxmem = attributes[:'maxmem'] end if attributes.key?(:'disk_size') self.disk_size = attributes[:'disk_size'] end if attributes.key?(:'network_ids') if (value = attributes[:'network_ids']).is_a?(Array) self.network_ids = value end end if attributes.key?(:'volume_ids') if (value = attributes[:'volume_ids']).is_a?(Array) self.volume_ids = value end end if attributes.key?(:'addresses') if (value = attributes[:'addresses']).is_a?(Array) self.addresses = value end end if attributes.key?(:'networks') if (value = attributes[:'networks']).is_a?(Array) self.networks = value end end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'progress') self.progress = attributes[:'progress'] end if attributes.key?(:'fault') self.fault = attributes[:'fault'] end if attributes.key?(:'creation_date') self.creation_date = attributes[:'creation_date'] end if attributes.key?(:'updated_date') self.updated_date = attributes[:'updated_date'] end if attributes.key?(:'sys_type') self.sys_type = attributes[:'sys_type'] end if attributes.key?(:'health') self.health = attributes[:'health'] end if attributes.key?(:'migratable') self.migratable = attributes[:'migratable'] else self.migratable = true end if attributes.key?(:'storage_type') self.storage_type = attributes[:'storage_type'] end if attributes.key?(:'storage_pool_affinity') self.storage_pool_affinity = attributes[:'storage_pool_affinity'] else self.storage_pool_affinity = true end if attributes.key?(:'software_licenses') self.software_licenses = attributes[:'software_licenses'] end if attributes.key?(:'srcs') if (value = attributes[:'srcs']).is_a?(Array) self.srcs = value end end if attributes.key?(:'pin_policy') self.pin_policy = attributes[:'pin_policy'] end if attributes.key?(:'os_type') self.os_type = attributes[:'os_type'] end if attributes.key?(:'operating_system') self. = attributes[:'operating_system'] end if attributes.key?(:'sap_profile') self.sap_profile = attributes[:'sap_profile'] end if attributes.key?(:'virtual_cores') self.virtual_cores = attributes[:'virtual_cores'] end if attributes.key?(:'placement_group') self.placement_group = attributes[:'placement_group'] else self.placement_group = 'none' end end |
Instance Attribute Details
#addresses ⇒ Object
(deprecated - replaced by networks) The list of addresses and their network information
58 59 60 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 58 def addresses @addresses end |
#creation_date ⇒ Object
Date/Time of PVM creation
72 73 74 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 72 def creation_date @creation_date end |
#disk_size ⇒ Object
Size of allocated disk (in GB)
49 50 51 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 49 def disk_size @disk_size end |
#fault ⇒ Object
Returns the value of attribute fault.
69 70 71 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 69 def fault @fault end |
#health ⇒ Object
Returns the value of attribute health.
80 81 82 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 80 def health @health end |
#image_id ⇒ Object
The ImageID used by the server
25 26 27 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 25 def image_id @image_id end |
#maxmem ⇒ Object
Maximum amount of memory that can be allocated (in GB, for resize)
46 47 48 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 46 def maxmem @maxmem end |
#maxproc ⇒ Object
Maximum number of processors that can be allocated (for resize)
34 35 36 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 34 def maxproc @maxproc end |
#memory ⇒ Object
Amount of memory allocated (in GB)
40 41 42 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 40 def memory @memory end |
#migratable ⇒ Object
whether the instance can be migrated
83 84 85 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 83 def migratable @migratable end |
#minmem ⇒ Object
Minimum amount of memory that can be allocated (in GB, for resize)
43 44 45 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 43 def minmem @minmem end |
#minproc ⇒ Object
Minimum number of processors that can be allocated (for resize)
31 32 33 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 31 def minproc @minproc end |
#network_ids ⇒ Object
(deprecated - replaced by networks) List of Network IDs
52 53 54 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 52 def network_ids @network_ids end |
#networks ⇒ Object
The pvm instance networks information
61 62 63 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 61 def networks @networks end |
#operating_system ⇒ Object
OS system information (usually version and build)
103 104 105 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 103 def @operating_system end |
#os_type ⇒ Object
Type of the OS [aix, ibmi, rhel, sles]
100 101 102 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 100 def os_type @os_type end |
#pin_policy ⇒ Object
VM pinning policy to use [none, soft, hard]
97 98 99 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 97 def pin_policy @pin_policy end |
#placement_group ⇒ Object
The placement group of the server
110 111 112 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 110 def placement_group @placement_group end |
#proc_type ⇒ Object
Processor type (dedicated, shared, capped)
37 38 39 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 37 def proc_type @proc_type end |
#processors ⇒ Object
Number of processors allocated
28 29 30 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 28 def processors @processors end |
#progress ⇒ Object
The progress of an operation
67 68 69 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 67 def progress @progress end |
#pvm_instance_id ⇒ Object
PCloud PVM Instance ID
19 20 21 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 19 def pvm_instance_id @pvm_instance_id end |
#sap_profile ⇒ Object
Returns the value of attribute sap_profile.
105 106 107 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 105 def sap_profile @sap_profile end |
#server_name ⇒ Object
Name of the server
22 23 24 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 22 def server_name @server_name end |
#software_licenses ⇒ Object
Returns the value of attribute software_licenses.
91 92 93 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 91 def software_licenses @software_licenses end |
#srcs ⇒ Object
The pvm instance SRC lists
94 95 96 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 94 def srcs @srcs end |
#status ⇒ Object
The status of the instance
64 65 66 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 64 def status @status end |
#storage_pool_affinity ⇒ Object
Indicates if all volumes attached to the server must reside in the same storage pool; Defaults to true when initially deploying a PVMInstance
89 90 91 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 89 def storage_pool_affinity @storage_pool_affinity end |
#storage_type ⇒ Object
Storage type for server deployment; will be ignored if storagePool or storageAffinity is provided; Only valid when you deploy one of the IBM supplied stock images. Storage type and pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage type and pool the image was created in
86 87 88 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 86 def storage_type @storage_type end |
#sys_type ⇒ Object
System type used to host the instance
78 79 80 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 78 def sys_type @sys_type end |
#updated_date ⇒ Object
Date/Time of PVM last update
75 76 77 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 75 def updated_date @updated_date end |
#virtual_cores ⇒ Object
Returns the value of attribute virtual_cores.
107 108 109 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 107 def virtual_cores @virtual_cores end |
#volume_ids ⇒ Object
List of volume IDs; if provided then all the volumes must reside in the same storage pool and identify the deployment storage pool. This overrides any other storage selection values (storagePool, storageAffinity).
55 56 57 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 55 def volume_ids @volume_ids end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
174 175 176 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 174 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 135 def self.attribute_map { :'pvm_instance_id' => :'pvmInstanceID', :'server_name' => :'serverName', :'image_id' => :'imageID', :'processors' => :'processors', :'minproc' => :'minproc', :'maxproc' => :'maxproc', :'proc_type' => :'procType', :'memory' => :'memory', :'minmem' => :'minmem', :'maxmem' => :'maxmem', :'disk_size' => :'diskSize', :'network_ids' => :'networkIDs', :'volume_ids' => :'volumeIDs', :'addresses' => :'addresses', :'networks' => :'networks', :'status' => :'status', :'progress' => :'progress', :'fault' => :'fault', :'creation_date' => :'creationDate', :'updated_date' => :'updatedDate', :'sys_type' => :'sysType', :'health' => :'health', :'migratable' => :'migratable', :'storage_type' => :'storageType', :'storage_pool_affinity' => :'storagePoolAffinity', :'software_licenses' => :'softwareLicenses', :'srcs' => :'srcs', :'pin_policy' => :'pinPolicy', :'os_type' => :'osType', :'operating_system' => :'operatingSystem', :'sap_profile' => :'sapProfile', :'virtual_cores' => :'virtualCores', :'placement_group' => :'placementGroup' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
529 530 531 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 529 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
218 219 220 221 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 218 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 179 def self.openapi_types { :'pvm_instance_id' => :'String', :'server_name' => :'String', :'image_id' => :'String', :'processors' => :'Float', :'minproc' => :'Float', :'maxproc' => :'Float', :'proc_type' => :'String', :'memory' => :'Float', :'minmem' => :'Float', :'maxmem' => :'Float', :'disk_size' => :'Float', :'network_ids' => :'Array<String>', :'volume_ids' => :'Array<String>', :'addresses' => :'Array<PVMInstanceNetwork>', :'networks' => :'Array<PVMInstanceNetwork>', :'status' => :'String', :'progress' => :'Float', :'fault' => :'PVMInstanceFault', :'creation_date' => :'Time', :'updated_date' => :'Time', :'sys_type' => :'String', :'health' => :'PVMInstanceHealth', :'migratable' => :'Boolean', :'storage_type' => :'String', :'storage_pool_affinity' => :'Boolean', :'software_licenses' => :'SoftwareLicenses', :'srcs' => :'Array<Array<SRC>>', :'pin_policy' => :'String', :'os_type' => :'String', :'operating_system' => :'String', :'sap_profile' => :'SAPProfileReference', :'virtual_cores' => :'VirtualCores', :'placement_group' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 476 def ==(o) return true if self.equal?(o) self.class == o.class && pvm_instance_id == o.pvm_instance_id && server_name == o.server_name && image_id == o.image_id && processors == o.processors && minproc == o.minproc && maxproc == o.maxproc && proc_type == o.proc_type && memory == o.memory && minmem == o.minmem && maxmem == o.maxmem && disk_size == o.disk_size && network_ids == o.network_ids && volume_ids == o.volume_ids && addresses == o.addresses && networks == o.networks && status == o.status && progress == o.progress && fault == o.fault && creation_date == o.creation_date && updated_date == o.updated_date && sys_type == o.sys_type && health == o.health && migratable == o.migratable && storage_type == o.storage_type && storage_pool_affinity == o.storage_pool_affinity && software_licenses == o.software_licenses && srcs == o.srcs && pin_policy == o.pin_policy && os_type == o.os_type && == o. && sap_profile == o.sap_profile && virtual_cores == o.virtual_cores && placement_group == o.placement_group end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 560 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 = IbmCloudPower.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
631 632 633 634 635 636 637 638 639 640 641 642 643 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 631 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
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 536 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) self.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) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
516 517 518 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 516 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
522 523 524 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 522 def hash [pvm_instance_id, server_name, image_id, processors, minproc, maxproc, proc_type, memory, minmem, maxmem, disk_size, network_ids, volume_ids, addresses, networks, status, progress, fault, creation_date, updated_date, sys_type, health, migratable, storage_type, storage_pool_affinity, software_licenses, srcs, pin_policy, os_type, , sap_profile, virtual_cores, placement_group].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 391 def list_invalid_properties invalid_properties = Array.new if @pvm_instance_id.nil? invalid_properties.push('invalid value for "pvm_instance_id", pvm_instance_id cannot be nil.') end if @server_name.nil? invalid_properties.push('invalid value for "server_name", server_name cannot be nil.') end if @image_id.nil? invalid_properties.push('invalid value for "image_id", image_id cannot be nil.') end if @processors.nil? invalid_properties.push('invalid value for "processors", processors cannot be nil.') end if @proc_type.nil? invalid_properties.push('invalid value for "proc_type", proc_type cannot be nil.') end if @memory.nil? invalid_properties.push('invalid value for "memory", memory cannot be nil.') end if @disk_size.nil? invalid_properties.push('invalid value for "disk_size", disk_size cannot be nil.') end if @network_ids.nil? invalid_properties.push('invalid value for "network_ids", network_ids cannot be nil.') end if @volume_ids.nil? invalid_properties.push('invalid value for "volume_ids", volume_ids cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @storage_type.nil? invalid_properties.push('invalid value for "storage_type", storage_type cannot be nil.') end if @os_type.nil? invalid_properties.push('invalid value for "os_type", os_type cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
607 608 609 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 607 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
613 614 615 616 617 618 619 620 621 622 623 624 625 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 613 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 |
#to_s ⇒ String
Returns the string representation of the object
601 602 603 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 601 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/ibm_cloud_power/models/pvm_instance.rb', line 446 def valid? return false if @pvm_instance_id.nil? return false if @server_name.nil? return false if @image_id.nil? return false if @processors.nil? return false if @proc_type.nil? proc_type_validator = EnumAttributeValidator.new('String', ["dedicated", "shared", "capped", ""]) return false unless proc_type_validator.valid?(@proc_type) return false if @memory.nil? return false if @disk_size.nil? return false if @network_ids.nil? return false if @volume_ids.nil? return false if @status.nil? return false if @storage_type.nil? return false if @os_type.nil? true end |