Class: Azure::Armrest::VirtualMachine

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/azure/armrest/model/base_model.rb,
lib/azure/armrest/model/virtual_machine.rb

Direct Known Subclasses

VirtualMachineInstance, VirtualMachineModel

Instance Attribute Summary

Attributes inherited from BaseModel

#resource_group, #response_code, #response_headers, #subscription_id

Instance Method Summary collapse

Methods inherited from BaseModel

#==, #[], #[]=, #eql?, #initialize, #pretty_print, #to_h, #to_hash, #to_json, #to_s, #to_str

Constructor Details

This class inherits a constructor from Azure::Armrest::BaseModel

Instance Method Details

#managed_disk?Boolean

Indicates whether the VM is backed by a managed disk or a regular storage account.

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/azure/armrest/model/virtual_machine.rb', line 7

def managed_disk?
  check_for_model_view('managed_disk?')
  properties.storage_profile.os_disk.try(:managed_disk) ? true : false
end

#operating_systemObject Also known as: os

The operating system for the image, e.g. “Linux” or “Windows”.



23
24
25
26
# File 'lib/azure/armrest/model/virtual_machine.rb', line 23

def operating_system
  check_for_model_view('operating_sytem')
  properties.storage_profile.os_disk.os_type
end

#sizeObject Also known as: flavor

Returns the size (aka series) for the VM, e.g. “Standard_A0”.



14
15
16
17
# File 'lib/azure/armrest/model/virtual_machine.rb', line 14

def size
  check_for_model_view('size')
  properties.hardware_profile.vm_size
end