다음을 통해 공유


BatchClient.GetNodeFile Method

Definition

Overloads

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

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

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

Returns the content of the specified Compute Node file.

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

Source:
BatchClient.cs

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

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

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

Source:
BatchClient.cs

Returns the content of the specified Compute Node file.

public virtual Azure.Response<BinaryData> GetNodeFile (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 GetNodeFile : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * System.Threading.CancellationToken -> Azure.Response<BinaryData>
override this.GetNodeFile : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * string * Azure.RequestConditions * System.Threading.CancellationToken -> Azure.Response<BinaryData>
Public Overridable Function GetNodeFile (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 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 GetNodeFile.

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

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

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

Applies to