BatchClient.GetJobPreparationAndReleaseTaskStatuses 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
GetJobPreparationAndReleaseTaskStatuses(String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, RequestContext) |
[Protocol Method] Lists the execution status of the Job Preparation and Job Release Task for the specified Job across the Compute Nodes where the Job has run.
|
GetJobPreparationAndReleaseTaskStatuses(String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, CancellationToken) |
Lists the execution status of the Job Preparation and Job Release Task for the specified Job across the Compute Nodes where the Job has run. |
GetJobPreparationAndReleaseTaskStatuses(String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, RequestContext)
- Source:
- BatchClient.cs
[Protocol Method] Lists the execution status of the Job Preparation and Job Release Task for the specified Job across the Compute Nodes where the Job has run.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetJobPreparationAndReleaseTaskStatuses(String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Pageable<BinaryData> GetJobPreparationAndReleaseTaskStatuses (string jobId, int? timeOutInSeconds, DateTimeOffset? ocpdate, int? maxresults, string filter, System.Collections.Generic.IEnumerable<string> select, Azure.RequestContext context);
abstract member GetJobPreparationAndReleaseTaskStatuses : string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * seq<string> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetJobPreparationAndReleaseTaskStatuses : string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * seq<string> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetJobPreparationAndReleaseTaskStatuses (jobId As String, timeOutInSeconds As Nullable(Of Integer), ocpdate As Nullable(Of DateTimeOffset), maxresults As Nullable(Of Integer), filter As String, select As IEnumerable(Of String), context As RequestContext) As Pageable(Of BinaryData)
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.
The maximum number of items to return in the response. A maximum of 1000 applications can be returned.
- filter
- String
An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status.
- select
- IEnumerable<String>
An OData $select clause.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The Pageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.
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 GetJobPreparationAndReleaseTaskStatuses and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);
foreach (BinaryData item in client.GetJobPreparationAndReleaseTaskStatuses("<jobId>", null, null, null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.ToString());
}
This sample shows how to call GetJobPreparationAndReleaseTaskStatuses with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);
foreach (BinaryData item in client.GetJobPreparationAndReleaseTaskStatuses("<jobId>", 1234, DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), 1234, "<filter>", new string[] { "<select>" }, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("poolId").ToString());
Console.WriteLine(result.GetProperty("nodeId").ToString());
Console.WriteLine(result.GetProperty("nodeUrl").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("state").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("taskRootDirectory").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("taskRootDirectoryUrl").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("exitCode").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("state").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("containerInfo").GetProperty("error").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("category").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("retryCount").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("lastRetryTime").ToString());
Console.WriteLine(result.GetProperty("jobPreparationTaskExecutionInfo").GetProperty("result").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("state").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("taskRootDirectory").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("taskRootDirectoryUrl").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("exitCode").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("containerId").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("state").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("containerInfo").GetProperty("error").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("category").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("failureInfo").GetProperty("details")[0].GetProperty("value").ToString());
Console.WriteLine(result.GetProperty("jobReleaseTaskExecutionInfo").GetProperty("result").ToString());
}
Applies to
GetJobPreparationAndReleaseTaskStatuses(String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, CancellationToken)
- Source:
- BatchClient.cs
Lists the execution status of the Job Preparation and Job Release Task for the specified Job across the Compute Nodes where the Job has run.
public virtual Azure.Pageable<Azure.Compute.Batch.BatchJobPreparationAndReleaseTaskStatus> GetJobPreparationAndReleaseTaskStatuses (string jobId, int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, int? maxresults = default, string filter = default, System.Collections.Generic.IEnumerable<string> select = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetJobPreparationAndReleaseTaskStatuses : string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * seq<string> * System.Threading.CancellationToken -> Azure.Pageable<Azure.Compute.Batch.BatchJobPreparationAndReleaseTaskStatus>
override this.GetJobPreparationAndReleaseTaskStatuses : string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * seq<string> * System.Threading.CancellationToken -> Azure.Pageable<Azure.Compute.Batch.BatchJobPreparationAndReleaseTaskStatus>
Public Overridable Function GetJobPreparationAndReleaseTaskStatuses (jobId As String, Optional timeOutInSeconds As Nullable(Of Integer) = Nothing, Optional ocpdate As Nullable(Of DateTimeOffset) = Nothing, Optional maxresults As Nullable(Of Integer) = Nothing, Optional filter As String = Nothing, Optional select As IEnumerable(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Pageable(Of BatchJobPreparationAndReleaseTaskStatus)
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.
The maximum number of items to return in the response. A maximum of 1000 applications can be returned.
- filter
- String
An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status.
- select
- IEnumerable<String>
An OData $select clause.
- 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 GetJobPreparationAndReleaseTaskStatuses.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);
foreach (BatchJobPreparationAndReleaseTaskStatus item in client.GetJobPreparationAndReleaseTaskStatuses("<jobId>"))
{
}
This sample shows how to call GetJobPreparationAndReleaseTaskStatuses with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);
foreach (BatchJobPreparationAndReleaseTaskStatus item in client.GetJobPreparationAndReleaseTaskStatuses("<jobId>", timeOutInSeconds: 1234, ocpdate: DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), maxresults: 1234, filter: "<filter>", select: new string[] { "<select>" }))
{
}
Remarks
This API returns the Job Preparation and Job Release Task status on all Compute Nodes that have run the Job Preparation or Job Release Task. This includes Compute Nodes which have since been removed from the Pool. If this API is invoked on a Job which has no Job Preparation or Job Release Task, the Batch service returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified.
Applies to
Azure SDK for .NET