你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
VirtualMachine Interface
public interface VirtualMachine extends GroupableResource<ComputeManager, VirtualMachineInner>,Refreshable,Updatable<VirtualMachine.Update>,HasNetworkInterfaces
An immutable client-side representation of an Azure virtual machine.
Method Summary
Modifier and Type | Method and Description |
---|---|
String | availabilitySetId() |
Set<Availability |
availabilityZones() |
PagedList<Virtual |
availableSizes()
Lists all available virtual machine sizes this virtual machine can resized to. |
String | bootDiagnosticsStorageUri() |
String |
capture(String containerName, String vhdPrefix, boolean overwriteVhd)
Captures the virtual machine by copying virtual hard disks of the VM. |
Observable<String> |
captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd)
Captures the virtual machine by copying virtual hard disks of the VM asynchronously. |
ServiceFuture<String> |
captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd, ServiceCallback<String> callback)
Captures the virtual machine by copying virtual hard disks of the VM asynchronously. |
String | computerName() |
void |
convertToManaged()
Converts (migrates) the virtual machine with un-managed disks to use managed disk. |
Completable |
convertToManagedAsync()
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously. |
ServiceFuture<Void> |
convertToManagedAsync(ServiceCallback<Void> callback)
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously. |
Map<Integer, Virtual |
dataDisks() |
void |
deallocate()
Shuts down the virtual machine and releases the compute resources. |
Completable |
deallocateAsync()
Shuts down the virtual machine and releases the compute resources asynchronously. |
ServiceFuture<Void> |
deallocateAsync(ServiceCallback<Void> callback)
Shuts down the virtual machine and releases the compute resources asynchronously. |
Diagnostics |
diagnosticsProfile() |
Virtual |
diskEncryption() |
void |
generalize()
Generalizes the virtual machine. |
Completable |
generalizeAsync()
Generalizes the virtual machine asynchronously. |
ServiceFuture<Void> |
generalizeAsync(ServiceCallback<Void> callback)
Generalizes the virtual machine asynchronously. |
Public |
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. |
String | getPrimaryPublicIPAddressId() |
Virtual |
instanceView()
Get the virtual machine instance view. The instance view will be cached for later retrieval using . |
boolean | isBootDiagnosticsEnabled() |
boolean | isManagedDiskEnabled() |
boolean | isManagedServiceIdentityEnabled() |
String | licenseType() |
Map<String, Virtual |
listExtensions() |
Observable<Virtual |
listExtensionsAsync() |
String | managedServiceIdentityPrincipalId() |
String | managedServiceIdentityTenantId() |
Caching |
osDiskCachingType() |
String | osDiskId() |
int | osDiskSize() |
Storage |
osDiskStorageAccountType() |
OSProfile | osProfile() |
Operating |
osType() |
String | osUnmanagedDiskVhdUri() |
Plan | plan() |
void |
powerOff()
Powers off (stops) the virtual machine. |
Completable |
powerOffAsync()
Powers off (stops) the virtual machine asynchronously. |
ServiceFuture<Void> |
powerOffAsync(ServiceCallback<Void> callback)
Powers off (stop) the virtual machine asynchronously. |
Power |
powerState() |
String | provisioningState() |
void |
redeploy()
Redeploys the virtual machine. |
Completable |
redeployAsync()
Redeploys the virtual machine asynchronously. |
ServiceFuture<Void> |
redeployAsync(ServiceCallback<Void> callback)
Redeploys the virtual machine asynchronously. |
Virtual |
refreshInstanceView()
Refreshes the virtual machine instance view to sync with Azure. The instance view will be cached for later retrieval using . |
Observable<Virtual |
refreshInstanceViewAsync()
Refreshes the virtual machine instance view to sync with Azure. |
void |
restart()
Restarts the virtual machine. |
Completable |
restartAsync()
Restarts the virtual machine asynchronously. |
ServiceFuture<Void> |
restartAsync(ServiceCallback<Void> callback)
Restarts the virtual machine asynchronously. |
Virtual |
size() |
void |
start()
Starts the virtual machine. |
Completable |
startAsync()
Starts the virtual machine asynchronously. |
ServiceFuture<Void> |
startAsync(ServiceCallback<Void> callback)
Starts the virtual machine asynchronously. |
Storage |
storageProfile()
Returns the storage profile of an Azure virtual machine. |
Map<Integer, Virtual |
unmanagedDataDisks() |
String | vmId() |
Inherited Members
Method Details
availabilitySetId
public String availabilitySetId()
Returns:
availabilityZones
public Set
Returns:
availableSizes
public PagedList
Lists all available virtual machine sizes this virtual machine can resized to.
Returns:
bootDiagnosticsStorageUri
public String bootDiagnosticsStorageUri()
Returns:
capture
public String capture(String containerName, String vhdPrefix, boolean overwriteVhd)
Captures the virtual machine by copying virtual hard disks of the VM.
Parameters:
Returns:
captureAsync
public Observable
Captures the virtual machine by copying virtual hard disks of the VM asynchronously.
Parameters:
Returns:
captureAsync
public ServiceFuture
Captures the virtual machine by copying virtual hard disks of the VM asynchronously.
Parameters:
Returns:
computerName
public String computerName()
Returns:
convertToManaged
public void convertToManaged()
Converts (migrates) the virtual machine with un-managed disks to use managed disk.
convertToManagedAsync
public Completable convertToManagedAsync()
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.
Returns:
convertToManagedAsync
public ServiceFuture
Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.
Parameters:
Returns:
dataDisks
public Map
Returns:
deallocate
public void deallocate()
Shuts down the virtual machine and releases the compute resources.
deallocateAsync
public Completable deallocateAsync()
Shuts down the virtual machine and releases the compute resources asynchronously.
Returns:
deallocateAsync
public ServiceFuture
Shuts down the virtual machine and releases the compute resources asynchronously.
Parameters:
Returns:
diagnosticsProfile
public DiagnosticsProfile diagnosticsProfile()
Returns:
diskEncryption
public VirtualMachineEncryption diskEncryption()
Returns:
generalize
public void generalize()
Generalizes the virtual machine.
generalizeAsync
public Completable generalizeAsync()
Generalizes the virtual machine asynchronously.
Returns:
generalizeAsync
public ServiceFuture
Generalizes the virtual machine asynchronously.
Parameters:
Returns:
getPrimaryPublicIPAddress
public 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 String getPrimaryPublicIPAddressId()
Returns:
instanceView
public VirtualMachineInstanceView instanceView()
Get the virtual machine instance view.
The instance view will be cached for later retrieval using .
Returns:
isBootDiagnosticsEnabled
public boolean isBootDiagnosticsEnabled()
Returns:
isManagedDiskEnabled
public boolean isManagedDiskEnabled()
Returns:
isManagedServiceIdentityEnabled
public boolean isManagedServiceIdentityEnabled()
Returns:
licenseType
public String licenseType()
Returns:
listExtensions
public Map
Returns:
listExtensionsAsync
public Observable
Returns:
managedServiceIdentityPrincipalId
public String managedServiceIdentityPrincipalId()
Returns:
managedServiceIdentityTenantId
public String managedServiceIdentityTenantId()
Returns:
osDiskCachingType
public CachingTypes osDiskCachingType()
Returns:
osDiskId
public String osDiskId()
Returns:
osDiskSize
public int osDiskSize()
Returns:
osDiskStorageAccountType
public StorageAccountTypes osDiskStorageAccountType()
Returns:
osProfile
public OSProfile osProfile()
Returns:
osType
public OperatingSystemTypes osType()
Returns:
osUnmanagedDiskVhdUri
public String osUnmanagedDiskVhdUri()
Returns:
plan
public Plan plan()
Returns:
powerOff
public void powerOff()
Powers off (stops) the virtual machine.
powerOffAsync
public Completable powerOffAsync()
Powers off (stops) the virtual machine asynchronously.
Returns:
powerOffAsync
public ServiceFuture
Powers off (stop) the virtual machine asynchronously.
Parameters:
Returns:
powerState
public PowerState powerState()
Returns:
provisioningState
public String provisioningState()
Returns:
redeploy
public void redeploy()
Redeploys the virtual machine.
redeployAsync
public Completable redeployAsync()
Redeploys the virtual machine asynchronously.
Returns:
redeployAsync
public ServiceFuture
Redeploys the virtual machine asynchronously.
Parameters:
Returns:
refreshInstanceView
public VirtualMachineInstanceView refreshInstanceView()
Refreshes the virtual machine instance view to sync with Azure.
The instance view will be cached for later retrieval using .
Returns:
refreshInstanceViewAsync
public Observable
Refreshes the virtual machine instance view to sync with Azure.
Returns:
restart
public void restart()
Restarts the virtual machine.
restartAsync
public Completable restartAsync()
Restarts the virtual machine asynchronously.
Returns:
restartAsync
public ServiceFuture
Restarts the virtual machine asynchronously.
Parameters:
Returns:
size
public VirtualMachineSizeTypes size()
Returns:
start
public void start()
Starts the virtual machine.
startAsync
public Completable startAsync()
Starts the virtual machine asynchronously.
Returns:
startAsync
public ServiceFuture
Starts the virtual machine asynchronously.
Parameters:
Returns:
storageProfile
public StorageProfile storageProfile()
Returns the storage profile of an Azure virtual machine.
Returns:
unmanagedDataDisks
public Map
Returns:
vmId
public String vmId()
Returns: