Class: IntersightClient::VirtualizationVirtualMachine

Inherits:
MoBaseMo
  • Object
show all
Defined in:
lib/intersight_client/models/virtualization_virtual_machine.rb

Overview

Depicts operations to control the life cycle of a virtual machine on a hypervisor.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Attributes inherited from MoBaseMo

#account_moid, #ancestors, #create_time, #display_names, #domain_group_moid, #mod_time, #moid, #owners, #parent, #permission_resources, #shared_scope, #tags, #version_context

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VirtualizationVirtualMachine

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
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
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 214

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::VirtualizationVirtualMachine` 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.acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  # call parent's initialize
  super(attributes)

  if attributes.key?(:'class_id')
    self.class_id = attributes[:'class_id']
  else
    self.class_id = 'virtualization.VirtualMachine'
  end

  if attributes.key?(:'object_type')
    self.object_type = attributes[:'object_type']
  else
    self.object_type = 'virtualization.VirtualMachine'
  end

  if attributes.key?(:'action')
    self.action = attributes[:'action']
  else
    self.action = 'None'
  end

  if attributes.key?(:'action_info')
    self.action_info = attributes[:'action_info']
  end

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

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

  if attributes.key?(:'cloud_init_config')
    self.cloud_init_config = attributes[:'cloud_init_config']
  end

  if attributes.key?(:'cluster_esxi')
    self.cluster_esxi = attributes[:'cluster_esxi']
  end

  if attributes.key?(:'cpu')
    self.cpu = attributes[:'cpu']
  end

  if attributes.key?(:'discovered')
    self.discovered = attributes[:'discovered']
  end

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

  if attributes.key?(:'force_delete')
    self.force_delete = attributes[:'force_delete']
  end

  if attributes.key?(:'guest_os')
    self.guest_os = attributes[:'guest_os']
  else
    self.guest_os = 'linux'
  end

  if attributes.key?(:'host_esxi')
    self.host_esxi = attributes[:'host_esxi']
  end

  if attributes.key?(:'hypervisor_type')
    self.hypervisor_type = attributes[:'hypervisor_type']
  else
    self.hypervisor_type = 'ESXi'
  end

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

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

  if attributes.key?(:'memory')
    self.memory = attributes[:'memory']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'power_state')
    self.power_state = attributes[:'power_state']
  else
    self.power_state = 'PowerOff'
  end

  if attributes.key?(:'provision_type')
    self.provision_type = attributes[:'provision_type']
  else
    self.provision_type = 'OVA'
  end

  if attributes.key?(:'vm_config')
    self.vm_config = attributes[:'vm_config']
  end

  if attributes.key?(:'cluster')
    self.cluster = attributes[:'cluster']
  end

  if attributes.key?(:'host')
    self.host = attributes[:'host']
  end

  if attributes.key?(:'inventory')
    self.inventory = attributes[:'inventory']
  end

  if attributes.key?(:'registered_device')
    self.registered_device = attributes[:'registered_device']
  end

  if attributes.key?(:'workflow_info')
    self.workflow_info = attributes[:'workflow_info']
  end
end

Instance Attribute Details

#actionObject

Action to be performed on a virtual machine (Create, PowerState, Migrate, Clone etc). * ‘None` - A place holder for the default value. * `PowerState` - Power action is performed on the virtual machine. * `Migrate` - The virtual machine will be migrated from existing node to a different node in cluster. The behavior depends on the underlying hypervisor. * `Create` - The virtual machine will be created on the specified hypervisor. This action is also useful if the virtual machine creation failed during first POST operation on VirtualMachine managed object. User can set this action to retry the virtual machine creation. * `Delete` - The virtual machine will be deleted from the specified hypervisor. User can either set this action or can do a DELETE operation on the VirtualMachine managed object.



26
27
28
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 26

def action
  @action
end

#action_infoObject

Returns the value of attribute action_info.



28
29
30
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 28

def action_info
  @action_info
end

#affinity_selectorsObject

Returns the value of attribute affinity_selectors.



30
31
32
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 30

def affinity_selectors
  @affinity_selectors
end

#anti_affinity_selectorsObject

Returns the value of attribute anti_affinity_selectors.



32
33
34
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 32

def anti_affinity_selectors
  @anti_affinity_selectors
end

#class_idObject

The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.



20
21
22
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 20

def class_id
  @class_id
end

#cloud_init_configObject

Returns the value of attribute cloud_init_config.



34
35
36
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 34

def cloud_init_config
  @cloud_init_config
end

#clusterObject

Returns the value of attribute cluster.



77
78
79
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 77

def cluster
  @cluster
