Share via


BatchClient.GetNodeFiles Method

Definition

Overloads

GetNodeFiles(String, String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, Nullable<Boolean>, RequestContext)

[Protocol Method] Lists all of the files in Task directories on the specified Compute Node.

GetNodeFiles(String, String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, Nullable<Boolean>, CancellationToken)

Lists all of the files in Task directories on the specified Compute Node.

GetNodeFiles(String, String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, Nullable<Boolean>, RequestContext)

[Protocol Method] Lists all of the files in Task directories on the specified Compute Node.

public virtual Azure.Pageable<BinaryData> GetNodeFiles (string poolId, string nodeId, int? timeOutInSeconds, DateTimeOffset? ocpdate, int? maxresults, string filter, bool? recursive, Azure.RequestContext context);
abstract member GetNodeFiles : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Nullable<bool> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetNodeFiles : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Nullable<bool> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetNodeFiles (poolId As String, nodeId As String, timeOutInSeconds As Nullable(Of Integer), ocpdate As Nullable(Of DateTimeOffset), maxresults As Nullable(Of Integer), filter As String, recursive As Nullable(Of Boolean), context As RequestContext) As Pageable(Of BinaryData)

Parameters

poolId
String

The ID of the Pool that contains the Compute Node.

nodeId
String

The ID of the Compute Node whose files you want to list.

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.

maxresults
Nullable<Int32>

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-compute-node-files.

recursive
Nullable<Boolean>

Whether to list children of a directory.

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

poolId or nodeId is null.

poolId or nodeId 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 GetNodeFiles 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.GetNodeFiles("<poolId>", "<nodeId>", null, null, null, null, null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.ToString());
}

This sample shows how to call GetNodeFiles 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.GetNodeFiles("<poolId>", "<nodeId>", 1234, DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), 1234, "<filter>", true, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("url").ToString());
    Console.WriteLine(result.GetProperty("isDirectory").ToString());
    Console.WriteLine(result.GetProperty("properties").GetProperty("creationTime").ToString());
    Console.WriteLine(result.GetProperty("properties").GetProperty("lastModified").ToString());
    Console.WriteLine(result.GetProperty("properties").GetProperty("contentLength").ToString());
    Console.WriteLine(result.GetProperty("properties").GetProperty("contentType").ToString());
    Console.WriteLine(result.GetProperty("properties").GetProperty("fileMode").ToString());
}

Applies to

GetNodeFiles(String, String, Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, Nullable<Boolean>, CancellationToken)

Lists all of the files in Task directories on the specified Compute Node.

public virtual Azure.Pageable<Azure.Compute.Batch.BatchNodeFile> GetNodeFiles (string poolId, string nodeId, int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, int? maxresults = default, string filter = default, bool? recursive = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetNodeFiles : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Nullable<bool> * System.Threading.CancellationToken -> Azure.Pageable<Azure.Compute.Batch.BatchNodeFile>
override this.GetNodeFiles : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Nullable<bool> * System.Threading.CancellationToken -> Azure.Pageable<Azure.Compute.Batch.BatchNodeFile>
Public Overridable Function GetNodeFiles (poolId As String, nodeId 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 recursive As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Pageable(Of BatchNodeFile)

Parameters

poolId
String

The ID of the Pool that contains the Compute Node.

nodeId
String

The ID of the Compute Node whose files you want to list.

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.

maxresults
Nullable<Int32>

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-compute-node-files.

recursive
Nullable<Boolean>

Whether to list children of a directory.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

poolId or nodeId is null.

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

Examples

This sample shows how to call GetNodeFiles.

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

foreach (BatchNodeFile item in client.GetNodeFiles("<poolId>", "<nodeId>"))
{
}

This sample shows how to call GetNodeFiles with all parameters.

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

foreach (BatchNodeFile item in client.GetNodeFiles("<poolId>", "<nodeId>", timeOutInSeconds: 1234, ocpdate: DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), maxresults: 1234, filter: "<filter>", recursive: true))
{
}

Applies to