blob: 07ac2815dbbf160e1b10d869c47a40d830a1ec86 [file] [log] [blame]
:py:mod:`airflow.secrets.local_filesystem`
==========================================
.. py:module:: airflow.secrets.local_filesystem
.. autoapi-nested-parse::
Objects relating to retrieving connections and variables from local file
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.secrets.local_filesystem.LocalFilesystemBackend
Functions
~~~~~~~~~
.. autoapisummary::
airflow.secrets.local_filesystem.get_connection_parameter_names
airflow.secrets.local_filesystem.load_variables
airflow.secrets.local_filesystem.load_connections
airflow.secrets.local_filesystem.load_connections_dict
Attributes
~~~~~~~~~~
.. autoapisummary::
airflow.secrets.local_filesystem.log
airflow.secrets.local_filesystem.FILE_PARSERS
.. py:data:: log
.. py:function:: get_connection_parameter_names()
Returns :class:`airflow.models.connection.Connection` constructor parameters.
.. py:data:: FILE_PARSERS
.. py:function:: load_variables(file_path)
Load variables from a text file.
``JSON``, `YAML` and ``.env`` files are supported.
:param file_path: The location of the file that will be processed.
:rtype: Dict[str, List[str]]
.. py:function:: load_connections(file_path)
This function is deprecated. Please use `airflow.secrets.local_filesystem.load_connections_dict`.",
.. py:function:: load_connections_dict(file_path)
Load connection from text file.
``JSON``, `YAML` and ``.env`` files are supported.
:return: A dictionary where the key contains a connection ID and the value contains the connection.
:rtype: Dict[str, airflow.models.connection.Connection]
.. py:class:: LocalFilesystemBackend(variables_file_path = None, connections_file_path = None)
Bases: :py:obj:`airflow.secrets.base_secrets.BaseSecretsBackend`, :py:obj:`airflow.utils.log.logging_mixin.LoggingMixin`
Retrieves Connection objects and Variables from local files
``JSON``, `YAML` and ``.env`` files are supported.
:param variables_file_path: File location with variables data.
:param connections_file_path: File location with connection data.
.. py:method:: get_connection(conn_id)
Return connection object with a given ``conn_id``.
Tries ``get_conn_value`` first and if not implemented, tries ``get_conn_uri``
:param conn_id: connection id
.. py:method:: get_connections(conn_id)
Return connection object with a given ``conn_id``.
:param conn_id: connection id
.. py:method:: get_variable(key)
Return value for Airflow Variable
:param key: Variable Key
:return: Variable Value