Interface VirtualMachines

All Superinterfaces:
com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager<ComputeManager>, com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion, com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating<VirtualMachine.DefinitionStages.Blank>, com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup<VirtualMachine>

public interface VirtualMachines extends com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating<VirtualMachine.DefinitionStages.Blank>, com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup, com.azure.resourcemanager.resources.fluentcore.collection.SupportsBatchCreation<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsBatchDeletion, com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager<ComputeManager>
Entry point to virtual machine management API.
  • Method Details

    • sizes

      Gets available virtual machine sizes.
      Returns:
      available virtual machine sizes
    • deallocate

      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

      Mono<Void> 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
    • deallocate

      void deallocate(String groupName, String name, boolean hibernate)
      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
      hibernate - hibernate the virtual machine
    • deallocateAsync

      Mono<Void> deallocateAsync(String groupName, String name, boolean hibernate)
      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
      hibernate - hibernate the virtual machine
      Returns:
      a representation of the deferred computation of this call
    • generalize

      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

      Mono<Void> 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
    • powerOff

      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

      Mono<Void> 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
    • restart

      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

      Mono<Void> 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
    • start

      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

      Mono<Void> 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
    • redeploy

      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

      Mono<Void> 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
    • 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 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

      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 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
    • migrateToManaged

      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

      Mono<Void> 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
    • 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 name
      name - the virtual machine name
      scriptLines - PowerShell script lines
      scriptParameters - 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 name
      name - the virtual machine name
      scriptLines - PowerShell script lines
      scriptParameters - 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 name
      name - the virtual machine name
      scriptLines - shell script lines
      scriptParameters - 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 name
      name - the virtual machine name
      scriptLines - shell script lines
      scriptParameters - script parameters
      Returns:
      handle to the asynchronous execution
    • runCommand

      RunCommandResult runCommand(String groupName, String name, RunCommandInput inputCommand)
      Run commands in a virtual machine.
      Parameters:
      groupName - the resource group name
      name - the virtual machine name
      inputCommand - command input
      Returns:
      result of execution
    • runCommandAsync

      Mono<RunCommandResult> runCommandAsync(String groupName, String name, RunCommandInput inputCommand)
      Run commands in a virtual machine asynchronously.
      Parameters:
      groupName - the resource group name
      name - the virtual machine name
      inputCommand - command input
      Returns:
      handle to the asynchronous execution
    • beginDeleteById

      com.azure.resourcemanager.resources.fluentcore.model.Accepted<Void> beginDeleteById(String id)
      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

      com.azure.resourcemanager.resources.fluentcore.model.Accepted<Void> beginDeleteByResourceGroup(String resourceGroupName, String name)
      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 of
      name - the virtual machine name
      Returns:
      the accepted deleting operation
    • deleteById

      void deleteById(String id, boolean forceDeletion)
      Force delete a resource from Azure, identifying it by its resource ID.
      Parameters:
      id - the resource ID of the resource to delete
      forceDeletion - force delete without graceful shutdown
    • deleteByIdAsync

      Mono<Void> deleteByIdAsync(String id, boolean forceDeletion)
      Asynchronously force delete a resource from Azure, identifying it by its resource ID.
      Parameters:
      id - the resource ID of the resource to delete
      forceDeletion - force delete without graceful shutdown
      Returns:
      a representation of the deferred computation of this call
    • deleteByResourceGroup

      void deleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion)
      Force delete a resource from Azure, identifying it by its name and its resource group.
      Parameters:
      resourceGroupName - the resource group the resource is part of
      name - the name of the resource
      forceDeletion - force delete without graceful shutdown
    • deleteByResourceGroupAsync

      Mono<Void> deleteByResourceGroupAsync(String resourceGroupName, String name, boolean forceDeletion)
      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 of
      name - the name of the resource
      forceDeletion - force delete without graceful shutdown
      Returns:
      a representation of the deferred computation of this call
    • beginDeleteById

      com.azure.resourcemanager.resources.fluentcore.model.Accepted<Void> beginDeleteById(String id, boolean forceDeletion)
      Begins force deleting a virtual machine from Azure, identifying it by its resource ID.
      Parameters:
      id - the resource ID of the virtual machine to delete
      forceDeletion - force delete without graceful shutdown
      Returns:
      the accepted deleting operation
    • beginDeleteById

      default com.azure.resourcemanager.resources.fluentcore.model.Accepted<Void> beginDeleteById(String id, boolean forceDeletion, com.azure.core.util.Context context)
      Begins force deleting a virtual machine from Azure, identifying it by its resource ID.
      Parameters:
      id - the resource ID of the virtual machine to delete
      forceDeletion - force delete without graceful shutdown
      context - the Context of the request
      Returns:
      the accepted deleting operation
    • beginDeleteByResourceGroup

      com.azure.resourcemanager.resources.fluentcore.model.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 of
      name - the virtual machine name
      forceDeletion - force delete without graceful shutdown
      Returns:
      the accepted deleting operation
    • beginDeleteByResourceGroup

      default com.azure.resourcemanager.resources.fluentcore.model.Accepted<Void> beginDeleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion, com.azure.core.util.Context context)
      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 of
      name - the virtual machine name
      forceDeletion - force delete without graceful shutdown
      context - the Context of the request
      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 mode OrchestrationMode.FLEXIBLE.

      Note: This method is for OrchestrationMode.FLEXIBLE virtual machine scale set. For OrchestrationMode.UNIFORM scale sets, use VirtualMachineScaleSet.virtualMachines().

      Parameters:
      vmssId - resource ID of the virtual machine scale set
      Returns:
      A PagedIterable of 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 mode OrchestrationMode.FLEXIBLE.

      Note: This method is for OrchestrationMode.FLEXIBLE virtual machine scale set. For OrchestrationMode.UNIFORM scale sets, use VirtualMachineScaleSet.virtualMachines().

      Parameters:
      vmssId - resource ID of the virtual machine scale set
      Returns:
      A PagedFlux of 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 mode OrchestrationMode.FLEXIBLE.

      Note: This method is for OrchestrationMode.FLEXIBLE virtual machine scale set. For OrchestrationMode.UNIFORM scale sets, use VirtualMachineScaleSet.virtualMachines().

      Parameters:
      vmss - virtual machine scale set
      Returns:
      A PagedIterable of 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 mode OrchestrationMode.FLEXIBLE.

      Note: This method is for OrchestrationMode.FLEXIBLE virtual machine scale set. For OrchestrationMode.UNIFORM scale sets, use VirtualMachineScaleSet.virtualMachines().

      Parameters:
      vmss - virtual machine scale set
      Returns:
      A PagedFlux of virtual machines
      See Also: