FileOperations 類別

FileOperations 作業。

您不應該直接具現化這個類別,而是建立將為您建立的 Client 實例,並將它附加為屬性。

繼承
builtins.object
FileOperations

建構函式

FileOperations(client, config, serializer, deserializer)

參數

client
必要

服務要求的用戶端。

config
必要

服務用戶端的設定。

serializer
必要

物件模型序列化程式。

deserializer
必要

物件模型還原序列化程式。

變數

api_version

要用於要求的 API 版本。 常數值:「2023-05-01.17.0」。

方法

delete_from_compute_node

從計算節點刪除指定的檔案。

delete_from_task

從工作執行所在的計算節點中刪除指定的工作檔案。

get_from_compute_node

傳回指定計算節點檔案的內容。

get_from_task

傳回指定之工作檔案的內容。

get_properties_from_compute_node

取得指定計算節點檔案的屬性。

get_properties_from_task

取得指定之 Task 檔案的屬性。

list_from_compute_node

列出指定計算節點上 [工作] 目錄中的所有檔案。

list_from_task

列出工作目錄中的計算節點上的檔案。

delete_from_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)

參數

pool_id
str
必要

包含計算節點的集區識別碼。

node_id
str
必要

您要從中刪除檔案之計算節點的識別碼。

file_path
str
必要

您要刪除之檔案或目錄的路徑。

recursive
bool
預設值: None

是否要刪除目錄的子系。 如果 filePath 參數代表目錄,而不是檔案,您可以將遞迴設定為 true,以刪除目錄及其中的所有檔案和子目錄。 如果遞迴為 false,則目錄必須是空的,否則刪除將會失敗。

file_delete_from_compute_node_options
FileDeleteFromComputeNodeOptions
預設值: None

作業的其他參數

custom_headers
dict
預設值: None

將新增至要求的標頭

raw
bool
預設值: False

傳回直接回應與還原序列化回應

operation_config
必要

作業組態覆寫

傳回

如果 raw=true,則為 None 或 ClientRawResponse

傳回類型

None,

例外狀況

delete_from_task

從工作執行所在的計算節點中刪除指定的工作檔案。

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

參數

job_id
str
必要

包含工作的作業識別碼。

task_id
str
必要

您要刪除其檔案的工作識別碼。

file_path
str
必要

您想要刪除之工作檔案或目錄的路徑。

recursive
bool
預設值: None

是否要刪除目錄的子系。 如果 filePath 參數代表目錄,而不是檔案,您可以將遞迴設定為 true,以刪除目錄及其中的所有檔案和子目錄。 如果遞迴為 false,則目錄必須是空的,否則刪除將會失敗。

file_delete_from_task_options
FileDeleteFromTaskOptions
預設值: None

作業的其他參數

custom_headers
dict
預設值: None

將新增至要求的標頭

raw
bool
預設值: False

傳回直接回應與還原序列化回應

operation_config
必要

作業組態覆寫

傳回

如果 raw=true,則為 None 或 ClientRawResponse

傳回類型

None,

例外狀況

get_from_compute_node

傳回指定計算節點檔案的內容。

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)

參數

pool_id
str
必要

包含計算節點的集區識別碼。

node_id
str
必要

包含檔案之計算節點的識別碼。

file_path
str
必要

您想要取得內容的計算節點檔案路徑。

file_get_from_compute_node_options
FileGetFromComputeNodeOptions
預設值: None

作業的其他參數

custom_headers
dict
預設值: None

將新增至要求的標頭

raw
bool
預設值: False

傳回直接回應與還原序列化回應

callback
Callable[<xref:Bytes>, <xref:response=None>]
預設值: None

指定時,將會使用資料流程處理的每個資料區塊來呼叫。 回呼應該採用兩個引數:目前資料區塊的位元組和回應物件。 如果資料正在上傳,回應會是 None。

operation_config
必要

作業組態覆寫

傳回

object 或 ClientRawResponse if raw=true

傳回類型

例外狀況

get_from_task

傳回指定之工作檔案的內容。

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

參數

job_id
str
必要

包含工作的作業識別碼。

task_id
str
必要

您要擷取其檔案之工作的識別碼。

file_path
str
必要

您想要取得內容之 Task 檔案的路徑。

file_get_from_task_options
FileGetFromTaskOptions
預設值: None

作業的其他參數

custom_headers
dict
預設值: None

將新增至要求的標頭

raw
bool
預設值: False

傳回直接回應與還原序列化回應

callback
Callable[<xref:Bytes>, <xref:response=None>]
預設值: None

指定時,將會使用資料流程處理的每個資料區塊來呼叫。 回呼應該採用兩個引數:目前資料區塊的位元組和回應物件。 如果資料正在上傳,回應會是 None。

operation_config
必要

作業組態覆寫

傳回

object 或 ClientRawResponse if raw=true

傳回類型

例外狀況

get_properties_from_compute_node

取得指定計算節點檔案的屬性。

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)

參數

pool_id
str
必要

包含計算節點的集區識別碼。

node_id
str
必要

包含檔案之計算節點的識別碼。

file_path
str
必要

您想要取得屬性之計算節點檔案的路徑。

file_get_properties_from_compute_node_options
FileGetPropertiesFromComputeNodeOptions
預設值: None

作業的其他參數

custom_headers
dict
預設值: None

將新增至要求的標頭

raw
bool
預設值: False

傳回直接回應與還原序列化回應

operation_config
必要

作業組態覆寫

傳回

如果 raw=true,則為 None 或 ClientRawResponse

傳回類型

None,

例外狀況

get_properties_from_task

取得指定之 Task 檔案的屬性。

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

參數

job_id
str
必要

包含工作的作業識別碼。

task_id
str
必要

您想要取得其檔案之工作的識別碼。

file_path
str
必要

您想要取得屬性之 Task 檔案的路徑。

file_get_properties_from_task_options
FileGetPropertiesFromTaskOptions
預設值: None

作業的其他參數

custom_headers
dict
預設值: None

將新增至要求的標頭

raw
bool
預設值: False

傳回直接回應與還原序列化回應

operation_config
必要

作業組態覆寫

傳回

如果 raw=true,則為 None 或 ClientRawResponse

傳回類型

None,

例外狀況

list_from_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)

參數

pool_id
str
必要

包含計算節點的集區識別碼。

node_id
str
必要

您要列出其檔案的計算節點識別碼。

recursive
bool
預設值: None

是否列出目錄的子系。

file_list_from_compute_node_options
FileListFromComputeNodeOptions
預設值: None

作業的其他參數

custom_headers
dict
預設值: None

將新增至要求的標頭

raw
bool
預設值: False

傳回直接回應與還原序列化回應

operation_config
必要

作業組態覆寫

傳回

NodeFile 實例之類的反覆運算器

傳回類型

例外狀況

list_from_task

列出工作目錄中的計算節點上的檔案。

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

參數

job_id
str
必要

包含工作的作業識別碼。

task_id
str
必要

您要列出其檔案的工作識別碼。

recursive
bool
預設值: None

是否列出 Task 目錄的子系。 此參數可以與篩選參數搭配使用,以列出特定類型的檔案。

file_list_from_task_options
FileListFromTaskOptions
預設值: None

作業的其他參數

custom_headers
dict
預設值: None

將新增至要求的標頭

raw
bool
預設值: False

傳回直接回應與還原序列化回應

operation_config
必要

作業組態覆寫

傳回

NodeFile 實例之類的反覆運算器

傳回類型

例外狀況

屬性

models

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