blob: 4fb47b1c022a34ec19c03962cdddbc5a7df4deec [file] [log] [blame]
:py:mod:`airflow.secrets.base_secrets`
======================================
.. py:module:: airflow.secrets.base_secrets
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.secrets.base_secrets.BaseSecretsBackend
.. py:class:: BaseSecretsBackend
Bases: :py:obj:`abc.ABC`
Abstract base class to retrieve Connection object given a conn_id or Variable given a key
.. py:method:: build_path(path_prefix, secret_id, sep = '/')
:staticmethod:
Given conn_id, build path for Secrets Backend
:param path_prefix: Prefix of the path to get secret
:param secret_id: Secret id
:param sep: separator used to concatenate connections_prefix and conn_id. Default: "/"
.. py:method:: get_conn_value(conn_id)
:abstractmethod:
Retrieve from Secrets Backend a string value representing the Connection object.
If the client your secrets backend uses already returns a python dict, you should override
``get_connection`` instead.
:param conn_id: connection id
.. py:method:: deserialize_connection(conn_id, value)
Given a serialized representation of the airflow Connection, return an instance.
Looks at first character to determine how to deserialize.
:param conn_id: connection id
:param value: the serialized representation of the Connection object
:return: the deserialized Connection
.. py:method:: get_conn_uri(conn_id)
:abstractmethod:
Get conn_uri from Secrets Backend
This method is deprecated and will be removed in a future release; implement ``get_conn_value``
instead.
:param conn_id: connection id
.. 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)
:abstractmethod:
Return value for Airflow Variable
:param key: Variable Key
:return: Variable Value
.. py:method:: get_config(key)
Return value for Airflow Config Key
:param key: Config Key
:return: Config Value