Share via


DevBoxesClient.GetDevBoxes Method

Definition

Overloads

GetDevBoxes(String, String, RequestContext)

[Protocol Method] Lists Dev Boxes in the project for a particular user.

GetDevBoxes(String, String, CancellationToken)

Lists Dev Boxes in the project for a particular user.

GetDevBoxes(String, String, String, Nullable<Int32>, RequestContext)

[Protocol Method] Lists Dev Boxes in the project for a particular user.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.

GetDevBoxes(String, String, RequestContext)

Source:
DevBoxesClient.cs

[Protocol Method] Lists Dev Boxes in the project for a particular user.

public virtual Azure.Pageable<BinaryData> GetDevBoxes (string projectName, string userId, Azure.RequestContext context);
abstract member GetDevBoxes : string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetDevBoxes : string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetDevBoxes (projectName As String, userId As String, context As RequestContext) As Pageable(Of BinaryData)

Parameters

projectName
String

The DevCenter Project upon which to execute operations.

userId
String

The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.

context
RequestContext

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

Returns

The Pageable<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 or userId is null.

projectName or userId 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 GetDevBoxes and parse the result.

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

foreach (BinaryData item in client.GetDevBoxes("<projectName>", "<userId>", null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("poolName").ToString());
}

This sample shows how to call GetDevBoxes 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);

foreach (BinaryData item in client.GetDevBoxes("<projectName>", "<userId>", null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("projectName").ToString());
    Console.WriteLine(result.GetProperty("poolName").ToString());
    Console.WriteLine(result.GetProperty("hibernateSupport").ToString());
    Console.WriteLine(result.GetProperty("provisioningState").ToString());
    Console.WriteLine(result.GetProperty("actionState").ToString());
    Console.WriteLine(result.GetProperty("powerState").ToString());
    Console.WriteLine(result.GetProperty("uniqueId").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("location").ToString());
    Console.WriteLine(result.GetProperty("osType").ToString());
    Console.WriteLine(result.GetProperty("user").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("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("createdTime").ToString());
    Console.WriteLine(result.GetProperty("localAdministrator").ToString());
}

Applies to

GetDevBoxes(String, String, CancellationToken)

Source:
DevBoxesClient.cs

Lists Dev Boxes in the project for a particular user.

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

Parameters

projectName
String

The DevCenter Project upon which to execute operations.

userId
String

The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName or userId is null.

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

Examples

This sample shows how to call GetDevBoxes.

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

foreach (DevBox item in client.GetDevBoxes("<projectName>", "<userId>"))
{
}

This sample shows how to call GetDevBoxes with all parameters.

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

foreach (DevBox item in client.GetDevBoxes("<projectName>", "<userId>"))
{
}

Applies to

GetDevBoxes(String, String, String, Nullable<Int32>, RequestContext)

Source:
DevBoxesClient.cs

[Protocol Method] Lists Dev Boxes in the project for a particular user.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Pageable<BinaryData> GetDevBoxes (string projectName, string userId, string filter, int? maxCount, Azure.RequestContext context);
abstract member GetDevBoxes : string * string * string * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetDevBoxes : string * string * string * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetDevBoxes (projectName As String, userId As String, filter As String, maxCount As Nullable(Of Integer), context As RequestContext) As Pageable(Of BinaryData)

Parameters

projectName
String

The DevCenter Project upon which to execute operations.

userId
String

The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.

filter
String

An OData filter clause to apply to the operation.

maxCount
Nullable<Int32>

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 Pageable<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 or userId is null.

projectName or userId 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 GetDevBoxes and parse the result.

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

foreach (BinaryData item in client.GetDevBoxes("<projectName>", "<userId>", null, null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("poolName").ToString());
}

This sample shows how to call GetDevBoxes 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);

foreach (BinaryData item in client.GetDevBoxes("<projectName>", "<userId>", "<filter>", 1234, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("projectName").ToString());
    Console.WriteLine(result.GetProperty("poolName").ToString());
    Console.WriteLine(result.GetProperty("hibernateSupport").ToString());
    Console.WriteLine(result.GetProperty("provisioningState").ToString());
    Console.WriteLine(result.GetProperty("actionState").ToString());
    Console.WriteLine(result.GetProperty("powerState").ToString());
    Console.WriteLine(result.GetProperty("uniqueId").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("location").ToString());
    Console.WriteLine(result.GetProperty("osType").ToString());
    Console.WriteLine(result.GetProperty("user").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("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("createdTime").ToString());
    Console.WriteLine(result.GetProperty("localAdministrator").ToString());
}

Applies to