次の方法で共有


DevBoxesClient.DelayAllActionsAsync Method

Definition

Overloads

DelayAllActionsAsync(String, String, String, DateTimeOffset, RequestContext)

[Protocol Method] Delays all actions.

DelayAllActionsAsync(String, String, String, DateTimeOffset, CancellationToken)

Delays all actions.

DelayAllActionsAsync(String, String, String, DateTimeOffset, RequestContext)

Source:
DevBoxesClient.cs
Source:
DevBoxesClient.cs

[Protocol Method] Delays all actions.

public virtual Azure.AsyncPageable<BinaryData> DelayAllActionsAsync (string projectName, string userId, string devBoxName, DateTimeOffset delayUntil, Azure.RequestContext context);
abstract member DelayAllActionsAsync : string * string * string * DateTimeOffset * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.DelayAllActionsAsync : string * string * string * DateTimeOffset * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function DelayAllActionsAsync (projectName As String, userId As String, devBoxName As String, delayUntil As DateTimeOffset, 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.

delayUntil
DateTimeOffset

The time to delay the Dev Box action or actions until.

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 DelayAllActionsAsync 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.DelayAllActionsAsync("<projectName>", "<userId>", "<devBoxName>", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("result").ToString());
}

This sample shows how to call DelayAllActionsAsync 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.DelayAllActionsAsync("<projectName>", "<userId>", "<devBoxName>", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("result").ToString());
    Console.WriteLine(result.GetProperty("action").GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("action").GetProperty("actionType").ToString());
    Console.WriteLine(result.GetProperty("action").GetProperty("sourceId").ToString());
    Console.WriteLine(result.GetProperty("action").GetProperty("suspendedUntil").ToString());
    Console.WriteLine(result.GetProperty("action").GetProperty("next").GetProperty("scheduledTime").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());
}

Applies to

DelayAllActionsAsync(String, String, String, DateTimeOffset, CancellationToken)

Source:
DevBoxesClient.cs

Delays all actions.

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

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.

delayUntil
DateTimeOffset

The time to delay the Dev Box action or actions until.

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 DelayAllActionsAsync.

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

await foreach (DevBoxActionDelayResult item in client.DelayAllActionsAsync("<projectName>", "<userId>", "<devBoxName>", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")))
{
}

This sample shows how to call DelayAllActionsAsync with all parameters.

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

await foreach (DevBoxActionDelayResult item in client.DelayAllActionsAsync("<projectName>", "<userId>", "<devBoxName>", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00")))
{
}

Applies to