airflow.providers.samba.hooks.samba

Module Contents

Classes

SambaHook

Allows for interaction with a Samba server.

class airflow.providers.samba.hooks.samba.SambaHook(samba_conn_id=default_conn_name, share=None)[source]

Bases: airflow.hooks.base.BaseHook

Allows for interaction with a Samba server.

The hook should be used as a context manager in order to correctly set up a session and disconnect open connections upon exit.

Parameters
  • samba_conn_id (str) – The connection id reference.

  • share (str | None) – An optional share name. If this is unset then the “schema” field of the connection is used in its place.

conn_name_attr = 'samba_conn_id'[source]
default_conn_name = 'samba_default'[source]
conn_type = 'samba'[source]
hook_name = 'Samba'[source]
__enter__()[source]
__exit__(exc_type, exc_value, traceback)[source]
listdir(path)[source]
lstat(path)[source]
makedirs(path, exist_ok=False)[source]
mkdir(path)[source]
open_file(path, mode='r', buffering=-1, encoding=None, errors=None, newline=None, share_access=None, desired_access=None, file_attributes=None, file_type='file')[source]
remove(path)[source]
removedirs(path)[source]
rename(src, dst)[source]
replace(src, dst)[source]
rmdir(path)[source]
scandir(path, search_pattern='*')[source]
stat(path, follow_symlinks=True)[source]
stat_volume(path)[source]
truncate(path, length)[source]
utime(path, times=None, ns=None, follow_symlinks=True)[source]
walk(path, topdown=True, onerror=None, follow_symlinks=False)[source]
getxattr(path, attribute, follow_symlinks=True)[source]
listxattr(path, follow_symlinks=True)[source]
removexattr(path, attribute, follow_symlinks=True)[source]
setxattr(path, attribute, value, flags=0, follow_symlinks=True)[source]
push_from_local(destination_filepath, local_filepath, buffer_size=None)[source]

Push local file to samba server.

Parameters
  • destination_filepath (str) – the samba location to push to

  • local_filepath (str) – the file to push

  • buffer_size (int | None) – size in bytes of the individual chunks of file to send. Larger values may speed up large file transfers

classmethod get_ui_field_behaviour()[source]

Return custom field behaviour.

Was this entry helpful?