airflow.providers.microsoft.azure.hooks.fileshare

Module Contents

Classes

AzureFileShareHook

Interacts with Azure FileShare Storage.

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]

Bases: airflow.hooks.base.BaseHook

Interacts with Azure FileShare Storage.

Parameters

azure_fileshare_conn_id (str) – Reference to the Azure FileShare connection id of an Azure account of which file share should be used.

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]

Return connection widgets to add to connection form.

classmethod get_ui_field_behaviour()[source]

Return custom field behaviour.

get_conn()[source]

Return connection for the hook.

check_for_directory()[source]

Check if a directory exists on Azure File Share.

list_directories_and_files()[source]

Return the list of directories and files stored on a Azure File Share.

list_files()[source]

Return the list of files stored on a Azure File Share.

create_share(share_name, **kwargs)[source]

Create new Azure File Share.

Parameters

share_name (str) – Name of the share.

Returns

True if share is created, False if share already exists.

Return type

bool

delete_share(share_name, **kwargs)[source]

Delete existing Azure File Share.

Parameters

share_name (str) – Name of the share.

Returns

True if share is deleted, False if share does not exist.

Return type

bool

create_directory(**kwargs)[source]

Create a new directory on a Azure File Share.

get_file(file_path, **kwargs)[source]

Download a file from Azure File Share.

Parameters

file_path (str) – Where to store the file.

get_file_to_stream(stream, **kwargs)[source]

Download a file from Azure File Share.

Parameters

stream (IO) – A filehandle to store the file to.

load_file(file_path, **kwargs)[source]

Upload a file to Azure File Share.

Parameters

file_path (str) – Path to the file to load.

load_data(string_data, **kwargs)[source]

Upload a string to Azure File Share.

Parameters

string_data (bytes | str | IO) – String/Stream to load.

test_connection()[source]

Test Azure FileShare connection.

Was this entry helpful?