다음을 통해 공유


BatchClient.GetNodeFileAsync Method

Definition

Overloads

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

Returns the content of the specified Compute Node file.

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

[Protocol Method] Returns the content of the specified Compute Node file.

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

Source:
BatchClientCustom.cs

Returns the content of the specified Compute Node file.

public virtual System.Threading.Tasks.Task<Azure.Response<BinaryData>> GetNodeFileAsync (string poolId, string nodeId, string filePath, int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, string ocpRange = default, Azure.RequestConditions requestConditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetNodeFileAsync : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<BinaryData>>
override this.GetNodeFileAsync : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<BinaryData>>
Public Overridable Function GetNodeFileAsync (poolId As String, nodeId 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 Task(Of Response(Of BinaryData))

Parameters

poolId
String

The ID of the Pool that contains the Compute Node.

nodeId
String

The ID of the Compute Node.

filePath
String

The path to the file or directory.

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

poolId, nodeId or filePath is null.

poolId, nodeId or filePath is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetNodeFileAsync.

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

Response<BinaryData> response = await client.GetNodeFileAsync("<poolId>", "<nodeId>", "<filePath>");

This sample shows how to call GetNodeFileAsync 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 = await client.GetNodeFileAsync("<poolId>", "<nodeId>", "<filePath>", timeOutInSeconds: 1234, ocpdate: DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), ocpRange: "<ocp-range>", requestConditions: null);

Applies to

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

Source:
BatchClientCustom.cs

[Protocol Method] Returns the content of the specified Compute Node file.

public virtual System.Threading.Tasks.Task<Azure.Response> GetNodeFileAsync (string poolId, string nodeId, string filePath, int? timeOutInSeconds, DateTimeOffset? ocpdate, string ocpRange, Azure.RequestConditions requestConditions, Azure.RequestContext context);
abstract member GetNodeFileAsync : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetNodeFileAsync : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetNodeFileAsync (poolId As String, nodeId 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 Task(Of Response)

Parameters

poolId
String

The ID of the Pool that contains the Compute Node.

nodeId
String

The ID of the Compute Node.

filePath
String

The path to the file or directory.

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

poolId, nodeId or filePath is null.

poolId, nodeId 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 GetNodeFileAsync 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 = await client.GetNodeFileAsync("<poolId>", "<nodeId>", "<filePath>", null, null, null, null, null);

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

This sample shows how to call GetNodeFileAsync 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 = await client.GetNodeFileAsync("<poolId>", "<nodeId>", "<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