Interface VirtualMachines
- All Superinterfaces:
HasManager<ComputeManager>,SupportsBatchCreation<VirtualMachine>,SupportsBatchDeletion,SupportsCreating<VirtualMachine.DefinitionStages.Blank>,SupportsDeletingById,SupportsDeletingByResourceGroup,SupportsGettingById<VirtualMachine>,SupportsGettingByResourceGroup<VirtualMachine>,SupportsListing<VirtualMachine>,SupportsListingByResourceGroup<VirtualMachine>
public interface VirtualMachines
extends SupportsListing<VirtualMachine>, SupportsListingByResourceGroup<VirtualMachine>, SupportsGettingByResourceGroup<VirtualMachine>, SupportsGettingById<VirtualMachine>, SupportsCreating<VirtualMachine.DefinitionStages.Blank>, SupportsDeletingById, SupportsDeletingByResourceGroup, SupportsBatchCreation<VirtualMachine>, SupportsBatchDeletion, HasManager<ComputeManager>
Entry point to virtual machine management API.
-
Method Summary
Modifier and TypeMethodDescriptionBegins deleting a virtual machine from Azure, identifying it by its resource ID.beginDeleteById(String id, boolean forceDeletion) Begins force deleting a virtual machine from Azure, identifying it by its resource ID.beginDeleteByResourceGroup(String resourceGroupName, String name) Begins deleting a virtual machine from Azure, identifying it by its name and its resource group.beginDeleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion) Begins force deleting a virtual machine from Azure, identifying it by its name and its resource group.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.captureAsync(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd) Captures the virtual machine by copying virtual hard disks of the VM asynchronously.voiddeallocate(String groupName, String name) Shuts down the virtual machine and releases the compute resources.voiddeallocate(String groupName, String name, boolean hibernate) Shuts down the virtual machine and releases the compute resources.deallocateAsync(String groupName, String name) Shuts down the virtual machine and releases the compute resources asynchronously.deallocateAsync(String groupName, String name, boolean hibernate) Shuts down the virtual machine and releases the compute resources asynchronously.voiddeleteById(String id, boolean forceDeletion) Force delete a resource from Azure, identifying it by its resource ID.deleteByIdAsync(String id, boolean forceDeletion) Asynchronously force delete a resource from Azure, identifying it by its resource ID.voiddeleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion) Force delete a resource from Azure, identifying it by its name and its resource group.deleteByResourceGroupAsync(String resourceGroupName, String name, boolean forceDeletion) Asynchronously force delete a resource from Azure, identifying it by its name and its resource group.voidgeneralize(String groupName, String name) Generalizes the virtual machine.generalizeAsync(String groupName, String name) Generalizes the virtual machine asynchronously.com.azure.core.http.rest.PagedIterable<VirtualMachine>Lists all the virtual machines by a certain virtual machine scale set with orchestration modeOrchestrationMode.FLEXIBLE.com.azure.core.http.rest.PagedFlux<VirtualMachine>Lists all the virtual machines by a certain virtual machine scale set with orchestration modeOrchestrationMode.FLEXIBLE.com.azure.core.http.rest.PagedIterable<VirtualMachine>listByVirtualMachineScaleSetId(String vmssId) Lists all the virtual machines by a certain virtual machine scale set with orchestration modeOrchestrationMode.FLEXIBLE.com.azure.core.http.rest.PagedFlux<VirtualMachine>Lists all the virtual machines by a certain virtual machine scale set with orchestration modeOrchestrationMode.FLEXIBLE.voidmigrateToManaged(String groupName, String name) Migrates the virtual machine with unmanaged disks to use managed disks.migrateToManagedAsync(String groupName, String name) Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.voidPowers off (stops) a virtual machine.powerOffAsync(String groupName, String name) Powers off (stops) the virtual machine asynchronously.voidRedeploys a virtual machine.redeployAsync(String groupName, String name) Redeploys the virtual machine asynchronously.voidRestarts a virtual machine.restartAsync(String groupName, String name) Restarts the virtual machine asynchronously.runCommand(String groupName, String name, RunCommandInput inputCommand) Run commands in a virtual machine.runCommandAsync(String groupName, String name, RunCommandInput inputCommand) Run commands in a virtual machine asynchronously.runPowerShellScript(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine.runPowerShellScriptAsync(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine asynchronously.runShellScript(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine.runShellScriptAsync(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine asynchronously.sizes()voidStarts a virtual machine.startAsync(String groupName, String name) Starts the virtual machine asynchronously.Methods inherited from interface com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager
managerMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation
create, create, createAsync, createAsyncMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion
deleteByIds, deleteByIds, deleteByIdsAsync, deleteByIdsAsyncMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating
defineMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById
deleteById, deleteByIdAsyncMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup
deleteByResourceGroup, deleteByResourceGroupAsyncMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById
getById, getByIdAsyncMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup
getByResourceGroup, getByResourceGroupAsyncMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing
list, listAsyncMethods inherited from interface com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup
listByResourceGroup, listByResourceGroupAsync
-
Method Details
-
sizes
VirtualMachineSizes sizes()- Returns:
- available virtual machine sizes
-
deallocate
Shuts down the virtual machine and releases the compute resources.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name
-
deallocateAsync
Shuts down the virtual machine and releases the compute resources asynchronously.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name- Returns:
- a representation of the deferred computation of this call
-
deallocate
Shuts down the virtual machine and releases the compute resources.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine namehibernate- hibernate the virtual machine
-
deallocateAsync
Shuts down the virtual machine and releases the compute resources asynchronously.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine namehibernate- hibernate the virtual machine- Returns:
- a representation of the deferred computation of this call
-
generalize
Generalizes the virtual machine.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name
-
generalizeAsync
Generalizes the virtual machine asynchronously.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name- Returns:
- a representation of the deferred computation of this call
-
powerOff
Powers off (stops) a virtual machine.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name
-
powerOffAsync
Powers off (stops) the virtual machine asynchronously.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name- Returns:
- a representation of the deferred computation of this call
-
restart
Restarts a virtual machine.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name
-
restartAsync
Restarts the virtual machine asynchronously.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name- Returns:
- a representation of the deferred computation of this call
-
start
Starts a virtual machine.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name
-
startAsync
Starts the virtual machine asynchronously.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name- Returns:
- a representation of the deferred computation of this call
-
redeploy
Redeploys a virtual machine.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name
-
redeployAsync
Redeploys the virtual machine asynchronously.- Parameters:
groupName- the name of the resource group the virtual machine is inname- the virtual machine name- Returns:
- a representation of the deferred computation of this call
-
capture
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 namename- the virtual machine namecontainerName- destination container name to store the captured VHDvhdPrefix- the prefix for the VHD holding captured imageoverwriteVhd- whether to overwrites destination VHD if it exists- Returns:
- the template as JSON string
-
captureAsync
Mono<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.- Parameters:
groupName- the resource group namename- the virtual machine namecontainerName- destination container name to store the captured VHDvhdPrefix- the prefix for the VHD holding captured imageoverwriteVhd- whether to overwrites destination VHD if it exists- Returns:
- a representation of the deferred computation of this call
-
migrateToManaged
Migrates the virtual machine with unmanaged disks to use managed disks.- Parameters:
groupName- the resource group namename- the virtual machine name
-
migrateToManagedAsync
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.- Parameters:
groupName- the resource group namename- the virtual machine name- Returns:
- a representation of the deferred computation of this call
-
runPowerShellScript
RunCommandResult runPowerShellScript(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine.- Parameters:
groupName- the resource group namename- the virtual machine namescriptLines- PowerShell script linesscriptParameters- script parameters- Returns:
- result of PowerShell script execution
-
runPowerShellScriptAsync
Mono<RunCommandResult> runPowerShellScriptAsync(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine asynchronously.- Parameters:
groupName- the resource group namename- the virtual machine namescriptLines- PowerShell script linesscriptParameters- script parameters- Returns:
- handle to the asynchronous execution
-
runShellScript
RunCommandResult runShellScript(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine.- Parameters:
groupName- the resource group namename- the virtual machine namescriptLines- shell script linesscriptParameters- script parameters- Returns:
- result of shell script execution
-
runShellScriptAsync
Mono<RunCommandResult> runShellScriptAsync(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine asynchronously.- Parameters:
groupName- the resource group namename- the virtual machine namescriptLines- shell script linesscriptParameters- script parameters- Returns:
- handle to the asynchronous execution
-
runCommand
Run commands in a virtual machine.- Parameters:
groupName- the resource group namename- the virtual machine nameinputCommand- command input- Returns:
- result of execution
-
runCommandAsync
Run commands in a virtual machine asynchronously.- Parameters:
groupName- the resource group namename- the virtual machine nameinputCommand- command input- Returns:
- handle to the asynchronous execution
-
beginDeleteById
Begins deleting a virtual machine from Azure, identifying it by its resource ID.- Parameters:
id- the resource ID of the virtual machine to delete- Returns:
- the accepted deleting operation
-
beginDeleteByResourceGroup
Begins deleting a virtual machine from Azure, identifying it by its name and its resource group.- Parameters:
resourceGroupName- the resource group the resource is part ofname- the virtual machine name- Returns:
- the accepted deleting operation
-
deleteById
Force delete a resource from Azure, identifying it by its resource ID.- Parameters:
id- the resource ID of the resource to deleteforceDeletion- force delete without graceful shutdown
-
deleteByIdAsync
Asynchronously force delete a resource from Azure, identifying it by its resource ID.- Parameters:
id- the resource ID of the resource to deleteforceDeletion- force delete without graceful shutdown- Returns:
- a representation of the deferred computation of this call
-
deleteByResourceGroup
Force delete a resource from Azure, identifying it by its name and its resource group.- Parameters:
resourceGroupName- the resource group the resource is part ofname- the name of the resourceforceDeletion- force delete without graceful shutdown
-
deleteByResourceGroupAsync
Asynchronously force delete a resource from Azure, identifying it by its name and its resource group.- Parameters:
resourceGroupName- the resource group the resource is part ofname- the name of the resourceforceDeletion- force delete without graceful shutdown- Returns:
- a representation of the deferred computation of this call
-
beginDeleteById
Begins force deleting a virtual machine from Azure, identifying it by its resource ID.- Parameters:
id- the resource ID of the virtual machine to deleteforceDeletion- force delete without graceful shutdown- Returns:
- the accepted deleting operation
-
beginDeleteByResourceGroup
Accepted<Void> beginDeleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion) Begins force deleting a virtual machine from Azure, identifying it by its name and its resource group.- Parameters:
resourceGroupName- the resource group the resource is part ofname- the virtual machine nameforceDeletion- force delete without graceful shutdown- Returns:
- the accepted deleting operation
-
listByVirtualMachineScaleSetId
com.azure.core.http.rest.PagedIterable<VirtualMachine> listByVirtualMachineScaleSetId(String vmssId) Lists all the virtual machines by a certain virtual machine scale set with orchestration modeOrchestrationMode.FLEXIBLE.Note: This method is for
OrchestrationMode.FLEXIBLEvirtual machine scale set. ForOrchestrationMode.UNIFORMscale sets, useVirtualMachineScaleSet.virtualMachines().- Parameters:
vmssId- resource ID of the virtual machine scale set- Returns:
- A
PagedIterableof virtual machines - See Also:
-
listByVirtualMachineScaleSetIdAsync
com.azure.core.http.rest.PagedFlux<VirtualMachine> listByVirtualMachineScaleSetIdAsync(String vmssId) Lists all the virtual machines by a certain virtual machine scale set with orchestration modeOrchestrationMode.FLEXIBLE.Note: This method is for
OrchestrationMode.FLEXIBLEvirtual machine scale set. ForOrchestrationMode.UNIFORMscale sets, useVirtualMachineScaleSet.virtualMachines().- Parameters:
vmssId- resource ID of the virtual machine scale set- Returns:
- A
PagedFluxof virtual machines - See Also:
-
listByVirtualMachineScaleSet
com.azure.core.http.rest.PagedIterable<VirtualMachine> listByVirtualMachineScaleSet(VirtualMachineScaleSet vmss) Lists all the virtual machines by a certain virtual machine scale set with orchestration modeOrchestrationMode.FLEXIBLE.Note: This method is for
OrchestrationMode.FLEXIBLEvirtual machine scale set. ForOrchestrationMode.UNIFORMscale sets, useVirtualMachineScaleSet.virtualMachines().- Parameters:
vmss- virtual machine scale set- Returns:
- A
PagedIterableof virtual machines - See Also:
-
listByVirtualMachineScaleSetAsync
com.azure.core.http.rest.PagedFlux<VirtualMachine> listByVirtualMachineScaleSetAsync(VirtualMachineScaleSet vmss) Lists all the virtual machines by a certain virtual machine scale set with orchestration modeOrchestrationMode.FLEXIBLE.Note: This method is for
OrchestrationMode.FLEXIBLEvirtual machine scale set. ForOrchestrationMode.UNIFORMscale sets, useVirtualMachineScaleSet.virtualMachines().- Parameters:
vmss- virtual machine scale set- Returns:
- A
PagedFluxof virtual machines - See Also:
-