Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.management.compute;
import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.compute.implementation.ComputeManager;
import com.microsoft.azure.management.compute.implementation.VirtualMachinesInner;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsBatchDeletion;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByResourceGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasManager;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing;
import com.microsoft.azure.management.resources.fluentcore.model.HasInner;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import rx.Completable;
import rx.Observable;
import java.util.List;
Entry point to virtual machine management API.
/**
* Entry point to virtual machine management API.
*/
@Fluent
public interface VirtualMachines extends
SupportsListing<VirtualMachine>,
SupportsListingByResourceGroup<VirtualMachine>,
SupportsGettingByResourceGroup<VirtualMachine>,
SupportsGettingById<VirtualMachine>,
SupportsCreating<VirtualMachine.DefinitionStages.Blank>,
SupportsDeletingById,
SupportsDeletingByResourceGroup,
SupportsBatchCreation<VirtualMachine>,
SupportsBatchDeletion,
HasManager<ComputeManager>,
HasInner<VirtualMachinesInner> {
Returns: available virtual machine sizes
/**
* @return available virtual machine sizes
*/
VirtualMachineSizes sizes();
Shuts down the virtual machine and releases the compute resources.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
/**
* Shuts down the virtual machine and releases the compute resources.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*/
void deallocate(String groupName, String name);
Shuts down the virtual machine and releases the compute resources asynchronously.
Params: - 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
/**
* Shuts down the virtual machine and releases the compute resources asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*
* @return a representation of the deferred computation of this call
*/
Completable deallocateAsync(String groupName, String name);
Shuts down the virtual machine and releases the compute resources asynchronously.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
- callback – the callback to call on success or failure
Returns: a handle to cancel the request
/**
* Shuts down the virtual machine and releases the compute resources asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @param callback the callback to call on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> deallocateAsync(String groupName, String name, ServiceCallback<Void> callback);
Generalizes the virtual machine.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
/**
* Generalizes the virtual machine.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*/
void generalize(String groupName, String name);
Generalizes the virtual machine asynchronously.
Params: - 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
/**
* Generalizes the virtual machine asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @return a representation of the deferred computation of this call
*/
Completable generalizeAsync(String groupName, String name);
Generalizes the virtual machine asynchronously.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
- callback – the callback to call on success or failure
Returns: a handle to cancel the request
/**
* Generalizes the virtual machine asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @param callback the callback to call on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> generalizeAsync(String groupName, String name, ServiceCallback<Void> callback);
Powers off (stops) a virtual machine.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
/**
* Powers off (stops) a virtual machine.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*/
void powerOff(String groupName, String name);
Powers off (stops) the virtual machine asynchronously.
Params: - 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
/**
* Powers off (stops) the virtual machine asynchronously.
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*
* @return a representation of the deferred computation of this call
*/
Completable powerOffAsync(String groupName, String name);
Powers off (stop) the virtual machine asynchronously.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
- callback – the callback to call on success or failure
Returns: a handle to cancel the request
/**
* Powers off (stop) the virtual machine asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @param callback the callback to call on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> powerOffAsync(String groupName, String name, ServiceCallback<Void> callback);
Restarts a virtual machine.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
/**
* Restarts a virtual machine.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*/
void restart(String groupName, String name);
Restarts the virtual machine asynchronously.
Params: - 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
/**
* Restarts the virtual machine asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @return a representation of the deferred computation of this call
*/
Completable restartAsync(String groupName, String name);
Restarts the virtual machine asynchronously.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
- callback – the callback to call on success or failure
Returns: a handle to cancel the request
/**
* Restarts the virtual machine asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @param callback the callback to call on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> restartAsync(String groupName, String name, ServiceCallback<Void> callback);
Starts a virtual machine.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
/**
* Starts a virtual machine.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*/
void start(String groupName, String name);
Starts the virtual machine asynchronously.
Params: - 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
/**
* Starts the virtual machine asynchronously.
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*
* @return a representation of the deferred computation of this call
*/
Completable startAsync(String groupName, String name);
Starts the virtual machine asynchronously.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
- callback – the callback to call on success or failure
Returns: a handle to cancel the request
/**
* Starts the virtual machine asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @param callback the callback to call on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> startAsync(String groupName, String name, ServiceCallback<Void> callback);
Redeploys a virtual machine.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
/**
* Redeploys a virtual machine.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
*/
void redeploy(String groupName, String name);
Redeploys the virtual machine asynchronously.
Params: - 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
/**
* Redeploys the virtual machine asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @return a representation of the deferred computation of this call
*/
Completable redeployAsync(String groupName, String name);
Redeploys the virtual machine asynchronously.
Params: - groupName – the name of the resource group the virtual machine is in
- name – the virtual machine name
- callback – the callback to call on success or failure
Returns: a handle to cancel the request
/**
* Redeploys the virtual machine asynchronously.
*
* @param groupName the name of the resource group the virtual machine is in
* @param name the virtual machine name
* @param callback the callback to call on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> redeployAsync(String groupName, String name, ServiceCallback<Void> callback);
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.
Params: - 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
/**
* 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.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param containerName destination container name to store the captured VHD
* @param vhdPrefix the prefix for the VHD holding captured image
* @param overwriteVhd whether to overwrites destination VHD if it exists
* @return the template as JSON string
*/
String capture(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd);
Captures the virtual machine by copying virtual hard disks of the VM asynchronously.
Params: - 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
/**
* Captures the virtual machine by copying virtual hard disks of the VM asynchronously.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param containerName destination container name to store the captured VHD
* @param vhdPrefix the prefix for the VHD holding captured image
* @param overwriteVhd whether to overwrites destination VHD if it exists
* @return a representation of the deferred computation of this call
*/
Observable<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.
Params: - 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
- callback – the callback to call on success or failure
Returns: a representation of the deferred computation of this call
/**
* Captures the virtual machine by copying virtual hard disks of the VM asynchronously.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param containerName destination container name to store the captured VHD
* @param vhdPrefix the prefix for the VHD holding captured image
* @param overwriteVhd whether to overwrites destination VHD if it exists
* @param callback the callback to call on success or failure
* @return a representation of the deferred computation of this call
*/
ServiceFuture<String> captureAsync(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd, ServiceCallback<String> callback);
Migrates the virtual machine with unmanaged disks to use managed disks.
Params: - groupName – the resource group name
- name – the virtual machine name
/**
* Migrates the virtual machine with unmanaged disks to use managed disks.
*
* @param groupName the resource group name
* @param name the virtual machine name
*/
void migrateToManaged(String groupName, String name);
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.
Params: - groupName – the resource group name
- name – the virtual machine name
Returns: a representation of the deferred computation of this call
/**
* Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @return a representation of the deferred computation of this call
*/
Completable migrateToManagedAsync(String groupName, String name);
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.
Params: - groupName – the resource group name
- name – the virtual machine name
- callback – the callback to call on success or failure
Returns: a handle to cancel the request
/**
* Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param callback the callback to call on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> migrateToManagedAsync(String groupName, String name, ServiceCallback<Void> callback);
Run shell script in a virtual machine.
Params: - groupName – the resource group name
- name – the virtual machine name
- scriptLines – PowerShell script lines
- scriptParameters – script parameters
Returns: result of PowerShell script execution
/**
* Run shell script in a virtual machine.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param scriptLines PowerShell script lines
* @param scriptParameters script parameters
* @return result of PowerShell script execution
*/
RunCommandResult runPowerShellScript(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters);
Run shell script in a virtual machine asynchronously.
Params: - groupName – the resource group name
- name – the virtual machine name
- scriptLines – PowerShell script lines
- scriptParameters – script parameters
Returns: handle to the asynchronous execution
/**
* Run shell script in a virtual machine asynchronously.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param scriptLines PowerShell script lines
* @param scriptParameters script parameters
* @return handle to the asynchronous execution
*/
Observable<RunCommandResult> runPowerShellScriptAsync(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters);
Run shell script in a virtual machine.
Params: - groupName – the resource group name
- name – the virtual machine name
- scriptLines – shell script lines
- scriptParameters – script parameters
Returns: result of shell script execution
/**
* Run shell script in a virtual machine.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param scriptLines shell script lines
* @param scriptParameters script parameters
* @return result of shell script execution
*/
RunCommandResult runShellScript(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters);
Run shell script in a virtual machine asynchronously.
Params: - groupName – the resource group name
- name – the virtual machine name
- scriptLines – shell script lines
- scriptParameters – script parameters
Returns: handle to the asynchronous execution
/**
* Run shell script in a virtual machine asynchronously.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param scriptLines shell script lines
* @param scriptParameters script parameters
* @return handle to the asynchronous execution
*/
Observable<RunCommandResult> runShellScriptAsync(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters);
Run commands in a virtual machine.
Params: - groupName – the resource group name
- name – the virtual machine name
- inputCommand – command input
Returns: result of execution
/**
* Run commands in a virtual machine.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param inputCommand command input
* @return result of execution
*/
RunCommandResult runCommand(String groupName, String name, RunCommandInput inputCommand);
Run commands in a virtual machine asynchronously.
Params: - groupName – the resource group name
- name – the virtual machine name
- inputCommand – command input
Returns: handle to the asynchronous execution
/**
* Run commands in a virtual machine asynchronously.
*
* @param groupName the resource group name
* @param name the virtual machine name
* @param inputCommand command input
* @return handle to the asynchronous execution
*/
Observable<RunCommandResult> runCommandAsync(String groupName, String name, RunCommandInput inputCommand);
Force delete a resource from Azure, identifying it by its resource ID.
Params: - id – the resource ID of the resource to delete
- forceDeletion – force delete parameter
/**
* Force delete a resource from Azure, identifying it by its resource ID.
*
* @param id the resource ID of the resource to delete
* @param forceDeletion force delete parameter
*/
void deleteById(String id, boolean forceDeletion);
Asynchronously force delete a resource from Azure, identifying it by its resource ID.
Params: - id – the resource ID of the resource to delete
- forceDeletion – force delete parameter
- callback – the callback on success or failure
Returns: a handle to cancel the request
/**
* Asynchronously force delete a resource from Azure, identifying it by its resource ID.
*
* @param id the resource ID of the resource to delete
* @param forceDeletion force delete parameter
* @param callback the callback on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> deleteByIdAsync(String id, boolean forceDeletion, ServiceCallback<Void> callback);
Asynchronously force delete a resource from Azure, identifying it by its resource ID.
Params: - id – the resource ID of the resource to delete
- forceDeletion – force delete parameter
Returns: a representation of the deferred computation of this call
/**
* Asynchronously force delete a resource from Azure, identifying it by its resource ID.
*
* @param id the resource ID of the resource to delete
* @param forceDeletion force delete parameter
* @return a representation of the deferred computation of this call
*/
Completable deleteByIdAsync(String id, boolean forceDeletion);
Force delete a resource from Azure, identifying it by its name and its resource group.
Params: - resourceGroupName – the resource group the resource is part of
- name – the name of the resource
- forceDeletion – force delete parameter
/**
* Force delete a resource from Azure, identifying it by its name and its resource group.
*
* @param resourceGroupName the resource group the resource is part of
* @param name the name of the resource
* @param forceDeletion force delete parameter
*/
void deleteByResourceGroup(String resourceGroupName, String name, boolean forceDeletion);
Asynchronously force delete a resource from Azure, identifying it by its name and its resource group.
Params: - resourceGroupName – the resource group the resource is part of
- name – the name of the resource
- forceDeletion – force delete parameter
- callback – the callback to call on success or failure
Returns: a handle to cancel the request
/**
* Asynchronously force delete a resource from Azure, identifying it by its name and its resource group.
*
* @param resourceGroupName the resource group the resource is part of
* @param name the name of the resource
* @param forceDeletion force delete parameter
* @param callback the callback to call on success or failure
* @return a handle to cancel the request
*/
ServiceFuture<Void> deleteByResourceGroupAsync(String resourceGroupName, String name, boolean forceDeletion, ServiceCallback<Void> callback);
Asynchronously force delete a resource from Azure, identifying it by its name and its resource group.
Params: - resourceGroupName – the resource group the resource is part of
- name – the name of the resource
- forceDeletion – force delete parameter
Returns: a representation of the deferred computation of this call
/**
* Asynchronously force delete a resource from Azure, identifying it by its name and its resource group.
*
* @param resourceGroupName the resource group the resource is part of
* @param name the name of the resource
* @param forceDeletion force delete parameter
* @return a representation of the deferred computation of this call
*/
Completable deleteByResourceGroupAsync(String resourceGroupName, String name, boolean forceDeletion);
}