VirtualMachinesOperations Class
VirtualMachinesOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.
- Inheritance
-
builtins.objectVirtualMachinesOperations
Constructor
VirtualMachinesOperations(client, config, serializer, deserializer)
Parameters
- client
Client for service requests.
- config
Configuration of service client.
- serializer
An object model serializer.
- deserializer
An object model deserializer.
Variables
- models
Alias to model classes used in this operation group.
Methods
| begin_capture |
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. |
| begin_convert_to_managed_disks |
Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. |
| begin_create_or_update |
The operation to create or update a virtual machine. |
| begin_deallocate |
Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. |
| begin_delete |
The operation to delete a virtual machine. |
| begin_power_off |
The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. |
| begin_redeploy |
Shuts down the virtual machine, moves it to a new node, and powers it back on. |
| begin_restart |
The operation to restart a virtual machine. |
| begin_start |
The operation to start a virtual machine. |
| generalize |
Sets the state of the virtual machine to generalized. |
| get |
Retrieves information about the model view or the instance view of a virtual machine. |
| get_extensions |
The operation to get all extensions of a Virtual Machine. |
| list |
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. |
| list_all |
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. |
| list_available_sizes |
Lists all available virtual machine sizes to which the specified virtual machine can be resized. |
begin_capture
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
async begin_capture(resource_group_name: str, vm_name: str, parameters: azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachineCaptureParameters, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachineCaptureResult]
Parameters
- parameters
- VirtualMachineCaptureParameters
Parameters supplied to the Capture Virtual Machine operation.
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either VirtualMachineCaptureResult or the result of cls(response)
Return type
Exceptions
begin_convert_to_managed_disks
Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation.
async begin_convert_to_managed_disks(resource_group_name: str, vm_name: str, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.OperationStatusResponse]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_create_or_update
The operation to create or update a virtual machine.
async begin_create_or_update(resource_group_name: str, vm_name: str, parameters: azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachine, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachine]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response)
Return type
Exceptions
begin_deallocate
Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses.
async begin_deallocate(resource_group_name: str, vm_name: str, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.OperationStatusResponse]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_delete
The operation to delete a virtual machine.
async begin_delete(resource_group_name: str, vm_name: str, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.OperationStatusResponse]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_power_off
The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine.
async begin_power_off(resource_group_name: str, vm_name: str, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.OperationStatusResponse]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_redeploy
Shuts down the virtual machine, moves it to a new node, and powers it back on.
async begin_redeploy(resource_group_name: str, vm_name: str, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.OperationStatusResponse]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_restart
The operation to restart a virtual machine.
async begin_restart(resource_group_name: str, vm_name: str, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.OperationStatusResponse]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_start
The operation to start a virtual machine.
async begin_start(resource_group_name: str, vm_name: str, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.OperationStatusResponse]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
- continuation_token
- str
A continuation token to restart a poller from a saved state.
- polling
- bool or AsyncPollingMethod
By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
- polling_interval
- int
Default waiting time between two polls for LRO operations if no Retry-After header is present.
Returns
An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
generalize
Sets the state of the virtual machine to generalized.
async generalize(resource_group_name: str, vm_name: str, **kwargs: Any) -> azure.mgmt.compute.v2016_04_30_preview.models._models_py3.OperationStatusResponse
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
Returns
OperationStatusResponse, or the result of cls(response)
Return type
Exceptions
get
Retrieves information about the model view or the instance view of a virtual machine.
async get(resource_group_name: str, vm_name: str, expand: Optional[str] = 'instanceView', **kwargs: Any) -> azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachine
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
Returns
VirtualMachine, or the result of cls(response)
Return type
Exceptions
get_extensions
The operation to get all extensions of a Virtual Machine.
async get_extensions(resource_group_name: str, vm_name: str, expand: Optional[str] = None, **kwargs: Any) -> azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachineExtensionsListResult
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
Returns
VirtualMachineExtensionsListResult, or the result of cls(response)
Return type
Exceptions
list
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
list(resource_group_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachineListResult]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
Returns
An iterator like instance of either VirtualMachineListResult or the result of cls(response)
Return type
Exceptions
list_all
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
list_all(**kwargs: Any) -> AsyncIterable[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachineListResult]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
Returns
An iterator like instance of either VirtualMachineListResult or the result of cls(response)
Return type
Exceptions
list_available_sizes
Lists all available virtual machine sizes to which the specified virtual machine can be resized.
list_available_sizes(resource_group_name: str, vm_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.compute.v2016_04_30_preview.models._models_py3.VirtualMachineSizeListResult]
Parameters
- cls
- callable
A custom type or function that will be passed the direct response
Returns
An iterator like instance of either VirtualMachineSizeListResult or the result of cls(response)
Return type
Exceptions
Attributes
models
models = <module 'azure.mgmt.compute.v2016_04_30_preview.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\compute\\v2016_04_30_preview\\models\\__init__.py'>
Feedback
Submit and view feedback for