class Azure::Armrest::VirtualMachine

Public Instance Methods

flavor()
Alias for: size
managed_disk?() click to toggle source

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

# 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_system() click to toggle source

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

# 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
Also aliased as: os
os()
Alias for: operating_system
size() click to toggle source

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

# File lib/azure/armrest/model/virtual_machine.rb, line 14
def size
  check_for_model_view('size')
  properties.hardware_profile.vm_size
end
Also aliased as: flavor

Private Instance Methods

check_for_model_view(method_name) click to toggle source
# File lib/azure/armrest/model/virtual_machine.rb, line 32
def check_for_model_view(method_name)
  unless respond_to?(:properties)
    raise NoMethodError, "The method '#{method_name}' is only valid for model view objects."
  end
end