Interface VirtualMachineApi


public interface VirtualMachineApi
Provides synchronous access to cloudstack via their REST API.

See Also:
  • Method Details

    • listVirtualMachines

      @Named("listVirtualMachines") @GET @Consumes("application/json") Set<VirtualMachine> listVirtualMachines(ListVirtualMachinesOptions... options)
      Lists VirtualMachines
      Parameters:
      options - if present, how to constrain the list.
      Returns:
      VirtualMachines matching query, or empty set, if no VirtualMachines are found
    • getVirtualMachine

      @Named("listVirtualMachines") @GET @Consumes("application/json") VirtualMachine getVirtualMachine(@QueryParam("id") String id)
      get a specific VirtualMachine by id
      Parameters:
      id - VirtualMachine to get
      Returns:
      VirtualMachine or null if not found
    • deployVirtualMachineInZone

      @Named("deployVirtualMachine") @GET @Consumes("application/json") AsyncCreateResponse deployVirtualMachineInZone(@QueryParam("zoneid") String zoneId, @QueryParam("serviceofferingid") String serviceOfferingId, @QueryParam("templateid") String templateId, DeployVirtualMachineOptions... options)
      Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.
      Parameters:
      zoneId - availability zone for the virtual machine
      serviceOfferingId - the ID of the service offering for the virtual machine
      templateId - the ID of the template for the virtual machine
      Returns:
      virtual machine
    • rebootVirtualMachine

      @Named("rebootVirtualMachine") @GET @Consumes("application/json") String rebootVirtualMachine(@QueryParam("id") String id)
      Reboots a virtual machine.
      Parameters:
      id - The ID of the virtual machine
      Returns:
      job id related to destroying the VM
    • startVirtualMachine

      @Named("startVirtualMachine") @GET @Consumes("application/json") String startVirtualMachine(@QueryParam("id") String id)
      Starts a virtual machine.
      Parameters:
      id - The ID of the virtual machine
      Returns:
      job id related to destroying the VM
    • stopVirtualMachine

      @Named("stopVirtualMachine") @GET @Consumes("application/json") String stopVirtualMachine(@QueryParam("id") String id)
      Stops a virtual machine.
      Parameters:
      id - The ID of the virtual machine
      Returns:
      job id related to destroying the VM
    • stopVirtualMachine

      @GET @Consumes("application/json") String stopVirtualMachine(@QueryParam("id") String id, StopVirtualMachineOptions options)
      Stops a virtual machine.
      Parameters:
      id - The ID of the virtual machine
      options - If present, whether to force stop.
      Returns:
      job id related to destroying the VM
    • resetPasswordForVirtualMachine

      @Named("resetPasswordForVirtualMachine") @GET @Consumes("application/json") String resetPasswordForVirtualMachine(@QueryParam("id") String id)
      Resets the password for virtual machine. The virtual machine must be in a "Stopped" state and the template must already support this feature for this command to take effect.
      Parameters:
      id - The ID of the virtual machine
      Returns:
      job id related to destroying the VM
    • getEncryptedPasswordForVirtualMachine

      @Named("getVMPassword") @GET @Consumes("application/json") String getEncryptedPasswordForVirtualMachine(@QueryParam("id") String id)
      Return an encrypted password for the virtual machine. The command is asynchronous.
      Parameters:
      id - the ID of the virtual machine
      Returns:
      encrypted password
    • changeServiceForVirtualMachine

      @Named("changeServiceForVirtualMachine") @GET @Consumes("application/json") String changeServiceForVirtualMachine(@QueryParam("id") String id, @QueryParam("serviceofferingid") String serviceOfferingId)
      Changes the service offering for a virtual machine. The virtual machine must be in a "Stopped" state for this command to take effect.
      Parameters:
      id - The ID of the virtual machine
      serviceOfferingId - The service offering ID to apply to the virtual machine
      Returns:
      job id related to destroying the VM
    • updateVirtualMachine

      @Named("updateVirtualMachine") @GET @Consumes("application/json") String updateVirtualMachine(@QueryParam("id") String id, UpdateVirtualMachineOptions options)
      Updates parameters of a virtual machine.
      Parameters:
      id - The ID of the virtual machine
      Returns:
      job id related to destroying the VM
    • destroyVirtualMachine

      @Named("destroyVirtualMachine") @GET @Consumes("application/json") String destroyVirtualMachine(@QueryParam("id") String id)
      Destroys a virtual machine. Once destroyed, only the administrator can recover it.
      Parameters:
      id - vm to destroy
      Returns:
      job id related to destroying the VM, or null if resource was not found
    • assignVirtualMachine

      @Named("assignVirtualMachine") @GET @Consumes("application/json") VirtualMachine assignVirtualMachine(@QueryParam("virtualmachineid") String virtualMachineId, AssignVirtualMachineOptions... options)
      Re-assign a virtual machine to a different account/domain.
      Parameters:
      virtualMachineId - VirtualMachine to re-assign
      options - AssignVirtualMachineOptions specifying account and domain to transfer to, and optional network and security group IDs.
      Returns:
      VirtualMachine or null if not found