Interface VirtualMachine
- All Superinterfaces:
GroupableResource<com.microsoft.azure.management.compute.implementation.ComputeManager,
,com.microsoft.azure.management.compute.implementation.VirtualMachineInner> HasId
,HasInner<com.microsoft.azure.management.compute.implementation.VirtualMachineInner>
,HasManager<com.microsoft.azure.management.compute.implementation.ComputeManager>
,HasName
,HasNetworkInterfaces
,HasResourceGroup
,Indexable
,Refreshable<VirtualMachine>
,Resource
,Updatable<VirtualMachine.Update>
public interface VirtualMachine
extends GroupableResource<com.microsoft.azure.management.compute.implementation.ComputeManager,com.microsoft.azure.management.compute.implementation.VirtualMachineInner>, Refreshable<VirtualMachine>, Updatable<VirtualMachine.Update>, HasNetworkInterfaces
An immutable client-side representation of an Azure virtual machine.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The entirety of the managed disk based virtual machine definition.static interface
The entirety of the virtual machine definition.static interface
The virtual machine scale set stages shared between managed and unmanaged based virtual machine definitions.static interface
Grouping of virtual machine definition stages.static interface
The entirety of the unmanaged disk based virtual machine definition.static interface
The template for an update operation, containing all the settings that can be modified.static interface
Grouping of virtual machine update stages.Nested classes/interfaces inherited from interface com.microsoft.azure.management.resources.fluentcore.arm.models.Resource
Resource.DefinitionWithRegion<T>, Resource.DefinitionWithTags<T>, Resource.UpdateWithTags<T>
-
Method Summary
Modifier and TypeMethodDescriptioncom.microsoft.azure.PagedList<VirtualMachineSize>
Lists all available virtual machine sizes this virtual machine can resized to.Captures the virtual machine by copying virtual hard disks of the VM.rx.Observable<String>
captureAsync
(String containerName, String vhdPrefix, boolean overwriteVhd) Captures the virtual machine by copying virtual hard disks of the VM asynchronously.com.microsoft.rest.ServiceFuture<String>
captureAsync
(String containerName, String vhdPrefix, boolean overwriteVhd, com.microsoft.rest.ServiceCallback<String> callback) Captures the virtual machine by copying virtual hard disks of the VM asynchronously.void
Converts (migrates) the virtual machine with un-managed disks to use managed disk.rx.Completable
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.com.microsoft.rest.ServiceFuture<Void>
convertToManagedAsync
(com.microsoft.rest.ServiceCallback<Void> callback) Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.void
Shuts down the virtual machine and releases the compute resources.rx.Completable
Shuts down the virtual machine and releases the compute resources asynchronously.com.microsoft.rest.ServiceFuture<Void>
deallocateAsync
(com.microsoft.rest.ServiceCallback<Void> callback) Shuts down the virtual machine and releases the compute resources asynchronously.void
Generalizes the virtual machine.rx.Completable
Generalizes the virtual machine asynchronously.com.microsoft.rest.ServiceFuture<Void>
generalizeAsync
(com.microsoft.rest.ServiceCallback<Void> callback) Generalizes the virtual machine asynchronously.Gets the public IP address associated with this virtual machine's primary network interface.Get the virtual machine instance view.boolean
boolean
boolean
rx.Observable<VirtualMachineExtension>
osDiskId()
int
osType()
plan()
void
powerOff()
Powers off (stops) the virtual machine.rx.Completable
Powers off (stops) the virtual machine asynchronously.com.microsoft.rest.ServiceFuture<Void>
powerOffAsync
(com.microsoft.rest.ServiceCallback<Void> callback) Powers off (stop) the virtual machine asynchronously.priority()
Get specifies information about the proximity placement group that the virtual machine scale set should be assigned to.void
redeploy()
Redeploys the virtual machine.rx.Completable
Redeploys the virtual machine asynchronously.com.microsoft.rest.ServiceFuture<Void>
redeployAsync
(com.microsoft.rest.ServiceCallback<Void> callback) Redeploys the virtual machine asynchronously.Refreshes the virtual machine instance view to sync with Azure.rx.Observable<VirtualMachineInstanceView>
Refreshes the virtual machine instance view to sync with Azure.void
restart()
Restarts the virtual machine.rx.Completable
Restarts the virtual machine asynchronously.com.microsoft.rest.ServiceFuture<Void>
restartAsync
(com.microsoft.rest.ServiceCallback<Void> callback) Restarts the virtual machine asynchronously.runCommand
(RunCommandInput inputCommand) Run commands in the virtual machine.rx.Observable<RunCommandResult>
runCommandAsync
(RunCommandInput inputCommand) Run commands in the virtual machine asynchronously.runPowerShellScript
(String groupName, String name, List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in a virtual machine.rx.Observable<RunCommandResult>
runPowerShellScriptAsync
(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in the virtual machine asynchronously.runShellScript
(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in the virtual machine.rx.Observable<RunCommandResult>
runShellScriptAsync
(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in the virtual machine asynchronously.void
Simulates the eviction of spot virtual machine.rx.Completable
Simulates the eviction of spot virtual machine asynchronously.com.microsoft.rest.ServiceFuture<Void>
simulateEvictionAsync
(com.microsoft.rest.ServiceCallback<Void> callback) Simulates the eviction of spot virtual machine asynchronously.size()
void
start()
Starts the virtual machine.rx.Completable
Starts the virtual machine asynchronously.com.microsoft.rest.ServiceFuture<Void>
startAsync
(com.microsoft.rest.ServiceCallback<Void> callback) Starts the virtual machine asynchronously.Returns the storage profile of an Azure virtual machine.vmId()
Methods inherited from interface com.microsoft.azure.management.resources.fluentcore.arm.models.HasId
id
Methods inherited from interface com.microsoft.azure.management.resources.fluentcore.model.HasInner
inner
Methods inherited from interface com.microsoft.azure.management.resources.fluentcore.arm.models.HasManager
manager
Methods inherited from interface com.microsoft.azure.management.resources.fluentcore.arm.models.HasName
name
Methods inherited from interface com.microsoft.azure.management.network.model.HasNetworkInterfaces
getPrimaryNetworkInterface, networkInterfaceIds, primaryNetworkInterfaceId
Methods inherited from interface com.microsoft.azure.management.resources.fluentcore.arm.models.HasResourceGroup
resourceGroupName
Methods inherited from interface com.microsoft.azure.management.resources.fluentcore.model.Indexable
key
Methods inherited from interface com.microsoft.azure.management.resources.fluentcore.model.Refreshable
refresh, refreshAsync
Methods inherited from interface com.microsoft.azure.management.resources.fluentcore.arm.models.Resource
region, regionName, tags, type
-
Method Details
-
deallocate
void deallocate()Shuts down the virtual machine and releases the compute resources. -
deallocateAsync
rx.Completable deallocateAsync()Shuts down the virtual machine and releases the compute resources asynchronously.- Returns:
- a representation of the deferred computation of this call
-
deallocateAsync
com.microsoft.rest.ServiceFuture<Void> deallocateAsync(com.microsoft.rest.ServiceCallback<Void> callback) Shuts down the virtual machine and releases the compute resources asynchronously.- Parameters:
callback
- the callback to call on success or failure- Returns:
- a handle to cancel the request
-
generalize
void generalize()Generalizes the virtual machine. -
generalizeAsync
rx.Completable generalizeAsync()Generalizes the virtual machine asynchronously.- Returns:
- a representation of the deferred computation of this call
-
generalizeAsync
com.microsoft.rest.ServiceFuture<Void> generalizeAsync(com.microsoft.rest.ServiceCallback<Void> callback) Generalizes the virtual machine asynchronously.- Parameters:
callback
- the callback to call on success or failure- Returns:
- a handle to cancel the request
-
powerOff
void powerOff()Powers off (stops) the virtual machine. -
powerOffAsync
rx.Completable powerOffAsync()Powers off (stops) the virtual machine asynchronously.- Returns:
- a representation of the deferred computation of this call
-
powerOffAsync
com.microsoft.rest.ServiceFuture<Void> powerOffAsync(com.microsoft.rest.ServiceCallback<Void> callback) Powers off (stop) the virtual machine asynchronously.- Parameters:
callback
- the callback to call on success or failure- Returns:
- a handle to cancel the request
-
restart
void restart()Restarts the virtual machine. -
restartAsync
rx.Completable restartAsync()Restarts the virtual machine asynchronously.- Returns:
- a representation of the deferred computation of this call
-
restartAsync
com.microsoft.rest.ServiceFuture<Void> restartAsync(com.microsoft.rest.ServiceCallback<Void> callback) Restarts the virtual machine asynchronously.- Parameters:
callback
- the callback to call on success or failure- Returns:
- a handle to cancel the request
-
start
void start()Starts the virtual machine. -
startAsync
rx.Completable startAsync()Starts the virtual machine asynchronously.- Returns:
- a representation of the deferred computation of this call
-
startAsync
com.microsoft.rest.ServiceFuture<Void> startAsync(com.microsoft.rest.ServiceCallback<Void> callback) Starts the virtual machine asynchronously.- Parameters:
callback
- the callback to call on success or failure- Returns:
- a handle to cancel the request
-
redeploy
void redeploy()Redeploys the virtual machine. -
redeployAsync
rx.Completable redeployAsync()Redeploys the virtual machine asynchronously.- Returns:
- a representation of the deferred computation of this call
-
redeployAsync
com.microsoft.rest.ServiceFuture<Void> redeployAsync(com.microsoft.rest.ServiceCallback<Void> callback) Redeploys the virtual machine asynchronously.- Parameters:
callback
- the callback to call on success or failure- Returns:
- a handle to cancel the request
-
simulateEviction
void simulateEviction()Simulates the eviction of spot virtual machine. The eviction will occur with 30 minutes after calling this API. -
simulateEvictionAsync
rx.Completable simulateEvictionAsync()Simulates the eviction of spot virtual machine asynchronously. The eviction will occur with 30 minutes after calling this API.- Returns:
- a representation of the deferred computation of this call
-
simulateEvictionAsync
com.microsoft.rest.ServiceFuture<Void> simulateEvictionAsync(com.microsoft.rest.ServiceCallback<Void> callback) Simulates the eviction of spot virtual machine asynchronously. The eviction will occur with 30 minutes after calling this API.- Parameters:
callback
- the callback to call on success or failure- Returns:
- a handle to cancel the request
-
diskEncryption
VirtualMachineEncryption diskEncryption()- Returns:
- entry point to enabling, disabling and querying disk encryption
-
convertToManaged
void convertToManaged()Converts (migrates) the virtual machine with un-managed disks to use managed disk. -
convertToManagedAsync
rx.Completable convertToManagedAsync()Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.- Returns:
- a representation of the deferred computation of this call
-
convertToManagedAsync
com.microsoft.rest.ServiceFuture<Void> convertToManagedAsync(com.microsoft.rest.ServiceCallback<Void> callback) Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.- Parameters:
callback
- the callback to call on success or failure- Returns:
- a handle to cancel the request
-
availableSizes
com.microsoft.azure.PagedList<VirtualMachineSize> availableSizes()Lists all available virtual machine sizes this virtual machine can resized to.- Returns:
- the virtual machine sizes
-
capture
Captures the virtual machine by copying virtual hard disks of the VM.- Parameters:
containerName
- destination container name to store the captured VHDvhdPrefix
- the prefix for the VHD holding captured imageoverwriteVhd
- whether to overwrites destination VHD if it exists- Returns:
- the JSON template for creating more such virtual machines
-
captureAsync
Captures the virtual machine by copying virtual hard disks of the VM asynchronously.- Parameters:
containerName
- destination container name to store the captured VHDvhdPrefix
- the prefix for the VHD holding captured imageoverwriteVhd
- whether to overwrites destination VHD if it exists- Returns:
- a representation of the deferred computation of this call
-
captureAsync
com.microsoft.rest.ServiceFuture<String> captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd, com.microsoft.rest.ServiceCallback<String> callback) Captures the virtual machine by copying virtual hard disks of the VM asynchronously.- Parameters:
containerName
- destination container name to store the captured VHDvhdPrefix
- the prefix for the VHD holding captured imageoverwriteVhd
- whether to overwrites destination VHD if it existscallback
- the callback to call on success or failure- Returns:
- a representation of the deferred computation of this call
-
refreshInstanceView
VirtualMachineInstanceView refreshInstanceView()Refreshes the virtual machine instance view to sync with Azure.The instance view will be cached for later retrieval using
instanceView
.- Returns:
- the refreshed instance view
-
refreshInstanceViewAsync
rx.Observable<VirtualMachineInstanceView> refreshInstanceViewAsync()Refreshes the virtual machine instance view to sync with Azure.- Returns:
- an observable that emits the instance view of the virtual machine.
-
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 namename
- the virtual machine namescriptLines
- PowerShell script linesscriptParameters
- script parameters- Returns:
- result of PowerShell script execution
-
runPowerShellScriptAsync
rx.Observable<RunCommandResult> runPowerShellScriptAsync(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in the virtual machine asynchronously.- Parameters:
scriptLines
- PowerShell script linesscriptParameters
- script parameters- Returns:
- handle to the asynchronous execution
-
runShellScript
RunCommandResult runShellScript(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in the virtual machine.- Parameters:
scriptLines
- shell script linesscriptParameters
- script parameters- Returns:
- result of shell script execution
-
runShellScriptAsync
rx.Observable<RunCommandResult> runShellScriptAsync(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters) Run shell script in the virtual machine asynchronously.- Parameters:
scriptLines
- shell script linesscriptParameters
- script parameters- Returns:
- handle to the asynchronous execution
-
runCommand
Run commands in the virtual machine.- Parameters:
inputCommand
- command input- Returns:
- result of execution
-
runCommandAsync
Run commands in the virtual machine asynchronously.- Parameters:
inputCommand
- command input- Returns:
- handle to the asynchronous execution
-
isManagedDiskEnabled
boolean isManagedDiskEnabled()- Returns:
- true if managed disks are used for the virtual machine's disks (OS, data)
-
computerName
String computerName()- Returns:
- name of this virtual machine
-
size
VirtualMachineSizeTypes size()- Returns:
- the virtual machine size
-
osType
OperatingSystemTypes osType()- Returns:
- the operating system of this virtual machine
-
osUnmanagedDiskVhdUri
String osUnmanagedDiskVhdUri()- Returns:
- the URI to the VHD file backing this virtual machine's operating system disk
-
osDiskCachingType
CachingTypes osDiskCachingType()- Returns:
- the operating system disk caching type
-
osDiskSize
int osDiskSize()- Returns:
- the size of the operating system disk in GB
-
osDiskStorageAccountType
StorageAccountTypes osDiskStorageAccountType()- Returns:
- the storage account type of the managed disk backing OS disk
-
osDiskId
String osDiskId()- Returns:
- resource ID of the managed disk backing the OS disk
-
unmanagedDataDisks
Map<Integer,VirtualMachineUnmanagedDataDisk> unmanagedDataDisks()- Returns:
- the unmanaged data disks associated with this virtual machine, indexed by LUN number
-
dataDisks
Map<Integer,VirtualMachineDataDisk> dataDisks()- Returns:
- the managed data disks associated with this virtual machine, indexed by LUN
-
getPrimaryPublicIPAddress
PublicIPAddress getPrimaryPublicIPAddress()Gets the public IP address associated with this virtual machine's primary network interface.Note that this method makes a rest API call to fetch the resource.
- Returns:
- the public IP of the primary network interface
-
getPrimaryPublicIPAddressId
String getPrimaryPublicIPAddressId()- Returns:
- the resource ID of the public IP address associated with this virtual machine's primary network interface
-
availabilitySetId
String availabilitySetId()- Returns:
- the resource ID of the availability set associated with this virtual machine
-
provisioningState
String provisioningState()- Returns:
- the provisioningState value
-
licenseType
String licenseType()- Returns:
- the licenseType value
-
proximityPlacementGroup
ProximityPlacementGroup proximityPlacementGroup()Get specifies information about the proximity placement group that the virtual machine scale set should be assigned to.- Returns:
- the proximityPlacementGroup.
-
listExtensionsAsync
rx.Observable<VirtualMachineExtension> listExtensionsAsync()- Returns:
- a representation of the deferred computation of this call, returning extensions attached to the virtual machine
-
listExtensions
Map<String,VirtualMachineExtension> listExtensions()- Returns:
- extensions attached to the virtual machine
-
plan
Plan plan()- Returns:
- the plan value
-
storageProfile
StorageProfile storageProfile()Returns the storage profile of an Azure virtual machine.- Returns:
- the storageProfile value
-
osProfile
OSProfile osProfile()- Returns:
- the operating system profile
-
diagnosticsProfile
DiagnosticsProfile diagnosticsProfile()- Returns:
- the diagnostics profile
-
vmId
String vmId()- Returns:
- the virtual machine unique ID.
-
powerState
PowerState powerState()- Returns:
- the power state of the virtual machine
-
instanceView
VirtualMachineInstanceView instanceView()Get the virtual machine instance view.The instance view will be cached for later retrieval using
instanceView
.- Returns:
- the virtual machine's instance view
-
availabilityZones
Set<AvailabilityZoneId> availabilityZones()- Returns:
- the availability zones assigned to the virtual machine
-
isBootDiagnosticsEnabled
boolean isBootDiagnosticsEnabled()- Returns:
- true if boot diagnostics is enabled for the virtual machine
-
bootDiagnosticsStorageUri
String bootDiagnosticsStorageUri()- Returns:
- the storage blob endpoint uri if boot diagnostics is enabled for the virtual machine
-
isManagedServiceIdentityEnabled
boolean isManagedServiceIdentityEnabled()- Returns:
- true if Managed Service Identity is enabled for the virtual machine
-
systemAssignedManagedServiceIdentityTenantId
String systemAssignedManagedServiceIdentityTenantId()- Returns:
- the System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the virtual machine.
-
systemAssignedManagedServiceIdentityPrincipalId
String systemAssignedManagedServiceIdentityPrincipalId()- Returns:
- the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID assigned to the virtual machine.
-
managedServiceIdentityType
ResourceIdentityType managedServiceIdentityType()- Returns:
- the type of Managed Service Identity used for the virtual machine.
-
userAssignedManagedServiceIdentityIds
- Returns:
- the resource ids of User Assigned Managed Service Identities associated with the virtual machine.
-
priority
VirtualMachinePriorityTypes priority()- Returns:
- the priority for the virtual machine.
-
evictionPolicy
VirtualMachineEvictionPolicyTypes evictionPolicy()- Returns:
- the eviction policy for the virtual machine.
-
billingProfile
BillingProfile billingProfile()- Returns:
- the billing related details of a low priority virtual machine
-