DevBoxesClient.GetPoolsAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetPoolsAsync(String, RequestContext) |
[Protocol Method] Lists available pools
|
GetPoolsAsync(String, CancellationToken) |
Lists available pools. |
GetPoolsAsync(String, String, Nullable<Int32>, RequestContext) |
[Protocol Method] Lists available pools
|
GetPoolsAsync(String, RequestContext)
- Source:
- DevBoxesClient.cs
[Protocol Method] Lists available pools
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetPoolsAsync(String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.AsyncPageable<BinaryData> GetPoolsAsync (string projectName, Azure.RequestContext context);
abstract member GetPoolsAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetPoolsAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetPoolsAsync (projectName As String, context As RequestContext) As AsyncPageable(Of BinaryData)
Parameters
- projectName
- String
Name of the project.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.
Exceptions
projectName
is null.
projectName
is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Examples
This sample shows how to call GetPoolsAsync and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);
await foreach (BinaryData item in client.GetPoolsAsync("<projectName>", null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("location").ToString());
Console.WriteLine(result.GetProperty("healthStatus").ToString());
}
This sample shows how to call GetPoolsAsync with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);
await foreach (BinaryData item in client.GetPoolsAsync("<projectName>", null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("location").ToString());
Console.WriteLine(result.GetProperty("osType").ToString());
Console.WriteLine(result.GetProperty("hardwareProfile").GetProperty("skuName").ToString());
Console.WriteLine(result.GetProperty("hardwareProfile").GetProperty("vCPUs").ToString());
Console.WriteLine(result.GetProperty("hardwareProfile").GetProperty("memoryGB").ToString());
Console.WriteLine(result.GetProperty("hibernateSupport").ToString());
Console.WriteLine(result.GetProperty("storageProfile").GetProperty("osDisk").GetProperty("diskSizeGB").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("version").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("operatingSystem").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("osBuildNumber").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("publishedDate").ToString());
Console.WriteLine(result.GetProperty("localAdministrator").ToString());
Console.WriteLine(result.GetProperty("stopOnDisconnect").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("stopOnDisconnect").GetProperty("gracePeriodMinutes").ToString());
Console.WriteLine(result.GetProperty("healthStatus").ToString());
}
Applies to
GetPoolsAsync(String, CancellationToken)
- Source:
- DevBoxesClient.cs
Lists available pools.
public virtual Azure.AsyncPageable<Azure.Developer.DevCenter.Models.DevBoxPool> GetPoolsAsync (string projectName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetPoolsAsync : string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Developer.DevCenter.Models.DevBoxPool>
override this.GetPoolsAsync : string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Developer.DevCenter.Models.DevBoxPool>
Public Overridable Function GetPoolsAsync (projectName As String, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of DevBoxPool)
Parameters
- projectName
- String
Name of the project.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
projectName
is null.
projectName
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call GetPoolsAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);
await foreach (DevBoxPool item in client.GetPoolsAsync("<projectName>"))
{
}
This sample shows how to call GetPoolsAsync with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);
await foreach (DevBoxPool item in client.GetPoolsAsync("<projectName>"))
{
}
Applies to
GetPoolsAsync(String, String, Nullable<Int32>, RequestContext)
- Source:
- DevBoxesClient.cs
[Protocol Method] Lists available pools
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.AsyncPageable<BinaryData> GetPoolsAsync (string projectName, string filter, int? maxCount, Azure.RequestContext context);
abstract member GetPoolsAsync : string * string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetPoolsAsync : string * string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetPoolsAsync (projectName As String, filter As String, maxCount As Nullable(Of Integer), context As RequestContext) As AsyncPageable(Of BinaryData)
Parameters
- projectName
- String
The DevCenter Project upon which to execute operations.
- filter
- String
An OData filter clause to apply to the operation.
The maximum number of resources to return from the operation. Example: 'top=10'.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.
Exceptions
projectName
is null.
projectName
is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Examples
This sample shows how to call GetPoolsAsync and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);
await foreach (BinaryData item in client.GetPoolsAsync("<projectName>", null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("location").ToString());
Console.WriteLine(result.GetProperty("healthStatus").ToString());
}
This sample shows how to call GetPoolsAsync with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);
await foreach (BinaryData item in client.GetPoolsAsync("<projectName>", "<filter>", 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("location").ToString());
Console.WriteLine(result.GetProperty("osType").ToString());
Console.WriteLine(result.GetProperty("hardwareProfile").GetProperty("skuName").ToString());
Console.WriteLine(result.GetProperty("hardwareProfile").GetProperty("vCPUs").ToString());
Console.WriteLine(result.GetProperty("hardwareProfile").GetProperty("memoryGB").ToString());
Console.WriteLine(result.GetProperty("hibernateSupport").ToString());
Console.WriteLine(result.GetProperty("storageProfile").GetProperty("osDisk").GetProperty("diskSizeGB").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("version").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("operatingSystem").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("osBuildNumber").ToString());
Console.WriteLine(result.GetProperty("imageReference").GetProperty("publishedDate").ToString());
Console.WriteLine(result.GetProperty("localAdministrator").ToString());
Console.WriteLine(result.GetProperty("stopOnDisconnect").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("stopOnDisconnect").GetProperty("gracePeriodMinutes").ToString());
Console.WriteLine(result.GetProperty("healthStatus").ToString());
}
Applies to
Azure SDK for .NET