VirtualMachinesOperations Class
VirtualMachinesOperations 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_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. |
| 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.
begin_capture(resource_group_name: str, vm_name: str, parameters: _models.VirtualMachineCaptureParameters, **kwargs: Any) -> LROPoller[_models.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 PollingMethod
By default, your polling method will be ARMPolling. 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 LROPoller that returns either VirtualMachineCaptureResult or the result of cls(response)
Return type
Exceptions
begin_create_or_update
The operation to create or update a virtual machine.
begin_create_or_update(resource_group_name: str, vm_name: str, parameters: _models.VirtualMachine, **kwargs: Any) -> LROPoller[_models.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 PollingMethod
By default, your polling method will be ARMPolling. 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 LROPoller 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.
begin_deallocate(resource_group_name: str, vm_name: str, **kwargs: Any) -> LROPoller[_models.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 PollingMethod
By default, your polling method will be ARMPolling. 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 LROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_delete
The operation to delete a virtual machine.
begin_delete(resource_group_name: str, vm_name: str, **kwargs: Any) -> LROPoller[_models.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 PollingMethod
By default, your polling method will be ARMPolling. 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 LROPoller 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.
begin_power_off(resource_group_name: str, vm_name: str, **kwargs: Any) -> LROPoller[_models.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 PollingMethod
By default, your polling method will be ARMPolling. 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 LROPoller 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.
begin_redeploy(resource_group_name: str, vm_name: str, **kwargs: Any) -> LROPoller[_models.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 PollingMethod
By default, your polling method will be ARMPolling. 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 LROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_restart
The operation to restart a virtual machine.
begin_restart(resource_group_name: str, vm_name: str, **kwargs: Any) -> LROPoller[_models.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 PollingMethod
By default, your polling method will be ARMPolling. 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 LROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
begin_start
The operation to start a virtual machine.
begin_start(resource_group_name: str, vm_name: str, **kwargs: Any) -> LROPoller[_models.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 PollingMethod
By default, your polling method will be ARMPolling. 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 LROPoller that returns either OperationStatusResponse or the result of cls(response)
Return type
Exceptions
generalize
Sets the state of the virtual machine to generalized.
generalize(resource_group_name: str, vm_name: str, **kwargs: Any) -> _models.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.
get(resource_group_name: str, vm_name: str, expand: Optional[str] = 'instanceView', **kwargs: Any) -> _models.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
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) -> Iterable[_models.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) -> Iterable[_models.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) -> Iterable[_models.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.v2015_06_15.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\compute\\v2015_06_15\\models\\__init__.py'>
Feedback
Submit and view feedback for