Skip to content

Commit

Permalink
Add documentation for packages - 2022-07-17 (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
potiuk committed Jul 20, 2022
1 parent 5412fb4 commit 988ae48
Show file tree
Hide file tree
Showing 123 changed files with 63,480 additions and 298 deletions.
4 changes: 4 additions & 0 deletions docs-archive/apache-airflow-providers-sftp/4.0.0/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a5f359f6e2aa121c1f22b91c725278e8
tags: 645f666f9bcd5a90fca523b33c5a78b7

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

800 changes: 800 additions & 0 deletions docs-archive/apache-airflow-providers-sftp/4.0.0/_modules/index.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:py:mod:`airflow.providers.sftp.hooks`
======================================

.. py:module:: airflow.providers.sftp.hooks
Submodules
----------
.. toctree::
:titlesonly:
:maxdepth: 1

sftp/index.rst


Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
:py:mod:`airflow.providers.sftp.hooks.sftp`
===========================================

.. py:module:: airflow.providers.sftp.hooks.sftp
.. autoapi-nested-parse::

This module contains SFTP hook.



Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

airflow.providers.sftp.hooks.sftp.SFTPHook




.. py:class:: SFTPHook(ssh_conn_id = 'sftp_default', ssh_hook = None, *args, **kwargs)
Bases: :py:obj:`airflow.providers.ssh.hooks.ssh.SSHHook`

This hook is inherited from SSH hook. Please refer to SSH hook for the input
arguments.

Interact with SFTP.

:Pitfalls::

- In contrast with FTPHook describe_directory only returns size, type and
modify. It doesn't return unix.owner, unix.mode, perm, unix.group and
unique.
- retrieve_file and store_file only take a local full path and not a
buffer.
- If no mode is passed to create_directory it will be created with 777
permissions.

Errors that may occur throughout but should be handled downstream.

For consistency reasons with SSHHook, the preferred parameter is "ssh_conn_id".

:param ssh_conn_id: The :ref:`sftp connection id<howto/connection:sftp>`
:param ssh_hook: Optional SSH hook (included to support passing of an SSH hook to the SFTP operator)

.. 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:method:: get_ui_field_behaviour()
:staticmethod:

Returns custom field behaviour


.. py:method:: get_conn(self)
Opens an SFTP connection to the remote host

:rtype: paramiko.SFTPClient


.. py:method:: close_conn(self)
Closes the SFTP connection


.. py:method:: describe_directory(self, path)
Returns a dictionary of {filename: {attributes}} for all files
on the remote system (where the MLSD command is supported).

:param path: full path to the remote directory


.. py:method:: list_directory(self, path)
Returns a list of files on the remote system.

:param path: full path to the remote directory to list


.. py:method:: mkdir(self, path, mode = 777)
Creates a directory on the remote system.

:param path: full path to the remote directory to create
:param mode: permissions to set the directory with


.. py:method:: isdir(self, path)
Checks if the path provided is a directory or not.

:param path: full path to the remote directory to check


.. py:method:: isfile(self, path)
Checks if the path provided is a file or not.

:param path: full path to the remote file to check


.. py:method:: create_directory(self, path, mode = 777)
Creates a directory on the remote system.

:param path: full path to the remote directory to create
:param mode: int representation of octal mode for directory


.. py:method:: delete_directory(self, path)
Deletes a directory on the remote system.

:param path: full path to the remote directory to delete


.. py:method:: retrieve_file(self, remote_full_path, local_full_path)
Transfers the remote file to a local location.
If local_full_path is a string path, the file will be put
at that location

:param remote_full_path: full path to the remote file
:param local_full_path: full path to the local file


.. py:method:: store_file(self, remote_full_path, local_full_path, confirm = True)
Transfers a local file to the remote location.
If local_full_path_or_buffer is a string path, the file will be read
from that location

:param remote_full_path: full path to the remote file
:param local_full_path: full path to the local file


.. py:method:: delete_file(self, path)
Removes a file on the FTP Server

:param path: full path to the remote file


.. py:method:: get_mod_time(self, path)
Returns modification time.

:param path: full path to the remote file


.. py:method:: path_exists(self, path)
Returns True if a remote entity exists

:param path: full path to the remote file or directory


.. py:method:: walktree(self, path, fcallback, dcallback, ucallback, recurse = True)
Recursively descend, depth first, the directory tree rooted at
path, calling discreet callback functions for each regular file,
directory and unknown file type.

:param str path:
root of remote directory to descend, use '.' to start at
:attr:`.pwd`
:param callable fcallback:
callback function to invoke for a regular file.
(form: ``func(str)``)
:param callable dcallback:
callback function to invoke for a directory. (form: ``func(str)``)
:param callable ucallback:
callback function to invoke for an unknown file type.
(form: ``func(str)``)
:param bool recurse: *Default: True* - should it recurse

:returns: None


.. py:method:: get_tree_map(self, path, prefix = None, delimiter = None)
Return tuple with recursive lists of files, directories and unknown paths from given path.
It is possible to filter results by giving prefix and/or delimiter parameters.

:param path: path from which tree will be built
:param prefix: if set paths will be added if start with prefix
:param delimiter: if set paths will be added if end with delimiter
:return: tuple with list of files, dirs and unknown items
:rtype: Tuple[List[str], List[str], List[str]]


.. py:method:: test_connection(self)
Test the SFTP connection by calling path with directory


.. py:method:: get_file_by_pattern(self, path, fnmatch_pattern)
Returning the first matching file based on the given fnmatch type pattern

:param path: path to be checked
:param fnmatch_pattern: The pattern that will be matched with `fnmatch`
:return: string containing the first found file, or an empty string if none matched



Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:py:mod:`airflow.providers.sftp`
================================

.. py:module:: airflow.providers.sftp
Subpackages
-----------
.. toctree::
:titlesonly:
:maxdepth: 3

hooks/index.rst
operators/index.rst
sensors/index.rst


Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:py:mod:`airflow.providers.sftp.operators`
==========================================

.. py:module:: airflow.providers.sftp.operators
Submodules
----------
.. toctree::
:titlesonly:
:maxdepth: 1

sftp/index.rst


Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
:py:mod:`airflow.providers.sftp.operators.sftp`
===============================================

.. py:module:: airflow.providers.sftp.operators.sftp
.. autoapi-nested-parse::

This module contains SFTP operator.



Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

airflow.providers.sftp.operators.sftp.SFTPOperation
airflow.providers.sftp.operators.sftp.SFTPOperator




.. py:class:: SFTPOperation
Operation that can be used with SFTP

.. py:attribute:: PUT
:annotation: = put



.. py:attribute:: GET
:annotation: = get




.. py:class:: SFTPOperator(*, ssh_hook = None, sftp_hook = None, ssh_conn_id = None, remote_host = None, local_filepath, remote_filepath, operation = SFTPOperation.PUT, confirm = True, create_intermediate_dirs = False, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`

SFTPOperator for transferring files from remote host to local or vice a versa.
This operator uses sftp_hook to open sftp transport channel that serve as basis
for file transfer.

:param ssh_conn_id: :ref:`ssh connection id<howto/connection:ssh>`
from airflow Connections. `ssh_conn_id` will be ignored if `ssh_hook`
or `sftp_hook` is provided.
:param sftp_hook: predefined SFTPHook to use
Either `sftp_hook` or `ssh_conn_id` needs to be provided.
:param ssh_hook: Deprecated - predefined SSHHook to use for remote execution
Use `sftp_hook` instead.
:param remote_host: remote host to connect (templated)
Nullable. If provided, it will replace the `remote_host` which was
defined in `sftp_hook`/`ssh_hook` or predefined in the connection of `ssh_conn_id`.
:param local_filepath: local file path to get or put. (templated)
:param remote_filepath: remote file path to get or put. (templated)
:param operation: specify operation 'get' or 'put', defaults to put
:param confirm: specify if the SFTP operation should be confirmed, defaults to True
:param create_intermediate_dirs: create missing intermediate directories when
copying from remote to local and vice-versa. Default is False.

Example: The following task would copy ``file.txt`` to the remote host
at ``/tmp/tmp1/tmp2/`` while creating ``tmp``,``tmp1`` and ``tmp2`` if they
don't exist. If the parameter is not passed it would error as the directory
does not exist. ::

put_file = SFTPOperator(
task_id="test_sftp",
ssh_conn_id="ssh_default",
local_filepath="/tmp/file.txt",
remote_filepath="/tmp/tmp1/tmp2/file.txt",
operation="put",
create_intermediate_dirs=True,
dag=dag
)


.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['local_filepath', 'remote_filepath', 'remote_host']



.. py:method:: execute(self, context)
This is the main method to derive when creating an operator.
Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.



Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:py:mod:`airflow.providers.sftp.sensors`
========================================

.. py:module:: airflow.providers.sftp.sensors
Submodules
----------
.. toctree::
:titlesonly:
:maxdepth: 1

sftp/index.rst


Loading

0 comments on commit 988ae48

Please sign in to comment.