DevBoxesClient.GetDevBoxActionAsync 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
GetDevBoxActionAsync(String, String, String, String, RequestContext) |
[Protocol Method] Gets an action.
|
GetDevBoxActionAsync(String, String, String, String, CancellationToken) |
Gets an action. |
GetDevBoxActionAsync(String, String, String, String, RequestContext)
- Source:
- DevBoxesClient.cs
- Source:
- DevBoxesClient.cs
[Protocol Method] Gets an action.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetDevBoxActionAsync(String, String, String, String, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> GetDevBoxActionAsync (string projectName, string userId, string devBoxName, string actionName, Azure.RequestContext context);
abstract member GetDevBoxActionAsync : string * string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDevBoxActionAsync : string * string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetDevBoxActionAsync (projectName As String, userId As String, devBoxName As String, actionName As String, context As RequestContext) As Task(Of Response)
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.
- 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 GetDevBoxActionAsync 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 = await client.GetDevBoxActionAsync("<projectName>", "<userId>", "<devBoxName>", "<actionName>", 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 GetDevBoxActionAsync 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 = await client.GetDevBoxActionAsync("<projectName>", "<userId>", "<devBoxName>", "<actionName>", 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
GetDevBoxActionAsync(String, String, String, String, CancellationToken)
- Source:
- DevBoxesClient.cs
Gets an action.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.DevBoxAction>> GetDevBoxActionAsync (string projectName, string userId, string devBoxName, string actionName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetDevBoxActionAsync : string * string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.DevBoxAction>>
override this.GetDevBoxActionAsync : string * string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.DevBoxAction>>
Public Overridable Function GetDevBoxActionAsync (projectName As String, userId As String, devBoxName As String, actionName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(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.
- actionName
- String
The name of the action.
- 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 GetDevBoxActionAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DevBoxesClient client = new DevBoxesClient(endpoint, credential);
Response<DevBoxAction> response = await client.GetDevBoxActionAsync("<projectName>", "<userId>", "<devBoxName>", "<actionName>");
This sample shows how to call GetDevBoxActionAsync 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 = await client.GetDevBoxActionAsync("<projectName>", "<userId>", "<devBoxName>", "<actionName>");
Applies to
Azure SDK for .NET