BatchClient.GetJob 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
GetJob(String, Nullable<Int32>, Nullable<DateTimeOffset>, IEnumerable<String>, IEnumerable<String>, RequestConditions, CancellationToken) |
Gets information about the specified Job. |
GetJob(String, Nullable<Int32>, Nullable<DateTimeOffset>, IEnumerable<String>, IEnumerable<String>, RequestConditions, RequestContext) |
[Protocol Method] Gets information about the specified Job.
|
GetJob(String, Nullable<Int32>, Nullable<DateTimeOffset>, IEnumerable<String>, IEnumerable<String>, RequestConditions, CancellationToken)
- Source:
- BatchClient.cs
Gets information about the specified Job.
public virtual Azure.Response<Azure.Compute.Batch.BatchJob> GetJob(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 GetJob : string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * seq<string> * Azure.RequestConditions * System.Threading.CancellationToken -> Azure.Response<Azure.Compute.Batch.BatchJob>
override this.GetJob : string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * seq<string> * Azure.RequestConditions * System.Threading.CancellationToken -> Azure.Response<Azure.Compute.Batch.BatchJob>
Public Overridable Function GetJob (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 Response(Of BatchJob)
Parameters
- jobId
- String
The ID of the Job.
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 GetJob.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);
Response<BatchJob> response = client.GetJob("jobId");
Applies to
GetJob(String, Nullable<Int32>, Nullable<DateTimeOffset>, IEnumerable<String>, IEnumerable<String>, RequestConditions, RequestContext)
- Source:
- BatchClient.cs
[Protocol Method] Gets information about the specified Job.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetJob(String, Nullable<Int32>, Nullable<DateTimeOffset>, IEnumerable<String>, IEnumerable<String>, RequestConditions, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetJob(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 GetJob : string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * seq<string> * Azure.RequestConditions * Azure.RequestContext -> Azure.Response
override this.GetJob : string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * seq<string> * Azure.RequestConditions * Azure.RequestContext -> Azure.Response
Public Overridable Function GetJob (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 Response
Parameters
- jobId
- String
The ID of the Job.
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 GetJob and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);
Response response = client.GetJob("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
Azure SDK for .NET