airflow.providers.samba.hooks.samba

SambaHook

允许与 Samba 服务器交互。

模块内容

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

基类: airflow.hooks.base.BaseHook

允许与 Samba 服务器交互。

该 Hook 应该作为上下文管理器使用,以便正确设置会话并在退出时断开打开的连接。

参数:
  • samba_conn_id (str) – 连接 ID 引用。

  • share (str | None) – 可选的共享名称。如果未设置此项,则使用连接的“schema”字段代替。

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]

将本地文件推送到 Samba 服务器。

参数:
  • destination_filepath (str) – 要推送到的 Samba 位置

  • local_filepath (str) – 要推送的文件

  • buffer_size (int | None) – 要发送的文件块的字节大小。较大的值可以加快大文件传输速度

classmethod get_ui_field_behaviour()[source]

返回自定义字段行为。

此条目有用吗?