end

#cluster_esxiObject

Cluster where virtual machine is deployed.



37
38
39
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 37

def cluster_esxi
  @cluster_esxi
end

#cpuObject

Number of vCPUs allocated to virtual machine.



40
41
42
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 40

def cpu
  @cpu
end

#discoveredObject

Flag to indicate whether the configuration is created from inventory object.



43
44
45
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 43

def discovered
  @discovered
end

#diskObject

Returns the value of attribute disk.



45
46
47
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 45

def disk
  @disk
end

#force_deleteObject

Normally any virtual machine that is still powered on cannot be deleted. The expected sequence from a user is to first power off the virtual machine and then invoke the delete operation. However, in special circumstances, the owner of the virtual machine may know very well that the virtual machine is no longer needed and just wants to dispose it off. In such situations a delete operation of a virtual machine object is accepted only when this forceDelete attribute is set to true. Under normal circumstances (forceDelete is false), delete operation first confirms that the virtual machine is powered off and then proceeds to delete the virtual machine.



48
49
50
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 48

def force_delete
  @force_delete
end

#guest_osObject

Guest operating system running on virtual machine. * ‘linux` - A Linux operating system. * `windows` - A Windows operating system.



51
52
53
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 51

def guest_os
  @guest_os
end

#hostObject

Returns the value of attribute host.



79
80
81
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 79

def host
  @host
end

#host_esxiObject

Host where virtual machine is deployed.



54
55
56
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 54

def host_esxi
  @host_esxi
end

#hypervisor_typeObject

Identifies the broad product type of the hypervisor but without any version information. It is here to easily identify the type of the virtual machine. There are other entities (Host, Cluster, etc.) that can be indirectly used to determine the hypervisor but a direct attribute makes it easier to work with. * ‘ESXi` - The hypervisor running on the HyperFlex cluster is a Vmware ESXi hypervisor of any version. * `HyperFlexAp` - The hypervisor of the virtualization platform is Cisco HyperFlex Application Platform. * `IWE` - The hypervisor of the virtualization platform is Cisco Intersight Workload Engine. * `Hyper-V` - The hypervisor running on the HyperFlex cluster is Microsoft Hyper-V. * `Unknown` - The hypervisor running on the HyperFlex cluster is not known.



57
58
59
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 57

def hypervisor_type
  @hypervisor_type
end

#interfacesObject

Returns the value of attribute interfaces.



59
60
61
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 59

def interfaces
  @interfaces
end

#inventoryObject

Returns the value of attribute inventory.



81
82
83
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 81

def inventory
  @inventory
end

#labelsObject

Returns the value of attribute labels.



61
62
63
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 61

def labels
  @labels
end

#memoryObject

Virtual machine memory in mebi bytes (one mebibyte, 1MiB, is 1048576 bytes, and 1KiB is 1024 bytes). Input must be a whole number and scientific notation is not acceptable. For example, enter 1730 and not 1.73e03.



64
65
66
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 64

def memory
  @memory
end

#nameObject

Virtual machine name that is unique. Hypervisors enforce platform specific limits and character sets. The name length limit, both min and max, vary among hypervisors. Therefore, the basic limits are set here and proper enforcement is done elsewhere.



67
68
69
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 67

def name
  @name
end

#object_typeObject

The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property.



23
24
25
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 23

def object_type
  @object_type
end

#power_stateObject

Expected power state of virtual machine (PowerOn, PowerOff, Restart). * ‘PowerOff` - The virtual machine will be powered off if it is already not in powered off state. If it is already powered off, no side-effects are expected. * `PowerOn` - The virtual machine will be powered on if it is already not in powered on state. If it is already powered on, no side-effects are expected. * `Suspend` - The virtual machine will be put into a suspended state. * `ShutDownGuestOS` - The guest operating system is shut down gracefully. * `RestartGuestOS` - It can either act as a reset switch and abruptly reset the guest operating system, or it can send a restart signal to the guest operating system so that it shuts down gracefully and restarts. * `Reset` - Resets the virtual machine abruptly, with no consideration for work in progress. * `Restart` - The virtual machine will be restarted only if it is in powered on state. If it is powered off, it will not be started up. * `Unknown` - Power state of the entity is unknown.



70
71
72
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 70

def power_state
  @power_state
end

#provision_typeObject

Identifies the provision type to create a new virtual machine. * ‘OVA` - Deploy virtual machine using OVA/F file. * `Template` - Provision virtual machine using a template file. * `Discovered` - A virtual machine was ’discovered’ and not created from Intersight. No provisioning information is available.



73
74
75
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 73

def provision_type
  @provision_type
