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.objectFileOperations
Constructor
FileOperations(client, config, serializer, deserializer)
Parameters
- client
Client for service requests.
- config
Configuration of service client.
- serializer
An object model serializer.
- deserializer
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
- recursive
- bool
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
Additional parameters for the operation
- operation_config
Operation configuration overrides.
Returns
None or ClientRawResponse if raw=true
Return type
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
- recursive
- bool
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
Additional parameters for the operation
- operation_config
Operation configuration overrides.
Returns
None or ClientRawResponse if raw=true
Return type
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
- file_get_from_compute_node_options
- FileGetFromComputeNodeOptions
Additional parameters for the operation
- callback
- <xref: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.
- operation_config
Operation configuration overrides.
Returns
object or ClientRawResponse if raw=true
Return type
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
- file_get_from_task_options
- FileGetFromTaskOptions
Additional parameters for the operation
- callback
- <xref: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.
- operation_config
Operation configuration overrides.
Returns
object or ClientRawResponse if raw=true
Return type
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
- file_get_properties_from_compute_node_options
- FileGetPropertiesFromComputeNodeOptions
Additional parameters for the operation
- operation_config
Operation configuration overrides.
Returns
None or ClientRawResponse if raw=true
Return type
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
- file_get_properties_from_task_options
- FileGetPropertiesFromTaskOptions
Additional parameters for the operation
- operation_config
Operation configuration overrides.
Returns
None or ClientRawResponse if raw=true
Return type
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
- file_list_from_compute_node_options
- FileListFromComputeNodeOptions
Additional parameters for the operation
- operation_config
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
- recursive
- bool
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
Additional parameters for the operation
- operation_config
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'>
Feedback
Submit and view feedback for