Package org.jclouds.cloudstack.features
Interface VirtualMachineApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VirtualMachine
assignVirtualMachine(String virtualMachineId, AssignVirtualMachineOptions... options)
Re-assign a virtual machine to a different account/domain.String
changeServiceForVirtualMachine(String id, String serviceOfferingId)
Changes the service offering for a virtual machine.AsyncCreateResponse
deployVirtualMachineInZone(String zoneId, String serviceOfferingId, String templateId, DeployVirtualMachineOptions... options)
Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.String
destroyVirtualMachine(String id)
Destroys a virtual machine.String
getEncryptedPasswordForVirtualMachine(String id)
Return an encrypted password for the virtual machine.VirtualMachine
getVirtualMachine(String id)
get a specific VirtualMachine by idSet<VirtualMachine>
listVirtualMachines(ListVirtualMachinesOptions... options)
Lists VirtualMachinesString
rebootVirtualMachine(String id)
Reboots a virtual machine.String
resetPasswordForVirtualMachine(String id)
Resets the password for virtual machine.String
startVirtualMachine(String id)
Starts a virtual machine.String
stopVirtualMachine(String id)
Stops a virtual machine.String
stopVirtualMachine(String id, StopVirtualMachineOptions options)
Stops a virtual machine.String
updateVirtualMachine(String id, UpdateVirtualMachineOptions options)
Updates parameters of a virtual machine.
-
-
-
Method Detail
-
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 machineserviceOfferingId
- the ID of the service offering for the virtual machinetemplateId
- 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 machineoptions
- 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 machineserviceOfferingId
- 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-assignoptions
- AssignVirtualMachineOptions specifying account and domain to transfer to, and optional network and security group IDs.- Returns:
- VirtualMachine or null if not found
-
-