Partager via


DevBoxesClient.GetScheduleAsync Method

Definition

Overloads

GetScheduleAsync(String, String, String, RequestContext)

[Protocol Method] Gets a schedule.

GetScheduleAsync(String, String, String, CancellationToken)

Gets a schedule.

GetScheduleAsync(String, String, String, RequestContext)

Source:
DevBoxesClient.cs
Source:
DevBoxesClient.cs

[Protocol Method] Gets a schedule.

public virtual System.Threading.Tasks.Task<Azure.Response> GetScheduleAsync (string projectName, string poolName, string scheduleName, Azure.RequestContext context);
abstract member GetScheduleAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetScheduleAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetScheduleAsync (projectName As String, poolName As String, scheduleName As String, context As RequestContext) As Task(Of Response)

Parameters

projectName
String

Name of the project.

poolName
String

Pool name.

scheduleName
String

Display name for the Schedule.

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, poolName or scheduleName is null.

projectName, poolName or scheduleName 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 GetScheduleAsync 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.GetScheduleAsync("<projectName>", "<poolName>", "<scheduleName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("frequency").ToString());
Console.WriteLine(result.GetProperty("time").ToString());
Console.WriteLine(result.GetProperty("timeZone").ToString());

This sample shows how to call GetScheduleAsync 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.GetScheduleAsync("<projectName>", "<poolName>", "<scheduleName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("frequency").ToString());
Console.WriteLine(result.GetProperty("time").ToString());
Console.WriteLine(result.GetProperty("timeZone").ToString());

Applies to

GetScheduleAsync(String, String, String, CancellationToken)

Source:
DevBoxesClient.cs

Gets a schedule.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.DevBoxSchedule>> GetScheduleAsync (string projectName, string poolName, string scheduleName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetScheduleAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.DevBoxSchedule>>
override this.GetScheduleAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Developer.DevCenter.Models.DevBoxSchedule>>
Public Overridable Function GetScheduleAsync (projectName As String, poolName As String, scheduleName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of DevBoxSchedule))

Parameters

projectName
String

Name of the project.

poolName
String

Pool name.

scheduleName
String

Display name for the Schedule.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName, poolName or scheduleName is null.

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

Examples

This sample shows how to call GetScheduleAsync.

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

Response<DevBoxSchedule> response = await client.GetScheduleAsync("<projectName>", "<poolName>", "<scheduleName>");

This sample shows how to call GetScheduleAsync with all parameters.

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

Response<DevBoxSchedule> response = await client.GetScheduleAsync("<projectName>", "<poolName>", "<scheduleName>");

Applies to