Sdílet prostřednictvím


BatchClient.GetJobAsync Method

Definition

Overloads

GetJobAsync(String, Nullable<Int32>, Nullable<DateTimeOffset>, IEnumerable<String>, IEnumerable<String>, RequestConditions, RequestContext)

Source:
BatchClientCustom.cs

[Protocol Method] Gets information about the specified Job.

public virtual System.Threading.Tasks.Task<Azure.Response> GetJobAsync(string jobId, int? timeOutInSeconds, DateTimeOffset? ocpdate, System.Collections.Generic.IEnumerable<string> select, System.Collections.Generic.IEnumerable<string> expand, Azure.RequestConditions requestConditions, Azure.RequestContext context);
abstract member GetJobAsync : string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * seq<string> * Azure.RequestConditions * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetJobAsync : string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * seq<string> * Azure.RequestConditions * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetJobAsync (jobId As String, timeOutInSeconds As Nullable(Of Integer), ocpdate As Nullable(Of DateTimeOffset), select As IEnumerable(Of String), expand As IEnumerable(Of String), requestConditions As RequestConditions, context As RequestContext) As Task(Of Response)

Parameters

jobId
String

The ID of the Job.

timeOutInSeconds
Nullable<Int32>

The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".

ocpdate
Nullable<DateTimeOffset>

The time the request was issued. Client libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.

select
IEnumerable<String>

An OData $select clause.

expand
IEnumerable<String>

An OData $expand clause.

requestConditions
RequestConditions

The content to send as the request conditions of the request.

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

jobId is null.

jobId 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 GetJobAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);

Response response = await client.GetJobAsync("jobId", null, DateTimeOffset.Parse("Fri, 17 Feb 2017 00:00:00 GMT"), null, null, null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("poolInfo").ToString());

Applies to

GetJobAsync(String, Nullable<Int32>, Nullable<DateTimeOffset>, IEnumerable<String>, IEnumerable<String>, RequestConditions, CancellationToken)

Source:
BatchClientCustom.cs

Gets information about the specified Job.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Compute.Batch.BatchJob>> GetJobAsync(string jobId, int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, System.Collections.Generic.IEnumerable<string> select = default, System.Collections.Generic.IEnumerable<string> expand = default, Azure.RequestConditions requestConditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetJobAsync : string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * seq<string> * Azure.RequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Compute.Batch.BatchJob>>
override this.GetJobAsync : string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * seq<string> * Azure.RequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Compute.Batch.BatchJob>>
Public Overridable Function GetJobAsync (jobId As String, Optional timeOutInSeconds As Nullable(Of Integer) = Nothing, Optional ocpdate As Nullable(Of DateTimeOffset) = Nothing, Optional select As IEnumerable(Of String) = Nothing, Optional expand As IEnumerable(Of String) = Nothing, Optional requestConditions As RequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of BatchJob))

Parameters

jobId
String

The ID of the Job.

timeOutInSeconds
Nullable<Int32>

The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".

ocpdate
Nullable<DateTimeOffset>

The time the request was issued. Client libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.

select
IEnumerable<String>

An OData $select clause.

expand
IEnumerable<String>

An OData $expand clause.

requestConditions
RequestConditions

The content to send as the request conditions of the request.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

jobId is null.

jobId is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetJobAsync.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);

Response<BatchJob> response = await client.GetJobAsync("jobId");

Applies to