| :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(self) |
| |
| Returns connection for the hook. |
| |
| |
| .. py:method:: deploy_function(self, overwrite_function_if_exist, body) |
| |
| Deploy OpenFaaS function |
| |
| |
| .. py:method:: invoke_async_function(self, body) |
| |
| Invoking function asynchronously |
| |
| |
| .. py:method:: invoke_function(self, body) |
| |
| Invoking function synchronously, will block until function completes and returns |
| |
| |
| .. py:method:: update_function(self, body) |
| |
| Update OpenFaaS function |
| |
| |
| .. py:method:: does_function_exist(self) |
| |
| Whether OpenFaaS function exists or not |
| |
| |
| |