DevBoxesClient.DelayAction 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

DelayAction(String, String, String, String, DateTimeOffset, CancellationToken)

Delays the occurrence of an action.

DelayAction(String, String, String, String, DateTimeOffset, RequestContext)

[Protocol Method] Delays the occurrence of an action.

DelayAction(String, String, String, String, DateTimeOffset, CancellationToken)

Source:
DevBoxesClient.cs

Delays the occurrence of an action.

C#
public virtual Azure.Response<Azure.Developer.DevCenter.Models.DevBoxAction> DelayAction(string projectName, string userId, string devBoxName, string actionName, DateTimeOffset delayUntil, System.Threading.CancellationToken cancellationToken = default);

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.

actionName
String

The name of the action.

delayUntil
DateTimeOffset

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

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName, userId, devBoxName or actionName is null.

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

Examples

This sample shows how to call DelayAction.

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

Response<DevBoxAction> response = client.DelayAction("<projectName>", "<userId>", "<devBoxName>", "<actionName>", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"));

This sample shows how to call DelayAction with all parameters.

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

Response<DevBoxAction> response = client.DelayAction("<projectName>", "<userId>", "<devBoxName>", "<actionName>", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"));

Applies to

Azure SDK for .NET Latest
Toode Versioonid
Azure SDK for .NET Latest

DelayAction(String, String, String, String, DateTimeOffset, RequestContext)

Source:
DevBoxesClient.cs
Source:
DevBoxesClient.cs

[Protocol Method] Delays the occurrence of an action.

C#
public virtual Azure.Response DelayAction(string projectName, string userId, string devBoxName, string actionName, DateTimeOffset delayUntil, Azure.RequestContext context);

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.

actionName
String

The name of the action.

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 response returned from the service.

Exceptions

projectName, userId, devBoxName or actionName is null.

projectName, userId, devBoxName or actionName 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 DelayAction 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.DelayAction("<projectName>", "<userId>", "<devBoxName>", "<actionName>", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null);

JsonElement result = JsonDocument.Parse(response.ContentStream).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 DelayAction 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.DelayAction("<projectName>", "<userId>", "<devBoxName>", "<actionName>", DateTimeOffset.Parse("2022-05-10T14:57:31.2311892-04:00"), null);

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

Azure SDK for .NET Preview ja Azure SDK for .NET Latest
Toode Versioonid
Azure SDK for .NET Latest, Preview