Skip to main content

task_files

Creates, updates, deletes, gets or lists a task_files resource.

Overview

Nametask_files
TypeResource
Idazure.batch_dataplane.task_files

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe file path.
contentLengthintegerThe length of the file. Required.
contentTypestringThe content type of the file.
creationTimestring (date-time)The file creation time. The creation time is not returned for files on Linux Compute Nodes.
fileModestringThe file mode attribute in octal format. The file mode is returned only for files on Linux Compute Nodes.
isDirectorybooleanWhether the object represents a directory.
lastModifiedstring (date-time)The time at which the file was last modified. Required.
urlstringThe URL of the file.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_task_filesselectjob_id, task_id, endpointtimeOut, ocp-date, maxresults, $filter, recursiveLists the files in a Task's directory on its Compute Node. Lists the files in a Task's directory on its Compute Node.
delete_task_filedeletejob_id, task_id, file_path, endpointtimeOut, ocp-date, recursiveDeletes the specified Task file from the Compute Node where the Task ran. Deletes the specified Task file from the Compute Node where the Task ran.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
file_pathstringThe path to the Task file that you want to get the content of. Required.
job_idstringThe ID of the Job that contains the Task. Required.
task_idstringThe ID of the Task whose file you want to retrieve. Required.
$filterstringAn OData $filter clause. For more information on constructing this filter, see https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-task-files _. Default value is None.
maxresultsintegerThe maximum number of items to return in the response. A maximum of 1000 applications can be returned. Default value is None.
ocp-datestringThe 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. Default value is None.
recursivebooleanWhether to delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false then the directory must be empty or deletion will fail. Default value is None.
timeOutintegerThe 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.". Default value is None.

SELECT examples

Lists the files in a Task's directory on its Compute Node. Lists the files in a Task's directory on its Compute Node.

SELECT
name,
contentLength,
contentType,
creationTime,
fileMode,
isDirectory,
lastModified,
url
FROM azure.batch_dataplane.task_files
WHERE job_id = '{{ job_id }}' -- required
AND task_id = '{{ task_id }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND timeOut = '{{ timeOut }}'
AND ocp-date = '{{ ocp-date }}'
AND maxresults = '{{ maxresults }}'
AND $filter = '{{ $filter }}'
AND recursive = '{{ recursive }}'
;

DELETE examples

Deletes the specified Task file from the Compute Node where the Task ran. Deletes the specified Task file from the Compute Node where the Task ran.

DELETE FROM azure.batch_dataplane.task_files
WHERE job_id = '{{ job_id }}' --required
AND task_id = '{{ task_id }}' --required
AND file_path = '{{ file_path }}' --required
AND endpoint = '{{ endpoint }}' --required
AND timeOut = '{{ timeOut }}'
AND ocp-date = '{{ ocp-date }}'
AND recursive = '{{ recursive }}'
;