blob: 038db9e2253838edf339a261e8ba81e06c36ec70 [file] [log] [blame]
:mod:`airflow.models.variable`
==============================
.. py:module:: airflow.models.variable
Module Contents
---------------
.. py:class:: Variable
Bases: :class:`airflow.models.base.Base`, :class:`airflow.utils.log.logging_mixin.LoggingMixin`
.. attribute:: __tablename__
:annotation: = variable
.. attribute:: __NO_DEFAULT_SENTINEL
.. attribute:: id
.. attribute:: key
.. attribute:: _val
.. attribute:: is_encrypted
.. attribute:: val
.. method:: __repr__(self)
.. method:: get_val(self)
.. method:: set_val(self, value)
.. classmethod:: setdefault(cls, key, default, deserialize_json=False)
Like a Python builtin dict object, setdefault returns the current value
for a key, and if it isn't there, stores the default value and returns it.
:param key: Dict key for this Variable
:type key: str
:param default: Default value to set and return if the variable
isn't already in the DB
:type default: Mixed
:param deserialize_json: Store this as a JSON encoded value in the DB
and un-encode it when retrieving a value
:return: Mixed
.. classmethod:: get(cls, key, default_var=__NO_DEFAULT_SENTINEL, deserialize_json=False, session=None)
.. classmethod:: set(cls, key, value, serialize_json=False, session=None)
.. classmethod:: delete(cls, key, session=None)
.. method:: rotate_fernet_key(self)