blob: 80e9f5b4abb6c1790b7d0121c6183fff86fae8aa [file] [log] [blame]
:py:mod:`airflow.providers.openfaas.hooks.openfaas`
===================================================
.. py:module:: airflow.providers.openfaas.hooks.openfaas
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.openfaas.hooks.openfaas.OpenFaasHook
Attributes
~~~~~~~~~~
.. autoapisummary::
airflow.providers.openfaas.hooks.openfaas.OK_STATUS_CODE
.. py:data:: OK_STATUS_CODE
:annotation: = 202
.. py:class:: OpenFaasHook(function_name=None, conn_id = 'open_faas_default', *args, **kwargs)
Bases: :py:obj:`airflow.hooks.base.BaseHook`
Interact with OpenFaaS to query, deploy, invoke and update function
:param function_name: Name of the function, Defaults to None
:param conn_id: openfaas connection to use, Defaults to open_faas_default
for example host : http://openfaas.faas.com, Connection Type : Http
.. py:attribute:: GET_FUNCTION
:annotation: = /system/function/
.. py:attribute:: INVOKE_ASYNC_FUNCTION
:annotation: = /async-function/
.. py:attribute:: INVOKE_FUNCTION
:annotation: = /function/
.. py:attribute:: DEPLOY_FUNCTION
:annotation: = /system/functions
.. py:attribute:: UPDATE_FUNCTION
:annotation: = /system/functions
.. py:method:: get_conn()
Returns connection for the hook.
.. py:method:: deploy_function(overwrite_function_if_exist, body)
Deploy OpenFaaS function
.. py:method:: invoke_async_function(body)
Invoking function asynchronously
.. py:method:: invoke_function(body)
Invoking function synchronously, will block until function completes and returns
.. py:method:: update_function(body)
Update OpenFaaS function
.. py:method:: does_function_exist()
Whether OpenFaaS function exists or not