VirtualMachines Interface

public interface VirtualMachines extends SupportsListing,SupportsListingByResourceGroup,SupportsGettingByResourceGroup,SupportsGettingById,SupportsCreating<VirtualMachine.DefinitionStages.Blank>,SupportsDeletingById,SupportsDeletingByResourceGroup,SupportsBatchCreation,SupportsBatchDeletion,HasManager,HasInner

Entry point to virtual machine management API.

Method Summary

Modifier and Type Method and Description
String capture(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd)

Captures the virtual machine by copying virtual hard disks of the VM and returns template as a JSON string that can be used to create similar VMs.

Observable<String> captureAsync(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd)

Captures the virtual machine by copying virtual hard disks of the VM asynchronously.

ServiceFuture<String> captureAsync(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd, ServiceCallback<String> callback)

Captures the virtual machine by copying virtual hard disks of the VM asynchronously.

void deallocate(String groupName, String name)

Shuts down the virtual machine and releases the compute resources.

Completable deallocateAsync(String groupName, String name)

Shuts down the virtual machine and releases the compute resources asynchronously.

ServiceFuture<Void> deallocateAsync(String groupName, String name, ServiceCallback<Void> callback)

Shuts down the virtual machine and releases the compute resources asynchronously.

void generalize(String groupName, String name)

Generalizes the virtual machine.

Completable generalizeAsync(String groupName, String name)

Generalizes the virtual machine asynchronously.

ServiceFuture<Void> generalizeAsync(String groupName, String name, ServiceCallback<Void> callback)

Generalizes the virtual machine asynchronously.

void migrateToManaged(String groupName, String name)

Migrates the virtual machine with unmanaged disks to use managed disks.

Completable migrateToManagedAsync(String groupName, String name)

Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.

ServiceFuture<Void> migrateToManagedAsync(String groupName, String name, ServiceCallback<Void> callback)

Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.

void powerOff(String groupName, String name)

Powers off (stops) a virtual machine.

Completable powerOffAsync(String groupName, String name)

Powers off (stops) the virtual machine asynchronously.

ServiceFuture<Void> powerOffAsync(String groupName, String name, ServiceCallback<Void> callback)

Powers off (stop) the virtual machine asynchronously.

void redeploy(String groupName, String name)

Redeploys a virtual machine.

Completable redeployAsync(String groupName, String name)

Redeploys the virtual machine asynchronously.

ServiceFuture<Void> redeployAsync(String groupName, String name, ServiceCallback<Void> callback)

Redeploys the virtual machine asynchronously.

void restart(String groupName, String name)

Restarts a virtual machine.

Completable restartAsync(String groupName, String name)

Restarts the virtual machine asynchronously.

ServiceFuture<Void> restartAsync(String groupName, String name, ServiceCallback<Void> callback)

Restarts the virtual machine asynchronously.

VirtualMachineSizes sizes()
void start(String groupName, String name)

Starts a virtual machine.

Completable startAsync(String groupName, String name)

Starts the virtual machine asynchronously.

ServiceFuture<Void> startAsync(String groupName, String name, ServiceCallback<Void> callback)

Starts the virtual machine asynchronously.

Inherited Members

SupportsBatchCreation<ResourceT>.create(Creatable<ResourceT>... creatables) SupportsBatchCreation<ResourceT>.create(List<Creatable<ResourceT>> creatables) SupportsBatchCreation<ResourceT>.createAsync(Creatable<ResourceT>... creatables) SupportsBatchCreation<ResourceT>.createAsync(List<Creatable<ResourceT>> creatables) SupportsBatchCreation<ResourceT>.createAsync(ServiceCallback<CreatedResources<ResourceT>> callback, Creatable<ResourceT>... creatables) SupportsBatchCreation<ResourceT>.createAsync(final ServiceCallback<CreatedResources<ResourceT>> callback, List<Creatable<ResourceT>> creatables) SupportsCreating<T>.define(String name) SupportsDeletingById.deleteById(String id) SupportsDeletingById.deleteByIdAsync(String id, ServiceCallback<Void> callback) SupportsDeletingById.deleteByIdAsync(String id) SupportsBatchDeletion.deleteByIds(Collection<String> ids) SupportsBatchDeletion.deleteByIds(String...ids) SupportsBatchDeletion.deleteByIdsAsync(Collection<String> ids) SupportsBatchDeletion.deleteByIdsAsync(String...ids) SupportsDeletingByResourceGroup.deleteByResourceGroup(String resourceGroupName, String name) SupportsDeletingByResourceGroup.deleteByResourceGroupAsync(String resourceGroupName, String name, ServiceCallback<Void> callback) SupportsDeletingByResourceGroup.deleteByResourceGroupAsync(String resourceGroupName, String name) SupportsGettingById<T>.getById(String id) SupportsGettingById<T>.getByIdAsync(String id) SupportsGettingById<T>.getByIdAsync(String id, ServiceCallback<T> callback) SupportsGettingByResourceGroup<T>.getByResourceGroup(String resourceGroupName, String name) SupportsGettingByResourceGroup<T>.getByResourceGroupAsync(String resourceGroupName, String name) SupportsGettingByResourceGroup<T>.getByResourceGroupAsync(String resourceGroupName, String name, ServiceCallback<T> callback) HasInner<T>.inner() SupportsListing<T>.list() SupportsListing<T>.listAsync() SupportsListingByResourceGroup<T>.listByResourceGroup(String resourceGroupName) SupportsListingByResourceGroup<T>.listByResourceGroupAsync(String resourceGroupName) HasManager<ManagerT>.manager()

