pub struct ComputeClient<'a> { /* private fields */ }Expand description
Client for the Azure Compute API.
Wraps the raw ComputeOps with ergonomic signatures that
auto-inject subscription_id from the parent AzureHttpClient.
Implementations§
Source§impl<'a> ComputeClient<'a>
impl<'a> ComputeClient<'a>
Sourcepub async fn list_vms(
&self,
resource_group_name: &str,
) -> Result<VirtualMachineListResult>
pub async fn list_vms( &self, resource_group_name: &str, ) -> Result<VirtualMachineListResult>
List virtual machines in a resource group.
Sourcepub async fn get_vm(
&self,
resource_group_name: &str,
vm_name: &str,
) -> Result<VirtualMachine>
pub async fn get_vm( &self, resource_group_name: &str, vm_name: &str, ) -> Result<VirtualMachine>
Get a virtual machine.
Sourcepub async fn get_vm_expanded(
&self,
resource_group_name: &str,
vm_name: &str,
expand: &str,
) -> Result<VirtualMachine>
pub async fn get_vm_expanded( &self, resource_group_name: &str, vm_name: &str, expand: &str, ) -> Result<VirtualMachine>
Get a virtual machine with expanded properties.
Sourcepub async fn create_vm(
&self,
resource_group_name: &str,
vm_name: &str,
body: &VirtualMachineCreateRequest,
) -> Result<VirtualMachine>
pub async fn create_vm( &self, resource_group_name: &str, vm_name: &str, body: &VirtualMachineCreateRequest, ) -> Result<VirtualMachine>
Create or update a virtual machine.
Sourcepub async fn delete_vm(
&self,
resource_group_name: &str,
vm_name: &str,
) -> Result<()>
pub async fn delete_vm( &self, resource_group_name: &str, vm_name: &str, ) -> Result<()>
Delete a virtual machine.
Sourcepub async fn start_vm(
&self,
resource_group_name: &str,
vm_name: &str,
) -> Result<()>
pub async fn start_vm( &self, resource_group_name: &str, vm_name: &str, ) -> Result<()>
Start a virtual machine.
Sourcepub async fn stop_vm(
&self,
resource_group_name: &str,
vm_name: &str,
) -> Result<()>
pub async fn stop_vm( &self, resource_group_name: &str, vm_name: &str, ) -> Result<()>
Power off (stop) a virtual machine. The VM continues to be billed.
Sourcepub async fn deallocate_vm(
&self,
resource_group_name: &str,
vm_name: &str,
) -> Result<()>
pub async fn deallocate_vm( &self, resource_group_name: &str, vm_name: &str, ) -> Result<()>
Deallocate a virtual machine. Stops billing.
Sourcepub async fn restart_vm(
&self,
resource_group_name: &str,
vm_name: &str,
) -> Result<()>
pub async fn restart_vm( &self, resource_group_name: &str, vm_name: &str, ) -> Result<()>
Restart a virtual machine.
Sourcepub async fn get_instance_view(
&self,
resource_group_name: &str,
vm_name: &str,
) -> Result<VirtualMachineInstanceViewResult>
pub async fn get_instance_view( &self, resource_group_name: &str, vm_name: &str, ) -> Result<VirtualMachineInstanceViewResult>
Get the instance view of a virtual machine.
Sourcepub async fn list_vmss(
&self,
resource_group_name: &str,
) -> Result<VirtualMachineScaleSetListResult>
pub async fn list_vmss( &self, resource_group_name: &str, ) -> Result<VirtualMachineScaleSetListResult>
List virtual machine scale sets in a resource group.
Sourcepub async fn get_vmss(
&self,
resource_group_name: &str,
vmss_name: &str,
) -> Result<VirtualMachineScaleSet>
pub async fn get_vmss( &self, resource_group_name: &str, vmss_name: &str, ) -> Result<VirtualMachineScaleSet>
Get a virtual machine scale set.
Sourcepub async fn create_vmss(
&self,
resource_group_name: &str,
vmss_name: &str,
body: &VirtualMachineScaleSetCreateRequest,
) -> Result<VirtualMachineScaleSet>
pub async fn create_vmss( &self, resource_group_name: &str, vmss_name: &str, body: &VirtualMachineScaleSetCreateRequest, ) -> Result<VirtualMachineScaleSet>
Create or update a virtual machine scale set.
Sourcepub async fn delete_vmss(
&self,
resource_group_name: &str,
vmss_name: &str,
) -> Result<()>
pub async fn delete_vmss( &self, resource_group_name: &str, vmss_name: &str, ) -> Result<()>
Delete a virtual machine scale set.
Sourcepub async fn list_vmss_instances(
&self,
resource_group_name: &str,
vmss_name: &str,
) -> Result<VirtualMachineScaleSetVMListResult>
pub async fn list_vmss_instances( &self, resource_group_name: &str, vmss_name: &str, ) -> Result<VirtualMachineScaleSetVMListResult>
List virtual machines in a VM scale set.
Sourcepub async fn start_vmss_instances(
&self,
resource_group_name: &str,
vmss_name: &str,
instance_ids: &VirtualMachineScaleSetVMInstanceIDs,
) -> Result<()>
pub async fn start_vmss_instances( &self, resource_group_name: &str, vmss_name: &str, instance_ids: &VirtualMachineScaleSetVMInstanceIDs, ) -> Result<()>
Start one or more virtual machines in a VM scale set.
Sourcepub async fn stop_vmss_instances(
&self,
resource_group_name: &str,
vmss_name: &str,
instance_ids: &VirtualMachineScaleSetVMInstanceIDs,
) -> Result<()>
pub async fn stop_vmss_instances( &self, resource_group_name: &str, vmss_name: &str, instance_ids: &VirtualMachineScaleSetVMInstanceIDs, ) -> Result<()>
Power off one or more virtual machines in a VM scale set.
Sourcepub async fn list_disks(
&self,
resource_group_name: &str,
) -> Result<DiskListResult>
pub async fn list_disks( &self, resource_group_name: &str, ) -> Result<DiskListResult>
List all managed disks in a resource group.
Sourcepub async fn list_disks_in_subscription(&self) -> Result<DiskListResult>
pub async fn list_disks_in_subscription(&self) -> Result<DiskListResult>
List all managed disks in the subscription.
Sourcepub async fn get_disk(
&self,
resource_group_name: &str,
disk_name: &str,
) -> Result<Disk>
pub async fn get_disk( &self, resource_group_name: &str, disk_name: &str, ) -> Result<Disk>
Get information about a managed disk.
Sourcepub async fn create_disk(
&self,
resource_group_name: &str,
disk_name: &str,
body: &DiskCreateRequest,
) -> Result<Disk>
pub async fn create_disk( &self, resource_group_name: &str, disk_name: &str, body: &DiskCreateRequest, ) -> Result<Disk>
Create or update a managed disk.
Sourcepub async fn delete_disk(
&self,
resource_group_name: &str,
disk_name: &str,
) -> Result<()>
pub async fn delete_disk( &self, resource_group_name: &str, disk_name: &str, ) -> Result<()>
Delete a managed disk.
Sourcepub async fn update_disk_sku(
&self,
resource_group_name: &str,
disk_name: &str,
sku_name: &str,
) -> Result<Disk>
pub async fn update_disk_sku( &self, resource_group_name: &str, disk_name: &str, sku_name: &str, ) -> Result<Disk>
Change the SKU (performance tier) of a managed disk.
The disk must be unattached OR the attached VM must be fully deallocated before this call will succeed. Returns an error if the VM is still running.
§Arguments
resource_group_name- Resource group containing the diskdisk_name- Name of the disk to updatesku_name- Target SKU name: “StandardSSD_LRS”, “StandardSSD_ZRS”, “Standard_LRS”, “Premium_LRS”, “Premium_ZRS”
Sourcepub async fn delete_snapshot(
&self,
subscription_id: &str,
resource_group_name: &str,
snapshot_name: &str,
) -> Result<()>
pub async fn delete_snapshot( &self, subscription_id: &str, resource_group_name: &str, snapshot_name: &str, ) -> Result<()>
Delete a managed disk snapshot.
Sourcepub async fn grant_access(
&self,
resource_group_name: &str,
disk_name: &str,
body: &GrantAccessData,
) -> Result<AccessUri>
pub async fn grant_access( &self, resource_group_name: &str, disk_name: &str, body: &GrantAccessData, ) -> Result<AccessUri>
Grant SAS access to a managed disk.
The Azure beginGetAccess endpoint returns HTTP 202 with a Location header
pointing to an async operation URL. This method polls that URL until the
operation completes and returns the SAS URI.