FileOperations 類別
FileOperations 作業。
您不應該直接具現化這個類別,而是建立將為您建立的 Client 實例,並將它附加為屬性。
- 繼承
-
builtins.objectFileOperations
建構函式
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)
參數
- recursive
- bool
是否要刪除目錄的子系。 如果 filePath 參數代表目錄,而不是檔案,您可以將遞迴設定為 true,以刪除目錄及其中的所有檔案和子目錄。 如果遞迴為 false,則目錄必須是空的,否則刪除將會失敗。
- operation_config
作業組態覆寫。
傳回
如果 raw=true,則為 None 或 ClientRawResponse
傳回類型
例外狀況
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)
參數
- recursive
- bool
是否要刪除目錄的子系。 如果 filePath 參數代表目錄,而不是檔案,您可以將遞迴設定為 true,以刪除目錄及其中的所有檔案和子目錄。 如果遞迴為 false,則目錄必須是空的,否則刪除將會失敗。
- operation_config
作業組態覆寫。
傳回
如果 raw=true,則為 None 或 ClientRawResponse
傳回類型
例外狀況
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)
參數
- callback
- Callable[<xref:Bytes>, <xref:response=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)
參數
- callback
- Callable[<xref:Bytes>, <xref:response=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)
參數
- file_get_properties_from_compute_node_options
- FileGetPropertiesFromComputeNodeOptions
作業的其他參數
- operation_config
作業組態覆寫。
傳回
如果 raw=true,則為 None 或 ClientRawResponse
傳回類型
例外狀況
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)
參數
- operation_config
作業組態覆寫。
傳回
如果 raw=true,則為 None 或 ClientRawResponse
傳回類型
例外狀況
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)
參數
- 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)
參數
- 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'>
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應