-
Notifications
You must be signed in to change notification settings - Fork 36
VirtualMachineService
Daniel Berger edited this page Dec 17, 2015
·
21 revisions
The VirtualMachineService class is likely to be used extensively, and it contains additional methods not inherited from ResourceBaseServiceClass, so we cover it in some detail here.
# Get your VirtualMachineService instance
vms = Azure::Armrest::VirtualMachineService.new(conf)
The VirtualMachineService class supports the common methods available to all ResourceBaseGroupService subclasses.
rg = 'some_resource_group'
vm = vms.get('some_vm', rg)
vms.list(rg).each{ |vm| p vm.name }
vms.list_all.each{ |vm| p vm.name }
vms.delete('some_vm', rg)
# Returns a list of VirtualMachineSize objects that contain information
# about available VM sizes that can be provisioned.
series = vms.series.first
p series.name
p series.number_of_cores
p series.os_disk_size_in_mb