次の方法で共有


DevBoxesClient.GetPool Method

Definition

Overloads

GetPool(String, String, RequestContext)

[Protocol Method] Gets a pool

GetPool(String, String, CancellationToken)

Gets a pool.

GetPool(String, String, RequestContext)

Source:
DevBoxesClient.cs
Source:
DevBoxesClient.cs

[Protocol Method] Gets a pool

public virtual Azure.Response GetPool (string projectName, string poolName, Azure.RequestContext context);
abstract member GetPool : string * string * Azure.RequestContext -> Azure.Response
override this.GetPool : string * string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetPool (projectName As String, poolName As String, context As RequestContext) As Response

Parameters

projectName
String

Name of the project.

poolName
String

Pool name.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

projectName or poolName is null.

projectName or poolName 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 GetPool and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);

Response response = client.GetPool("<projectName>", "<poolName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).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 GetPool 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);

Response response = client.GetPool("<projectName>", "<poolName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).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

GetPool(String, String, CancellationToken)

Source:
DevBoxesClient.cs

Gets a pool.

public virtual Azure.Response<Azure.Developer.DevCenter.Models.DevBoxPool> GetPool (string projectName, string poolName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetPool : string * string * System.Threading.CancellationToken -> Azure.Response<Azure.Developer.DevCenter.Models.DevBoxPool>
override this.GetPool : string * string * System.Threading.CancellationToken -> Azure.Response<Azure.Developer.DevCenter.Models.DevBoxPool>
Public Overridable Function GetPool (projectName As String, poolName As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of DevBoxPool)

Parameters

projectName
String

Name of the project.

poolName
String

Pool name.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName or poolName is null.

projectName or poolName is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetPool.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);

Response<DevBoxPool> response = client.GetPool("<projectName>", "<poolName>");

This sample shows how to call GetPool with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);

Response<DevBoxPool> response = client.GetPool("<projectName>", "<poolName>");

Applies to