Interface VirtualMachines


public interface VirtualMachines
Resource collection API of VirtualMachines.
  • Method Details

    • list

      com.azure.core.http.rest.PagedIterable<LabVirtualMachine> list(String resourceGroupName, String labName)
      List virtual machines in a given lab.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      Returns:
      the response of a list operation as paginated response with PagedIterable.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • list

      com.azure.core.http.rest.PagedIterable<LabVirtualMachine> list(String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby, com.azure.core.util.Context context)
      List virtual machines in a given lab.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      expand - Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'.
      filter - The filter to apply to the operation. Example: '$filter=contains(name,'myName').
      top - The maximum number of resources to return from the operation. Example: '$top=10'.
      orderby - The ordering expression for the results, using OData notation. Example: '$orderby=name desc'.
      context - The context to associate with this operation.
      Returns:
      the response of a list operation as paginated response with PagedIterable.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getWithResponse

      com.azure.core.http.rest.Response<LabVirtualMachine> getWithResponse(String resourceGroupName, String labName, String name, String expand, com.azure.core.util.Context context)
      Get virtual machine.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      expand - Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'.
      context - The context to associate with this operation.
      Returns:
      virtual machine along with Response.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • get

      LabVirtualMachine get(String resourceGroupName, String labName, String name)
      Get virtual machine.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Returns:
      virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • delete

      void delete(String resourceGroupName, String labName, String name)
      Delete virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • delete

      void delete(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Delete virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • addDataDisk

      void addDataDisk(String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties)
      Attach a new or existing data disk to virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      dataDiskProperties - Request body for adding a new or existing data disk to a virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • addDataDisk

      void addDataDisk(String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties, com.azure.core.util.Context context)
      Attach a new or existing data disk to virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      dataDiskProperties - Request body for adding a new or existing data disk to a virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • applyArtifacts

      void applyArtifacts(String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest)
      Apply artifacts to virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      applyArtifactsRequest - Request body for applying artifacts to a virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • applyArtifacts

      void applyArtifacts(String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest, com.azure.core.util.Context context)
      Apply artifacts to virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      applyArtifactsRequest - Request body for applying artifacts to a virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • claim

      void claim(String resourceGroupName, String labName, String name)
      Take ownership of an existing virtual machine This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • claim

      void claim(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Take ownership of an existing virtual machine This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • detachDataDisk

      void detachDataDisk(String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties)
      Detach the specified disk from the virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      detachDataDiskProperties - Request body for detaching data disk from a virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • detachDataDisk

      void detachDataDisk(String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties, com.azure.core.util.Context context)
      Detach the specified disk from the virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      detachDataDiskProperties - Request body for detaching data disk from a virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getRdpFileContentsWithResponse

      com.azure.core.http.rest.Response<RdpConnection> getRdpFileContentsWithResponse(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Gets a string that represents the contents of the RDP file for the virtual machine.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Returns:
      a string that represents the contents of the RDP file for the virtual machine along with Response.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getRdpFileContents

      RdpConnection getRdpFileContents(String resourceGroupName, String labName, String name)
      Gets a string that represents the contents of the RDP file for the virtual machine.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Returns:
      a string that represents the contents of the RDP file for the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listApplicableSchedulesWithResponse

      com.azure.core.http.rest.Response<ApplicableSchedule> listApplicableSchedulesWithResponse(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Lists the applicable start/stop schedules, if any.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Returns:
      schedules applicable to a virtual machine along with Response.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listApplicableSchedules

      ApplicableSchedule listApplicableSchedules(String resourceGroupName, String labName, String name)
      Lists the applicable start/stop schedules, if any.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Returns:
      schedules applicable to a virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • redeploy

      void redeploy(String resourceGroupName, String labName, String name)
      Redeploy a virtual machine This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • redeploy

      void redeploy(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Redeploy a virtual machine This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • resize

      void resize(String resourceGroupName, String labName, String name, ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties)
      Resize Virtual Machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      resizeLabVirtualMachineProperties - Request body for resizing a virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • resize

      void resize(String resourceGroupName, String labName, String name, ResizeLabVirtualMachineProperties resizeLabVirtualMachineProperties, com.azure.core.util.Context context)
      Resize Virtual Machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      resizeLabVirtualMachineProperties - Request body for resizing a virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • restart

      void restart(String resourceGroupName, String labName, String name)
      Restart a virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • restart

      void restart(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Restart a virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • start

      void start(String resourceGroupName, String labName, String name)
      Start a virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • start

      void start(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Start a virtual machine. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • stop

      void stop(String resourceGroupName, String labName, String name)
      Stop a virtual machine This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • stop

      void stop(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Stop a virtual machine This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • transferDisks

      void transferDisks(String resourceGroupName, String labName, String name)
      Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • transferDisks

      void transferDisks(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • unClaim

      void unClaim(String resourceGroupName, String labName, String name)
      Release ownership of an existing virtual machine This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • unClaim

      void unClaim(String resourceGroupName, String labName, String name, com.azure.core.util.Context context)
      Release ownership of an existing virtual machine This operation can take a while to complete.
      Parameters:
      resourceGroupName - The name of the resource group.
      labName - The name of the lab.
      name - The name of the virtual machine.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getById

      Get virtual machine.
      Parameters:
      id - the resource ID.
      Returns:
      virtual machine along with Response.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getByIdWithResponse

      com.azure.core.http.rest.Response<LabVirtualMachine> getByIdWithResponse(String id, String expand, com.azure.core.util.Context context)
      Get virtual machine.
      Parameters:
      id - the resource ID.
      expand - Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'.
      context - The context to associate with this operation.
      Returns:
      virtual machine along with Response.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • deleteById

      void deleteById(String id)
      Delete virtual machine. This operation can take a while to complete.
      Parameters:
      id - the resource ID.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • deleteByIdWithResponse

      void deleteByIdWithResponse(String id, com.azure.core.util.Context context)
      Delete virtual machine. This operation can take a while to complete.
      Parameters:
      id - the resource ID.
      context - The context to associate with this operation.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • define

      Begins definition for a new LabVirtualMachine resource.
      Parameters:
      name - resource name.
      Returns:
      the first stage of the new LabVirtualMachine definition.