Method Details

capture

public String capture(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd)

Captures the virtual machine by copying virtual hard disks of the VM and returns template as a JSON string that can be used to create similar VMs.

Parameters:

groupName - the resource group name
name - the virtual machine name
containerName - destination container name to store the captured VHD
vhdPrefix - the prefix for the VHD holding captured image
overwriteVhd - whether to overwrites destination VHD if it exists

Returns:

the template as JSON string

captureAsync

public Observable captureAsync(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd)

Captures the virtual machine by copying virtual hard disks of the VM asynchronously.

Parameters:

groupName - the resource group name
name - the virtual machine name
containerName - destination container name to store the captured VHD
vhdPrefix - the prefix for the VHD holding captured image
overwriteVhd - whether to overwrites destination VHD if it exists

Returns:

a representation of the deferred computation of this call

captureAsync

public ServiceFuture captureAsync(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd, ServiceCallback callback)

Captures the virtual machine by copying virtual hard disks of the VM asynchronously.

Parameters:

groupName - the resource group name
name - the virtual machine name
containerName - destination container name to store the captured VHD
vhdPrefix - the prefix for the VHD holding captured image
overwriteVhd - whether to overwrites destination VHD if it exists
callback - the callback to call on success or failure

Returns:

a representation of the deferred computation of this call

deallocate

public void deallocate(String groupName, String name)

Shuts down the virtual machine and releases the compute resources.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

deallocateAsync

public Completable deallocateAsync(String groupName, String name)

Shuts down the virtual machine and releases the compute resources asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

Returns:

a representation of the deferred computation of this call

deallocateAsync

public ServiceFuture deallocateAsync(String groupName, String name, ServiceCallback callback)

Shuts down the virtual machine and releases the compute resources asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name
callback - the callback to call on success or failure

Returns:

a handle to cancel the request

generalize

public void generalize(String groupName, String name)

Generalizes the virtual machine.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

generalizeAsync

public Completable generalizeAsync(String groupName, String name)

Generalizes the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

Returns:

a representation of the deferred computation of this call

generalizeAsync

public ServiceFuture generalizeAsync(String groupName, String name, ServiceCallback callback)

Generalizes the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name
callback - the callback to call on success or failure

Returns:

a handle to cancel the request

migrateToManaged

public void migrateToManaged(String groupName, String name)

Migrates the virtual machine with unmanaged disks to use managed disks.

Parameters:

groupName - the resource group name
name - the virtual machine name

migrateToManagedAsync

public Completable migrateToManagedAsync(String groupName, String name)

Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.

Parameters:

groupName - the resource group name
name - the virtual machine name

Returns:

a representation of the deferred computation of this call

migrateToManagedAsync

public ServiceFuture migrateToManagedAsync(String groupName, String name, ServiceCallback callback)

Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.

Parameters:

groupName - the resource group name
name - the virtual machine name
callback - the callback to call on success or failure

Returns:

a handle to cancel the request

powerOff

public void powerOff(String groupName, String name)

Powers off (stops) a virtual machine.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

powerOffAsync

public Completable powerOffAsync(String groupName, String name)

Powers off (stops) the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

Returns:

a representation of the deferred computation of this call

powerOffAsync

public ServiceFuture powerOffAsync(String groupName, String name, ServiceCallback callback)

Powers off (stop) the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name
callback - the callback to call on success or failure

Returns:

a handle to cancel the request

redeploy

public void redeploy(String groupName, String name)

Redeploys a virtual machine.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

redeployAsync

public Completable redeployAsync(String groupName, String name)

Redeploys the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

Returns:

a representation of the deferred computation of this call

redeployAsync

public ServiceFuture redeployAsync(String groupName, String name, ServiceCallback callback)

Redeploys the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name
callback - the callback to call on success or failure

Returns:

a handle to cancel the request

restart

public void restart(String groupName, String name)

Restarts a virtual machine.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

restartAsync

public Completable restartAsync(String groupName, String name)

Restarts the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

Returns:

a representation of the deferred computation of this call

restartAsync

public ServiceFuture restartAsync(String groupName, String name, ServiceCallback callback)

Restarts the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name
callback - the callback to call on success or failure

Returns:

a handle to cancel the request

sizes

public VirtualMachineSizes sizes()

Returns:

available virtual machine sizes

start

public void start(String groupName, String name)

Starts a virtual machine.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

startAsync

public Completable startAsync(String groupName, String name)

Starts the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name

Returns:

a representation of the deferred computation of this call

startAsync

public ServiceFuture startAsync(String groupName, String name, ServiceCallback callback)

Starts the virtual machine asynchronously.

Parameters:

groupName - the name of the resource group the virtual machine is in
name - the virtual machine name
callback - the callback to call on success or failure

Returns:

a handle to cancel the request

Applies to