VirtualMachine Interface
Implements
public interface VirtualMachine
extends GroupableResource<ComputeManager,VirtualMachineInner>, Refreshable<VirtualMachine>, Updatable<Update>, HasNetworkInterfaces
An immutable client-side representation of an Azure virtual machine.
Method Summary
Modifier and Type | Method and Description |
---|---|
abstract String |
availabilitySetId()
Gets the resource ID of the availability set associated with this virtual machine. |
abstract
Set<Availability |
availabilityZones()
Gets the availability zones assigned to the virtual machine. |
abstract
Paged |
availableSizes()
Lists all available virtual machine sizes this virtual machine can resized to. |
abstract
Billing |
billingProfile()
Gets the billing related details of a low priority virtual machine. |
abstract String |
bootDiagnosticsStorageUri()
Gets the storage blob endpoint uri if boot diagnostics is enabled for the virtual machine. |
abstract String |
capacityReservationGroupId()
Gets resource id of capacity reservation group for the virtual machine. |
abstract String |
capture(String containerName, String vhdPrefix, boolean overwriteVhd)
Captures the virtual machine by copying virtual hard disks of the VM. |
abstract Mono<String> |
captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd)
Captures the virtual machine by copying virtual hard disks of the VM asynchronously. |
abstract String |
computerName()
Gets name of this virtual machine. |
abstract void |
convertToManaged()
Converts (migrates) the virtual machine with un-managed disks to use managed disk. |
abstract Mono<Void> |
convertToManagedAsync()
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously. |
abstract
Map<Integer,Virtual |
dataDisks()
Gets the managed data disks associated with this virtual machine, indexed by LUN. |
abstract void |
deallocate()
Shuts down the virtual machine and releases the compute resources. |
abstract void |
deallocate(boolean hibernate)
Shuts down the virtual machine and releases the compute resources. |
abstract Mono<Void> |
deallocateAsync()
Shuts down the virtual machine and releases the compute resources asynchronously. |
abstract Mono<Void> |
deallocateAsync(boolean hibernate)
Shuts down the virtual machine and releases the compute resources asynchronously. |
abstract
Diagnostics |
diagnosticsProfile()
Gets the diagnostics profile. |
abstract
Virtual |
diskEncryption()
Gets entry point to enabling, disabling and querying disk encryption. |
abstract
Virtual |
evictionPolicy()
Gets the eviction policy for the virtual machine. |
abstract void |
generalize()
Generalizes the virtual machine. |
abstract Mono<Void> |
generalizeAsync()
Generalizes the virtual machine asynchronously. |
abstract
Public |
getPrimaryPublicIPAddress()
Gets the public IP address associated with this virtual machine's primary network interface. |
abstract String |
getPrimaryPublicIPAddressId()
Gets the resource ID of the public IP address associated with this virtual machine's primary network interface. |
abstract
Virtual |
instanceView()
Get the virtual machine instance view. |
abstract boolean |
isBootDiagnosticsEnabled()
Checks whether boot diagnostics is enabled for the virtual machine. |
abstract boolean |
isEncryptionAtHost()
Checks whether encryption at host. |
abstract boolean |
isHibernationEnabled()
Checks whether hibernation feature is enabled on the virtual machine. |
abstract boolean |
isManagedDiskEnabled()
Checks whether managed disks are used for the virtual machine's disks (OS, data). |
abstract boolean |
isManagedServiceIdentityEnabled()
Checks whether Managed Service Identity is enabled for the virtual machine. |
abstract boolean |
isOSDiskEphemeral()
Checks whether the os disk is ephemeral. |
abstract boolean |
isOsDiskWriteAcceleratorEnabled()
Gets whether the write accelerator is enabled. |
abstract boolean |
isSecureBootEnabled()
Checks whether secure boot is enabled on the virtual machine |
abstract boolean |
isUltraSsdEnabled()
Checks whether ultra SSD feature is enabled. |
abstract boolean |
isVTpmEnabled()
Checks whether vTPM is enabled on the virtual machine. |
abstract String |
licenseType()
Gets the license |
abstract
Map<String,Virtual |
listExtensions()
Gets extensions attached to the virtual machine. |
abstract
Mono<List<Virtual |
listExtensionsAsync()
Gets extensions attached to the virtual machine. |
abstract
Resource |
managedServiceIdentityType()
Gets the type of Managed Service Identity used for the virtual machine. |
abstract
Delete |
networkInterfaceDeleteOptions(String networkInterfaceId)
Gets the delete options for the given network interface. |
abstract
Caching |
osDiskCachingType()
Gets the operating system disk caching type. |
abstract
Delete |
osDiskDeleteOptions()
Gets the delete options of the OS disk. |
abstract String |
osDiskDiskEncryptionSetId()
Gets resource ID of the disk encryption set of the OS disk. |
abstract String |
osDiskId()
Gets resource ID of the managed disk backing the OS disk. |
abstract int |
osDiskSize()
Gets the size of the operating system disk in GB. |
abstract
Storage |
osDiskStorageAccountType()
Gets the storage account type of the managed disk backing OS disk. |
abstract OSProfile |
osProfile()
Gets the operating system profile. |
abstract
Operating |
osType()
Gets the operating system of this virtual machine. |
abstract String |
osUnmanagedDiskVhdUri()
Gets the URI to the VHD file backing this virtual machine's operating system disk. |
abstract Plan |
plan()
Gets the plan value. |
abstract void |
powerOff()
Powers off (stops) the virtual machine. |
abstract void |
powerOff(boolean skipShutdown)
Stops the virtual machine. |
abstract Mono<Void> |
powerOffAsync()
Powers off (stops) the virtual machine asynchronously. |
abstract Mono<Void> |
powerOffAsync(boolean skipShutdown)
Stops the virtual machine. |
abstract
Power |
powerState()
Gets the power state of the virtual machine. |
abstract
Delete |
primaryNetworkInterfaceDeleteOptions()
Gets the delete options for the primary network interface. |
abstract
Virtual |
priority()
Gets the priority for the virtual machine. |
abstract String |
provisioningState()
Gets the provisioning |
abstract
Proximity |
proximityPlacementGroup()
Get specifies information about the proximity placement group that the virtual machine scale set should be assigned to. |
abstract void |
redeploy()
Redeploys the virtual machine. |
abstract Mono<Void> |
redeployAsync()
Redeploys the virtual machine asynchronously. |
abstract
Virtual |
refreshInstanceView()
Refreshes the virtual machine instance view to sync with Azure. |
abstract
Mono<Virtual |
refreshInstanceViewAsync()
Refreshes the virtual machine instance view to sync with Azure. |
abstract void |
restart()
Restarts the virtual machine. |
abstract Mono<Void> |
restartAsync()
Restarts the virtual machine asynchronously. |
abstract
Run |
runCommand(RunCommandInput inputCommand)
Run commands in the virtual machine. |
abstract
Mono<Run |
runCommandAsync(RunCommandInput inputCommand)
Run commands in the virtual machine asynchronously. |
abstract
Run |
runPowerShellScript(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters)
Run shell script in a virtual machine. |
abstract
Mono<Run |
runPowerShellScriptAsync(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters)
Run shell script in the virtual machine asynchronously. |
abstract
Run |
runShellScript(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters)
Run shell script in the virtual machine. |
abstract
Mono<Run |
runShellScriptAsync(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters)
Run shell script in the virtual machine asynchronously. |
abstract
Security |
securityType()
Gets the SecurityTypes of the virtual machine. |
abstract void |
simulateEviction()
Simulates the eviction of spot virtual machine. |
abstract Mono<Void> |
simulateEvictionAsync()
Simulates the eviction of spot virtual machine asynchronously. |
abstract
Virtual |
size()
Gets the virtual machine size. |
abstract void |
start()
Starts the virtual machine. |
abstract Mono<Void> |
startAsync()
Starts the virtual machine asynchronously. |
abstract
Storage |
storageProfile()
Returns the storage profile of an Azure virtual machine. |
abstract String |
systemAssignedManagedServiceIdentityPrincipalId()
Gets the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID assigned to the virtual machine. |
abstract String |
systemAssignedManagedServiceIdentityTenantId()
Gets System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the virtual machine. |
abstract
Offset |
timeCreated()
Gets the time at which the Virtual Machine resource was created. |
abstract
Map<Integer,Virtual |
unmanagedDataDisks()
Gets the unmanaged data disks associated with this virtual machine, indexed by LUN number. |
abstract Set<String> |
userAssignedManagedServiceIdentityIds()
Gets the resource ids of User Assigned Managed Service Identities associated with the virtual machine. |
abstract String |
userData()
Gets the base64 encoded user data for the virtual machine. |
abstract String |
virtualMachineScaleSetId()
Gets the resource ID of the virtual machine scale set associated with this virtual machine. |
abstract String |
vmId()
Gets the virtual machine unique ID. |
Method Details
availabilitySetId
public abstract String availabilitySetId()
Gets the resource ID of the availability set associated with this virtual machine.
Returns:
availabilityZones
public abstract Set
Gets the availability zones assigned to the virtual machine.
Returns:
availableSizes
public abstract PagedIterable
Lists all available virtual machine sizes this virtual machine can resized to.
Returns:
billingProfile
public abstract BillingProfile billingProfile()
Gets the billing related details of a low priority virtual machine.
Returns:
bootDiagnosticsStorageUri
public abstract String bootDiagnosticsStorageUri()
Gets the storage blob endpoint uri if boot diagnostics is enabled for the virtual machine.
Returns:
capacityReservationGroupId
public abstract String capacityReservationGroupId()
Gets resource id of capacity reservation group for the virtual machine.
Returns:
capture
public abstract String capture(String containerName, String vhdPrefix, boolean overwriteVhd)
Captures the virtual machine by copying virtual hard disks of the VM.
Parameters:
Returns:
captureAsync
public abstract Mono
Captures the virtual machine by copying virtual hard disks of the VM asynchronously.
Parameters:
Returns:
computerName
public abstract String computerName()
Gets name of this virtual machine.
Returns:
convertToManaged
public abstract void convertToManaged()
Converts (migrates) the virtual machine with un-managed disks to use managed disk.
convertToManagedAsync
public abstract Mono
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.
Returns:
dataDisks
public abstract Map
Gets the managed data disks associated with this virtual machine, indexed by LUN.
Returns:
deallocate
public abstract void deallocate()
Shuts down the virtual machine and releases the compute resources.
deallocate
public abstract void deallocate(boolean hibernate)
Shuts down the virtual machine and releases the compute resources.
Parameters:
deallocateAsync
public abstract Mono
Shuts down the virtual machine and releases the compute resources asynchronously.
Returns:
deallocateAsync
public abstract Mono
Shuts down the virtual machine and releases the compute resources asynchronously.
Parameters:
Returns:
diagnosticsProfile
public abstract DiagnosticsProfile diagnosticsProfile()
Gets the diagnostics profile.
Returns:
diskEncryption
public abstract VirtualMachineEncryption diskEncryption()
Gets entry point to enabling, disabling and querying disk encryption.
Returns:
evictionPolicy
public abstract VirtualMachineEvictionPolicyTypes evictionPolicy()
Gets the eviction policy for the virtual machine.
Returns:
generalize
public abstract void generalize()
Generalizes the virtual machine.
generalizeAsync
public abstract Mono
Generalizes the virtual machine asynchronously.
Returns:
getPrimaryPublicIPAddress
public abstract 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:
getPrimaryPublicIPAddressId
public abstract String getPrimaryPublicIPAddressId()
Gets the resource ID of the public IP address associated with this virtual machine's primary network interface.
Returns:
instanceView
public abstract VirtualMachineInstanceView instanceView()
Get the virtual machine instance view.
The instance view will be cached for later retrieval using instanceView
.
Returns:
isBootDiagnosticsEnabled
public abstract boolean isBootDiagnosticsEnabled()
Checks whether boot diagnostics is enabled for the virtual machine.
Returns:
isEncryptionAtHost
public abstract boolean isEncryptionAtHost()
Checks whether encryption at host.
Returns:
isHibernationEnabled
public abstract boolean isHibernationEnabled()
Checks whether hibernation feature is enabled on the virtual machine.
Returns:
isManagedDiskEnabled
public abstract boolean isManagedDiskEnabled()
Checks whether managed disks are used for the virtual machine's disks (OS, data).
Returns:
isManagedServiceIdentityEnabled
public abstract boolean isManagedServiceIdentityEnabled()
Checks whether Managed Service Identity is enabled for the virtual machine.
Returns:
isOSDiskEphemeral
public abstract boolean isOSDiskEphemeral()
Checks whether the os disk is ephemeral.
Returns:
isOsDiskWriteAcceleratorEnabled
public abstract boolean isOsDiskWriteAcceleratorEnabled()
Gets whether the write accelerator is enabled.
Returns:
isSecureBootEnabled
public abstract boolean isSecureBootEnabled()
Checks whether secure boot is enabled on the virtual machine
Returns:
isUltraSsdEnabled
public abstract boolean isUltraSsdEnabled()
Checks whether ultra SSD feature is enabled.
Returns:
isVTpmEnabled
public abstract boolean isVTpmEnabled()
Checks whether vTPM is enabled on the virtual machine.
Returns:
licenseType
public abstract String licenseType()
Gets the licenseType value.
Returns:
listExtensions
public abstract Map
Gets extensions attached to the virtual machine.
Returns:
listExtensionsAsync
public abstract Mono> listExtensionsAsync()
Gets extensions attached to the virtual machine.
Returns:
managedServiceIdentityType
public abstract ResourceIdentityType managedServiceIdentityType()
Gets the type of Managed Service Identity used for the virtual machine.
Returns:
networkInterfaceDeleteOptions
public abstract DeleteOptions networkInterfaceDeleteOptions(String networkInterfaceId)
Gets the delete options for the given network interface.
Parameters:
Returns:
osDiskCachingType
public abstract CachingTypes osDiskCachingType()
Gets the operating system disk caching type.
Returns:
osDiskDeleteOptions
public abstract DeleteOptions osDiskDeleteOptions()
Gets the delete options of the OS disk.
Returns:
osDiskDiskEncryptionSetId
public abstract String osDiskDiskEncryptionSetId()
Gets resource ID of the disk encryption set of the OS disk.
Returns:
osDiskId
public abstract String osDiskId()
Gets resource ID of the managed disk backing the OS disk.
Returns:
osDiskSize
public abstract int osDiskSize()
Gets the size of the operating system disk in GB.
Returns:
osDiskStorageAccountType
public abstract StorageAccountTypes osDiskStorageAccountType()
Gets the storage account type of the managed disk backing OS disk.
Returns:
osProfile
public abstract OSProfile osProfile()
Gets the operating system profile.
Returns:
osType
public abstract OperatingSystemTypes osType()
Gets the operating system of this virtual machine.
Returns:
osUnmanagedDiskVhdUri
public abstract String osUnmanagedDiskVhdUri()
Gets the URI to the VHD file backing this virtual machine's operating system disk.
Returns:
plan
public abstract Plan plan()
Gets the plan value.
Returns:
powerOff
public abstract void powerOff()
Powers off (stops) the virtual machine.
powerOff
public abstract void powerOff(boolean skipShutdown)
Stops the virtual machine.
Parameters:
powerOffAsync
public abstract Mono
Powers off (stops) the virtual machine asynchronously.
Returns:
powerOffAsync
public abstract Mono
Stops the virtual machine.
Parameters:
Returns:
powerState
public abstract PowerState powerState()
Gets the power state of the virtual machine.
Returns:
primaryNetworkInterfaceDeleteOptions
public abstract DeleteOptions primaryNetworkInterfaceDeleteOptions()
Gets the delete options for the primary network interface.
Returns:
priority
public abstract VirtualMachinePriorityTypes priority()
Gets the priority for the virtual machine.
Returns:
provisioningState
public abstract String provisioningState()
Gets the provisioningState value.
Returns:
proximityPlacementGroup
public abstract ProximityPlacementGroup proximityPlacementGroup()
Get specifies information about the proximity placement group that the virtual machine scale set should be assigned to.
Returns:
redeploy
public abstract void redeploy()
Redeploys the virtual machine.
redeployAsync
public abstract Mono
Redeploys the virtual machine asynchronously.
Returns:
refreshInstanceView
public abstract VirtualMachineInstanceView refreshInstanceView()
Refreshes the virtual machine instance view to sync with Azure.
The instance view will be cached for later retrieval using instanceView
.
Returns:
refreshInstanceViewAsync
public abstract Mono
Refreshes the virtual machine instance view to sync with Azure.
Returns:
restart
public abstract void restart()
Restarts the virtual machine.
restartAsync
public abstract Mono
Restarts the virtual machine asynchronously.
Returns:
runCommand
public abstract RunCommandResult runCommand(RunCommandInput inputCommand)
Run commands in the virtual machine.
Parameters:
Returns:
runCommandAsync
public abstract Mono
Run commands in the virtual machine asynchronously.
Parameters:
Returns:
runPowerShellScript
public abstract RunCommandResult runPowerShellScript(List
Run shell script in a virtual machine.
Parameters:
Returns:
runPowerShellScriptAsync
public abstract Mono
Run shell script in the virtual machine asynchronously.
Parameters:
Returns:
runShellScript
public abstract RunCommandResult runShellScript(List
Run shell script in the virtual machine.
Parameters:
Returns:
runShellScriptAsync
public abstract Mono
Run shell script in the virtual machine asynchronously.
Parameters:
Returns:
securityType
public abstract SecurityTypes securityType()
Gets the SecurityTypes of the virtual machine.
Returns:
simulateEviction
public abstract void simulateEviction()
Simulates the eviction of spot virtual machine. The eviction will occur with 30 minutes after calling this API.
simulateEvictionAsync
public abstract Mono
Simulates the eviction of spot virtual machine asynchronously. The eviction will occur with 30 minutes after calling this API.
Returns:
size
public abstract VirtualMachineSizeTypes size()
Gets the virtual machine size.
Returns:
start
public abstract void start()
Starts the virtual machine.
startAsync
public abstract Mono
Starts the virtual machine asynchronously.
Returns:
storageProfile
public abstract StorageProfile storageProfile()
Returns the storage profile of an Azure virtual machine.
Returns:
systemAssignedManagedServiceIdentityPrincipalId
public abstract String systemAssignedManagedServiceIdentityPrincipalId()
Gets the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID assigned to the virtual machine.
Returns:
systemAssignedManagedServiceIdentityTenantId
public abstract String systemAssignedManagedServiceIdentityTenantId()
Gets System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the virtual machine.
Returns:
timeCreated
public abstract OffsetDateTime timeCreated()
Gets the time at which the Virtual Machine resource was created.
Returns:
unmanagedDataDisks
public abstract Map
Gets the unmanaged data disks associated with this virtual machine, indexed by LUN number.
Returns:
userAssignedManagedServiceIdentityIds
public abstract Set
Gets the resource ids of User Assigned Managed Service Identities associated with the virtual machine.
Returns:
userData
public abstract String userData()
Gets the base64 encoded user data for the virtual machine.
Returns:
virtualMachineScaleSetId
public abstract String virtualMachineScaleSetId()
Gets the resource ID of the virtual machine scale set associated with this virtual machine.
Returns:
vmId
public abstract String vmId()
Gets the virtual machine unique ID.
Returns: