BatchClient.GetNodeFilesAsync Method

Definition

Overloads

GetNodeFilesAsync(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.

GetNodeFilesAsync(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.

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

Source:
BatchClient.cs

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

public virtual Azure.AsyncPageable<BinaryData> GetNodeFilesAsync (string poolId, string nodeId, int? timeOutInSeconds, DateTimeOffset? ocpdate, int? maxresults, string filter, bool? recursive, Azure.RequestContext context);
abstract member GetNodeFilesAsync : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Nullable<bool> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetNodeFilesAsync : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Nullable<bool> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetNodeFilesAsync (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 AsyncPageable(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 AsyncPageable<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 GetNodeFilesAsync and parse the result.

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

await foreach (BinaryData item in client.GetNodeFilesAsync("<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 GetNodeFilesAsync 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);

await foreach (BinaryData item in client.GetNodeFilesAsync("<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

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

Source:
BatchClient.cs

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

public virtual Azure.AsyncPageable<Azure.Compute.Batch.BatchNodeFile> GetNodeFilesAsync (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 GetNodeFilesAsync : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Nullable<bool> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Compute.Batch.BatchNodeFile>
override this.GetNodeFilesAsync : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Nullable<bool> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Compute.Batch.BatchNodeFile>
Public Overridable Function GetNodeFilesAsync (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 AsyncPageable(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 GetNodeFilesAsync.

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

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

This sample shows how to call GetNodeFilesAsync with all parameters.

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

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

Applies to