:py:mod:`astronomer.providers.sftp.hooks.sftp` ============================================== .. py:module:: astronomer.providers.sftp.hooks.sftp Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.sftp.hooks.sftp.SFTPHookAsync .. py:class:: SFTPHookAsync(sftp_conn_id = default_conn_name, host = '', port = 22, username = '', password = '', known_hosts = default_known_hosts, key_file = '', passphrase = '', private_key = '') Bases: :py:obj:`airflow.hooks.base.BaseHook` Interact with an SFTP server via asyncssh package :param sftp_conn_id: SFTP connection ID to be used for connecting to SFTP server :param host: hostname of the SFTP server :param port: port of the SFTP server :param username: username used when authenticating to the SFTP server :param password: password used when authenticating to the SFTP server Can be left blank if using a key file :param known_hosts: path to the known_hosts file on the local file system If known_hosts is set to the literal "none", then no host verification is performed :param key_file: path to the client key file used for authentication to SFTP server :param passphrase: passphrase used with the key_file for authentication to SFTP server .. py:attribute:: conn_name_attr :annotation: = ssh_conn_id .. py:attribute:: default_conn_name :annotation: = sftp_default .. py:attribute:: conn_type :annotation: = sftp .. py:attribute:: hook_name :annotation: = SFTP .. py:attribute:: default_known_hosts :annotation: = "~/.ssh/known_hosts" .. py:method:: list_directory(path = '') :async: Returns a list of files on the SFTP server at the provided path .. py:method:: get_file_by_pattern(path = '', fnmatch_pattern = '') :async: Returns the name of a file matching the file pattern at the provided path, if one exists Otherwise, raises an AirflowException to be handled upstream for deferring .. py:method:: get_mod_time(path) :async: Makes SFTP async connection and looks for last modified time in the specific file path and returns last modification time for the file path. :param path: full path to the remote file