次の方法で共有


ComputeExtensions.GetVirtualMachinesAsync メソッド

定義

指定したサブスクリプション内のすべての仮想マシンを一覧表示します。 応答で nextLink プロパティを使用して、仮想マシンの次のページを取得します。

  • 要求パス/サブスクリプション/{subscriptionId}/providers/Microsoft.Compute/virtualMachines
  • 操作IdVirtualMachines_ListAll
public static Azure.AsyncPageable<Azure.ResourceManager.Compute.VirtualMachineResource> GetVirtualMachinesAsync (this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string statusOnly = default, string filter = default, Azure.ResourceManager.Compute.Models.ExpandTypesForListVm? expand = default, System.Threading.CancellationToken cancellationToken = default);
static member GetVirtualMachinesAsync : Azure.ResourceManager.Resources.SubscriptionResource * string * string * Nullable<Azure.ResourceManager.Compute.Models.ExpandTypesForListVm> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.ResourceManager.Compute.VirtualMachineResource>
<Extension()>
Public Function GetVirtualMachinesAsync (subscriptionResource As SubscriptionResource, Optional statusOnly As String = Nothing, Optional filter As String = Nothing, Optional expand As Nullable(Of ExpandTypesForListVm) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of VirtualMachineResource)

パラメーター

subscriptionResource
SubscriptionResource

SubscriptionResourceメソッドが実行するインスタンス。

statusOnly
String

statusOnly=true を指定すると、サブスクリプション内のすべてのVirtual Machinesの実行時の状態をフェッチできます。

filter
String

応答で返された VM をフィルター処理するためのシステム クエリ オプション。 使用できる値は、'virtualMachineScaleSet/id' eq /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' です。

expand
Nullable<ExpandTypesForListVm>

操作に適用する展開式。 'instanceView' では、すべてのVirtual Machinesの実行時の状態をフェッチできます。有効な$filter オプションが指定されている場合にのみ指定できます。

cancellationToken
CancellationToken

使用する取り消しトークン。

戻り値

反復処理するために複数の VirtualMachineResource サービス要求を受け取る可能性がある の非同期コレクション。

適用対象