FileOperations Class

FileOperations operations.

You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.

Inheritance
builtins.object
FileOperations

Constructor

FileOperations(client, config, serializer, deserializer)

Parameters

Name Description
client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

Name Description
api_version

The API version to use for the request. Constant value: "2024-02-01.19.0".

Methods

delete_from_compute_node

Deletes the specified file from the Compute Node.

delete_from_task

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

get_from_compute_node

Returns the content of the specified Compute Node file.

get_from_task

Returns the content of the specified Task file.

get_properties_from_compute_node

Gets the properties of the specified Compute Node file.

get_properties_from_task

Gets the properties of the specified Task file.

list_from_compute_node

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

list_from_task

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

delete_from_compute_node

Deletes the specified file from the Compute Node.

delete_from_compute_node(pool_id, node_id, file_path, recursive=None, file_delete_from_compute_node_options=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
pool_id
Required
str

The ID of the Pool that contains the Compute Node.

node_id
Required
str

The ID of the Compute Node from which you want to delete the file.

file_path
Required
str

The path to the file or directory that you want to delete.

recursive

Whether 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: None
file_delete_from_compute_node_options

Additional parameters for the operation

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

delete_from_task

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

delete_from_task(job_id, task_id, file_path, recursive=None, file_delete_from_task_options=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
job_id
Required
str

The ID of the Job that contains the Task.

task_id
Required
str

The ID of the Task whose file you want to delete.

file_path
Required
str

The path to the Task file or directory that you want to delete.

recursive

Whether 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: None
file_delete_from_task_options

Additional parameters for the operation

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

get_from_compute_node

Returns the content of the specified Compute Node file.

get_from_compute_node(pool_id, node_id, file_path, file_get_from_compute_node_options=None, custom_headers=None, raw=False, callback=None, **operation_config)

Parameters

Name Description
pool_id
Required
str

The ID of the Pool that contains the Compute Node.

node_id
Required
str

The ID of the Compute Node that contains the file.

file_path
Required
str

The path to the Compute Node file that you want to get the content of.

file_get_from_compute_node_options

Additional parameters for the operation

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
callback
Callable[<xref:Bytes>, <xref:response=None>]

When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.

Default value: None
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

object or ClientRawResponse if raw=true

Exceptions

Type Description

get_from_task

Returns the content of the specified Task file.

get_from_task(job_id, task_id, file_path, file_get_from_task_options=None, custom_headers=None, raw=False, callback=None, **operation_config)

Parameters

Name Description
job_id
Required
str

The ID of the Job that contains the Task.

task_id
Required
str

The ID of the Task whose file you want to retrieve.

file_path
Required
str

The path to the Task file that you want to get the content of.

file_get_from_task_options

Additional parameters for the operation

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
callback
Callable[<xref:Bytes>, <xref:response=None>]

When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.

Default value: None
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

object or ClientRawResponse if raw=true

Exceptions

Type Description

get_properties_from_compute_node

Gets the properties of the specified Compute Node file.

get_properties_from_compute_node(pool_id, node_id, file_path, file_get_properties_from_compute_node_options=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
pool_id
Required
str

The ID of the Pool that contains the Compute Node.

node_id
Required
str

The ID of the Compute Node that contains the file.

file_path
Required
str

The path to the Compute Node file that you want to get the properties of.

file_get_properties_from_compute_node_options

Additional parameters for the operation

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

get_properties_from_task

Gets the properties of the specified Task file.

get_properties_from_task(job_id, task_id, file_path, file_get_properties_from_task_options=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
job_id
Required
str

The ID of the Job that contains the Task.

task_id
Required
str

The ID of the Task whose file you want to get the properties of.

file_path
Required
str

The path to the Task file that you want to get the properties of.

file_get_properties_from_task_options

Additional parameters for the operation

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

list_from_compute_node

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

list_from_compute_node(pool_id, node_id, recursive=None, file_list_from_compute_node_options=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
pool_id
Required
str

The ID of the Pool that contains the Compute Node.

node_id
Required
str

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

recursive

Whether to list children of a directory.

Default value: None
file_list_from_compute_node_options

Additional parameters for the operation

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of NodeFile

Exceptions

Type Description

list_from_task

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

list_from_task(job_id, task_id, recursive=None, file_list_from_task_options=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
job_id
Required
str

The ID of the Job that contains the Task.

task_id
Required
str

The ID of the Task whose files you want to list.

recursive

Whether to list children of the Task directory. This parameter can be used in combination with the filter parameter to list specific type of files.

Default value: None
file_list_from_task_options

Additional parameters for the operation

Default value: None
custom_headers

headers that will be added to the request

Default value: None
raw

returns the direct response alongside the deserialized response

Default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of NodeFile

Exceptions

Type Description

Attributes

models

models = <module 'azure.batch.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\batch\\models\\__init__.py'>