Partager via


DevBoxesClient.GetDevBoxActionsAsync Method

Definition

Overloads

GetDevBoxActionsAsync(String, String, String, CancellationToken)

Lists actions on a Dev Box.

GetDevBoxActionsAsync(String, String, String, RequestContext)

[Protocol Method] Lists actions on a Dev Box.

GetDevBoxActionsAsync(String, String, String, CancellationToken)

Source:
DevBoxesClient.cs

Lists actions on a Dev Box.

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

Parameters

projectName
String

Name of the project.

userId
String

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

devBoxName
String

Display name for the Dev Box.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName, userId or devBoxName is null.

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

Examples

This sample shows how to call GetDevBoxActionsAsync.

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

await foreach (DevBoxAction item in client.GetDevBoxActionsAsync("<projectName>", "<userId>", "<devBoxName>"))
{
}

This sample shows how to call GetDevBoxActionsAsync with all parameters.

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

await foreach (DevBoxAction item in client.GetDevBoxActionsAsync("<projectName>", "<userId>", "<devBoxName>"))
{
}

Applies to

GetDevBoxActionsAsync(String, String, String, RequestContext)

Source:
DevBoxesClient.cs
Source:
DevBoxesClient.cs

[Protocol Method] Lists actions on a Dev Box.

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

Parameters

projectName
String

Name of the project.

userId
String

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

devBoxName
String

Display name for the Dev Box.

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

projectName, userId or devBoxName 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 GetDevBoxActionsAsync 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.GetDevBoxActionsAsync("<projectName>", "<userId>", "<devBoxName>", null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("actionType").ToString());
    Console.WriteLine(result.GetProperty("sourceId").ToString());
}

This sample shows how to call GetDevBoxActionsAsync 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.GetDevBoxActionsAsync("<projectName>", "<userId>", "<devBoxName>", null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("actionType").ToString());
    Console.WriteLine(result.GetProperty("sourceId").ToString());
    Console.WriteLine(result.GetProperty("suspendedUntil").ToString());
    Console.WriteLine(result.GetProperty("next").GetProperty("scheduledTime").ToString());
}

Applies to