airflow.providers.microsoft.azure.hooks.fileshare

模組內容

類別

AzureFileShareHook

與 Azure FileShare 儲存互動。

class airflow.providers.microsoft.azure.hooks.fileshare.AzureFileShareHook(share_name=None, file_path=None, directory_path=None, azure_fileshare_conn_id='azure_fileshare_default')[source]

基底類別: airflow.hooks.base.BaseHook

與 Azure FileShare 儲存互動。

參數

azure_fileshare_conn_id (str) – 參考 Azure FileShare 連線 ID,用於指定應使用哪個 Azure 帳戶的檔案共用。

property share_service_client[source]
property share_directory_client[source]
property share_file_client[source]
conn_name_attr = 'azure_fileshare_conn_id'[source]
default_conn_name = 'azure_fileshare_default'[source]
conn_type = 'azure_fileshare'[source]
hook_name = 'Azure FileShare'[source]
classmethod get_connection_form_widgets()[source]

傳回要新增至連線表單的連線小工具。

classmethod get_ui_field_behaviour()[source]

傳回自訂欄位行為。

get_conn()[source]

傳回 Hook 的連線。

check_for_directory()[source]

檢查 Azure 檔案共用上是否存在目錄。

list_directories_and_files()[source]

傳回儲存在 Azure 檔案共用上的目錄和檔案清單。

list_files()[source]

傳回儲存在 Azure 檔案共用上的檔案清單。

create_share(share_name, **kwargs)[source]

建立新的 Azure 檔案共用。

參數

share_name (str) – 共用名稱。

返回

如果共用已建立則為 True,如果共用已存在則為 False。

返回類型

bool

delete_share(share_name, **kwargs)[source]

刪除現有的 Azure 檔案共用。

參數

share_name (str) – 共用名稱。

返回

如果共用已刪除則為 True,如果共用不存在則為 False。

返回類型

bool

create_directory(**kwargs)[source]

在 Azure 檔案共用上建立新的目錄。

get_file(file_path, **kwargs)[source]

從 Azure 檔案共用下載檔案。

參數

file_path (str) – 檔案的儲存位置。

get_file_to_stream(stream, **kwargs)[source]

從 Azure 檔案共用下載檔案。

參數

stream (IO) – 用於儲存檔案的檔案控制代碼。

load_file(file_path, **kwargs)[source]

將檔案上傳到 Azure 檔案共用。

參數

file_path (str) – 要載入的檔案路徑。

load_data(string_data, **kwargs)[source]

將字串上傳到 Azure 檔案共用。

參數

string_data (bytes | str | IO) – 要載入的字串/串流。

test_connection()[source]

測試 Azure FileShare 連線。

此條目是否有所幫助?