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

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

api_version

The API version to use for the request. Constant value: "2022-01-01.15.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

pool_id
str
Required

The ID of the Pool that contains the Compute Node.

node_id
str
Required

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

file_path
str
Required

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

recursive
bool
default value: None

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.

file_delete_from_compute_node_options
FileDeleteFromComputeNodeOptions
default value: None

Additional parameters for the operation

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

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

job_id
str
Required

The ID of the Job that contains the Task.

task_id
str
Required

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

file_path
str
Required

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

recursive
bool
default value: None

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.

file_delete_from_task_options
FileDeleteFromTaskOptions
default value: None

Additional parameters for the operation

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

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

pool_id
str
Required

The ID of the Pool that contains the Compute Node.

node_id
str
Required

The ID of the Compute Node that contains the file.

file_path
str
Required

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

file_get_from_compute_node_options
FileGetFromComputeNodeOptions
default value: None

Additional parameters for the operation

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

callback
<xref:Callable>[<xref:Bytes>, <xref:response=None>]
default value: 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.

operation_config
Required

Operation configuration overrides.

Returns

object or ClientRawResponse if raw=true

Return type

<xref:Generator>,

Exceptions

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

job_id
str
Required

The ID of the Job that contains the Task.

task_id
str
Required

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

file_path
str
Required

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

file_get_from_task_options
FileGetFromTaskOptions
default value: None

Additional parameters for the operation

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

callback
<xref:Callable>[<xref:Bytes>, <xref:response=None>]
default value: 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.

operation_config
Required

Operation configuration overrides.

Returns

object or ClientRawResponse if raw=true

Return type

<xref:Generator>,

Exceptions

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

pool_id
str
Required

The ID of the Pool that contains the Compute Node.

node_id
str
Required

The ID of the Compute Node that contains the file.

file_path
str
Required

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

file_get_properties_from_compute_node_options
FileGetPropertiesFromComputeNodeOptions
default value: None

Additional parameters for the operation

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

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

job_id
str
Required

The ID of the Job that contains the Task.

task_id
str
Required

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

file_path
str
Required

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

file_get_properties_from_task_options
FileGetPropertiesFromTaskOptions
default value: None

Additional parameters for the operation

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

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

pool_id
str
Required

The ID of the Pool that contains the Compute Node.

node_id
str
Required

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

recursive
bool
default value: None

Whether to list children of a directory.

file_list_from_compute_node_options
FileListFromComputeNodeOptions
default value: None

Additional parameters for the operation

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

An iterator like instance of NodeFile

Return type

Exceptions

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

job_id
str
Required

The ID of the Job that contains the Task.

task_id
str
Required

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

recursive
bool
default value: None

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.

file_list_from_task_options
FileListFromTaskOptions
default value: None

Additional parameters for the operation

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

An iterator like instance of NodeFile

Return type

Exceptions

Attributes

models

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