Share via


BatchClient.GetTaskFile Method

Definition

Overloads

GetTaskFile(String, String, String, Nullable<Int32>, Nullable<DateTimeOffset>, String, RequestConditions, RequestContext)

[Protocol Method] Returns the content of the specified Task file.

GetTaskFile(String, String, String, Nullable<Int32>, Nullable<DateTimeOffset>, String, RequestConditions, CancellationToken)

Returns the content of the specified Task file.

GetTaskFile(String, String, String, Nullable<Int32>, Nullable<DateTimeOffset>, String, RequestConditions, RequestContext)

[Protocol Method] Returns the content of the specified Task file.

public virtual Azure.Response GetTaskFile (string jobId, string taskId, string filePath, int? timeOutInSeconds, DateTimeOffset? ocpdate, string ocpRange, Azure.RequestConditions requestConditions, Azure.RequestContext context);
abstract member GetTaskFile : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * Azure.RequestContext -> Azure.Response
override this.GetTaskFile : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * Azure.RequestContext -> Azure.Response
Public Overridable Function GetTaskFile (jobId As String, taskId As String, filePath As String, timeOutInSeconds As Nullable(Of Integer), ocpdate As Nullable(Of DateTimeOffset), ocpRange As String, requestConditions As RequestConditions, context As RequestContext) As Response

Parameters

jobId
String

The ID of the Job that contains the Task.

taskId
String

The ID of the Task whose file you want to retrieve.

filePath
String

The path to the Task file that you want to get the content of.

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.

ocpRange
String

The byte range to be retrieved. The default is to retrieve the entire file. The format is bytes=startRange-endRange.

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, taskId or filePath is null.

jobId, taskId or filePath 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 GetTaskFile and parse the result.

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

Response response = client.GetTaskFile("<jobId>", "<taskId>", "<filePath>", null, null, null, null, null);

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

This sample shows how to call GetTaskFile 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);

Response response = client.GetTaskFile("<jobId>", "<taskId>", "<filePath>", 1234, DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), "<ocp-range>", null, null);

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

Applies to

GetTaskFile(String, String, String, Nullable<Int32>, Nullable<DateTimeOffset>, String, RequestConditions, CancellationToken)

Returns the content of the specified Task file.

public virtual Azure.Response<BinaryData> GetTaskFile (string jobId, string taskId, string filePath, int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, string ocpRange = default, Azure.RequestConditions requestConditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTaskFile : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * System.Threading.CancellationToken -> Azure.Response<BinaryData>
override this.GetTaskFile : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * System.Threading.CancellationToken -> Azure.Response<BinaryData>
Public Overridable Function GetTaskFile (jobId As String, taskId As String, filePath As String, Optional timeOutInSeconds As Nullable(Of Integer) = Nothing, Optional ocpdate As Nullable(Of DateTimeOffset) = Nothing, Optional ocpRange As String = Nothing, Optional requestConditions As RequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of BinaryData)

Parameters

jobId
String

The ID of the Job that contains the Task.

taskId
String

The ID of the Task whose file you want to retrieve.

filePath
String

The path to the Task file that you want to get the content of.

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.

ocpRange
String

The byte range to be retrieved. The default is to retrieve the entire file. The format is bytes=startRange-endRange.

requestConditions
RequestConditions

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

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

jobId, taskId or filePath is null.

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

Examples

This sample shows how to call GetTaskFile.

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

Response<BinaryData> response = client.GetTaskFile("<jobId>", "<taskId>", "<filePath>");

This sample shows how to call GetTaskFile with all parameters.

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

Response<BinaryData> response = client.GetTaskFile("<jobId>", "<taskId>", "<filePath>", timeOutInSeconds: 1234, ocpdate: DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), ocpRange: "<ocp-range>", requestConditions: null);

Applies to