end

#registered_deviceObject

Returns the value of attribute registered_device.



83
84
85
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 83

def registered_device
  @registered_device
end

#vm_configObject

Returns the value of attribute vm_config.



75
76
77
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 75

def vm_config
  @vm_config
end

#workflow_infoObject

Returns the value of attribute workflow_info.



85
86
87
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 85

def workflow_info
  @workflow_info
end

Class Method Details

.acceptable_attribute_mapObject

Returns the key-value map of all the JSON attributes this model knows about, including the ones defined in its parent(s)



148
149
150
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 148

def self.acceptable_attribute_map
  attribute_map.merge(superclass.acceptable_attribute_map)
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about, including the ones defined in its parent(s)



143
144
145
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 143

def self.acceptable_attributes
  attribute_map.values.concat(superclass.acceptable_attributes)
end

.attribute_mapObject

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



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
139
140
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 110

def self.attribute_map
  {
    :'class_id' => :'ClassId',
    :'object_type' => :'ObjectType',
    :'action' => :'Action',
    :'action_info' => :'ActionInfo',
    :'affinity_selectors' => :'AffinitySelectors',
    :'anti_affinity_selectors' => :'AntiAffinitySelectors',
    :'cloud_init_config' => :'CloudInitConfig',
    :'cluster_esxi' => :'ClusterEsxi',
    :'cpu' => :'Cpu',
    :'discovered' => :'Discovered',
    :'disk' => :'Disk',
    :'force_delete' => :'ForceDelete',
    :'guest_os' => :'GuestOs',
    :'host_esxi' => :'HostEsxi',
    :'hypervisor_type' => :'HypervisorType',
    :'interfaces' => :'Interfaces',
    :'labels' => :'Labels',
    :'memory' => :'Memory',
    :'name' => :'Name',
    :'power_state' => :'PowerState',
    :'provision_type' => :'ProvisionType',
    :'vm_config' => :'VmConfig',
    :'cluster' => :'Cluster',
    :'host' => :'Host',
    :'inventory' => :'Inventory',
    :'registered_device' => :'RegisteredDevice',
    :'workflow_info' => :'WorkflowInfo'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



591
592
593
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 591

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



200
201
202
203
204
205
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 200

def self.openapi_all_of
  [
  :'MoBaseMo',
  :'VirtualizationVirtualMachineAllOf'
  ]
end

.openapi_discriminator_nameObject

discriminator’s property name in OpenAPI v3



208
209
210
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 208

def self.openapi_discriminator_name
  :'ClassId'
end

.openapi_nullableObject

List of attributes with nullable: true



186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 186

def self.openapi_nullable
  Set.new([
    :'action_info',
    :'affinity_selectors',
    :'anti_affinity_selectors',
    :'cloud_init_config',
    :'disk',
    :'interfaces',
    :'labels',
    :'vm_config',
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 153

def self.openapi_types
  {
    :'class_id' => :'String',
    :'object_type' => :'String',
    :'action' => :'String',
    :'action_info' => :'VirtualizationActionInfo',
    :'affinity_selectors' => :'Array<InfraMetaData>',
    :'anti_affinity_selectors' => :'Array<InfraMetaData>',
    :'cloud_init_config' => :'VirtualizationCloudInitConfig',
    :'cluster_esxi' => :'String',
    :'cpu' => :'Integer',
    :'discovered' => :'Boolean',
    :'disk' => :'Array<VirtualizationVirtualMachineDisk>',
    :'force_delete' => :'Boolean',
    :'guest_os' => :'String',
    :'host_esxi' => :'String',
    :'hypervisor_type' => :'String',
    :'interfaces' => :'Array<VirtualizationNetworkInterface>',
    :'labels' => :'Array<InfraMetaData>',
    :'memory' => :'Integer',
    :'name' => :'String',
    :'power_state' => :'String',
    :'provision_type' => :'String',
    :'vm_config' => :'VirtualizationBaseVmConfiguration',
    :'cluster' => :'VirtualizationBaseClusterRelationship',
    :'host' => :'VirtualizationBaseHostRelationship',
    :'inventory' => :'VirtualizationBaseVirtualMachineRelationship',
    :'registered_device' => :'AssetDeviceRegistrationRelationship',
    :'workflow_info' => :'WorkflowWorkflowInfoRelationship'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 544

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      class_id == o.class_id &&
      object_type == o.object_type &&
      action == o.action &&
      action_info == o.action_info &&
      affinity_selectors == o.affinity_selectors &&
      anti_affinity_selectors == o.anti_affinity_selectors &&
      cloud_init_config == o.cloud_init_config &&
      cluster_esxi == o.cluster_esxi &&
      cpu == o.cpu &&
      discovered == o.discovered &&
      disk == o.disk &&
      force_delete == o.force_delete &&
      guest_os == o.guest_os &&
      host_esxi == o.host_esxi &&
      hypervisor_type == o.hypervisor_type &&
      interfaces == o.interfaces &&
      labels == o.labels &&
      memory == o.memory &&
      name == o.name &&
      power_state == o.power_state &&
      provision_type == o.provision_type &&
      vm_config == o.vm_config &&
      cluster == o.cluster &&
      host == o.host &&
      inventory == o.inventory &&
      registered_device == o.registered_device &&
      workflow_info == o.workflow_info && super(o)
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 622

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 = IntersightClient.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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



693
694
695
696
697
698
699
700
701
702
703
704
705
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 693

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 598

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  super(attributes)
  VirtualizationVirtualMachine.openapi_types.each_pair do |key, type|
    if attributes[VirtualizationVirtualMachine.attribute_map[key]].nil? && VirtualizationVirtualMachine.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[VirtualizationVirtualMachine.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[VirtualizationVirtualMachine.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[VirtualizationVirtualMachine.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[VirtualizationVirtualMachine.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


578
579
580
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 578

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



584
585
586
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 584

def hash
  [class_id, object_type, action, action_info, affinity_selectors, anti_affinity_selectors, cloud_init_config, cluster_esxi, cpu, discovered, disk, force_delete, guest_os, host_esxi, hypervisor_type, interfaces, labels, memory, name, power_state, provision_type, vm_config, cluster, host, inventory, registered_device, workflow_info].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
393
394
395
396
397
398
399
400
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 365

def list_invalid_properties
  invalid_properties = super
  if @class_id.nil?
    invalid_properties.push('invalid value for "class_id", class_id cannot be nil.')
  end

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

  if !@cpu.nil? && @cpu > 40
    invalid_properties.push('invalid value for "cpu", must be smaller than or equal to 40.')
  end

  if !@cpu.nil? && @cpu < 1
    invalid_properties.push('invalid value for "cpu", must be greater than or equal to 1.')
  end

  if !@memory.nil? && @memory > 4177920
    invalid_properties.push('invalid value for "memory", must be smaller than or equal to 4177920.')
  end

  if !@memory.nil? && @memory < 1
    invalid_properties.push('invalid value for "memory", must be greater than or equal to 1.')
  end

  if !@name.nil? && @name.to_s.length > 128
    invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 128.')
  end

  if !@name.nil? && @name.to_s.length < 1
    invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



669
670
671
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 669

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 675

def to_hash
  hash = super
  VirtualizationVirtualMachine.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = VirtualizationVirtualMachine.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



663
664
665
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 663

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



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
# File 'lib/intersight_client/models/virtualization_virtual_machine.rb', line 404

def valid?
  return false if @class_id.nil?
  class_id_validator = EnumAttributeValidator.new('String', ["virtualization.VirtualMachine"])
  return false unless class_id_validator.valid?(@class_id)
  return false if @object_type.nil?
  object_type_validator = EnumAttributeValidator.new('String', ["virtualization.VirtualMachine"])
  return false unless object_type_validator.valid?(@object_type)
  action_validator = EnumAttributeValidator.new('String', ["None", "PowerState", "Migrate", "Create", "Delete"])
  return false unless action_validator.valid?(@action)
  return false if !@cpu.nil? && @cpu > 40
  return false if !@cpu.nil? && @cpu < 1
  guest_os_validator = EnumAttributeValidator.new('String', ["linux", "windows"])
  return false unless guest_os_validator.valid?(@guest_os)
  hypervisor_type_validator = EnumAttributeValidator.new('String', ["ESXi", "HyperFlexAp", "IWE", "Hyper-V", "Unknown"])
  return false unless hypervisor_type_validator.valid?(@hypervisor_type)
  return false if !@memory.nil? && @memory > 4177920
  return false if !@memory.nil? && @memory < 1
  return false if !@name.nil? && @name.to_s.length > 128
  return false if !@name.nil? && @name.to_s.length < 1
  power_state_validator = EnumAttributeValidator.new('String', ["PowerOff", "PowerOn", "Suspend", "ShutDownGuestOS", "RestartGuestOS", "Reset", "Restart", "Unknown"])
  return false unless power_state_validator.valid?(@power_state)
  provision_type_validator = EnumAttributeValidator.new('String', ["OVA", "Template", "Discovered"])
  return false unless provision_type_validator.valid?(@provision_type)
  true && super
end