Share via


VirtualMachineCollection Class

Definition

A class representing a collection of VirtualMachineResource and their operations. Each VirtualMachineResource in the collection will belong to the same instance of ResourceGroupResource. To get a VirtualMachineCollection instance call the GetVirtualMachines method from an instance of ResourceGroupResource.

public class VirtualMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable<Azure.ResourceManager.Compute.VirtualMachineResource>, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Compute.VirtualMachineResource>
type VirtualMachineCollection = class
    inherit ArmCollection
    interface seq<VirtualMachineResource>
    interface IEnumerable
    interface IAsyncEnumerable<VirtualMachineResource>
Public Class VirtualMachineCollection
Inherits ArmCollection
Implements IAsyncEnumerable(Of VirtualMachineResource), IEnumerable(Of VirtualMachineResource)
Inheritance
VirtualMachineCollection
Implements

Constructors

VirtualMachineCollection()

Initializes a new instance of the VirtualMachineCollection class for mocking.

Properties

Client

Gets the ArmClient this resource client was created from.

(Inherited from ArmCollection)
Diagnostics

Gets the diagnostic options for this resource client.

(Inherited from ArmCollection)
Endpoint

Gets the base uri for this resource client.

(Inherited from ArmCollection)
Id

Gets the resource identifier.

(Inherited from ArmCollection)
Pipeline

Gets the pipeline for this resource client.

(Inherited from ArmCollection)

Methods

CreateOrUpdate(WaitUntil, String, VirtualMachineData, String, String, CancellationToken)

The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • Operation Id: VirtualMachines_CreateOrUpdate
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
CreateOrUpdateAsync(WaitUntil, String, VirtualMachineData, String, String, CancellationToken)

The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • Operation Id: VirtualMachines_CreateOrUpdate
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
Exists(String, Nullable<InstanceViewType>, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • Operation Id: VirtualMachines_Get
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
ExistsAsync(String, Nullable<InstanceViewType>, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • Operation Id: VirtualMachines_Get
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
Get(String, Nullable<InstanceViewType>, CancellationToken)

Retrieves information about the model view or the instance view of a virtual machine.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • Operation Id: VirtualMachines_Get
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
GetAll(String, Nullable<GetVirtualMachineExpandType>, CancellationToken)

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.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines
  • Operation Id: VirtualMachines_List
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
GetAllAsync(String, Nullable<GetVirtualMachineExpandType>, CancellationToken)

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.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines
  • Operation Id: VirtualMachines_List
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
GetAsync(String, Nullable<InstanceViewType>, CancellationToken)

Retrieves information about the model view or the instance view of a virtual machine.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • Operation Id: VirtualMachines_Get
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
GetIfExists(String, Nullable<InstanceViewType>, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • Operation Id: VirtualMachines_Get
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
GetIfExistsAsync(String, Nullable<InstanceViewType>, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
  • Operation Id: VirtualMachines_Get
  • Default Api Version: 2024-03-01
  • Resource: VirtualMachineResource
TryGetApiVersion(ResourceType, String)

Gets the api version override if it has been set for the current client options.

(Inherited from ArmCollection)

Explicit Interface Implementations

IAsyncEnumerable<VirtualMachineResource>.GetAsyncEnumerator(CancellationToken)

Returns an enumerator that iterates asynchronously through the collection.

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerable<VirtualMachineResource>.GetEnumerator()

Returns an enumerator that iterates through the collection.

Applies to