airflow.contrib.hooks.azure_fileshare_hook
¶
Module Contents¶
-
class
airflow.contrib.hooks.azure_fileshare_hook.
AzureFileShareHook
(wasb_conn_id='wasb_default')[source]¶ Bases:
airflow.hooks.base_hook.BaseHook
Interacts with Azure FileShare Storage.
Additional options passed in the ‘extra’ field of the connection will be passed to the FileService() constructor.
- Parameters
wasb_conn_id (str) – Reference to the wasb connection.
-
check_for_directory
(self, share_name, directory_name, **kwargs)[source]¶ Check if a directory exists on Azure File Share.
-
check_for_file
(self, share_name, directory_name, file_name, **kwargs)[source]¶ Check if a file exists on Azure File Share.
-
list_directories_and_files
(self, share_name, directory_name=None, **kwargs)[source]¶ Return the list of directories and files stored on a Azure File Share.
-
create_directory
(self, share_name, directory_name, **kwargs)[source]¶ Create a new directory on a Azure File Share.
-
get_file
(self, file_path, share_name, directory_name, file_name, **kwargs)[source]¶ Download a file from Azure File Share.
-
get_file_to_stream
(self, stream, share_name, directory_name, file_name, **kwargs)[source]¶ Download a file from Azure File Share.
-
load_file
(self, file_path, share_name, directory_name, file_name, **kwargs)[source]¶ Upload a file to Azure File Share.
-
load_string
(self, string_data, share_name, directory_name, file_name, **kwargs)[source]¶ Upload a string to Azure File Share.
-
load_stream
(self, stream, share_name, directory_name, file_name, count, **kwargs)[source]¶ Upload a stream to Azure File Share.
- Parameters
stream (file-like) – Opened file/stream to upload as the file content.
share_name (str) – Name of the share.
directory_name (str) – Name of the directory.
file_name (str) – Name of the file.
count (int) – Size of the stream in bytes
kwargs (object) – Optional keyword arguments that FileService.create_file_from_stream() takes.
Was this entry helpful?