| :mod:`airflow.contrib.hooks.openfaas_hook` |
| ========================================== |
| |
| .. py:module:: airflow.contrib.hooks.openfaas_hook |
| |
| |
| Module Contents |
| --------------- |
| |
| .. data:: OK_STATUS_CODE |
| :annotation: = 202 |
| |
| |
| |
| .. py:class:: OpenFaasHook(function_name=None, conn_id='open_faas_default', *args, **kwargs) |
| |
| Bases: :class:`airflow.hooks.base_hook.BaseHook` |
| |
| Interact with OpenFaaS to query, deploy, invoke and update function |
| |
| :param function_name: Name of the function, Defaults to None |
| :type query: str |
| :param conn_id: openfass connection to use, Defaults to open_faas_default |
| for example host : http://openfaas.faas.com, Conn Type : Http |
| :type conn_id: str |
| |
| .. attribute:: GET_FUNCTION |
| :annotation: = /system/function/ |
| |
| |
| |
| .. attribute:: INVOKE_ASYNC_FUNCTION |
| :annotation: = /async-function/ |
| |
| |
| |
| .. attribute:: DEPLOY_FUNCTION |
| :annotation: = /system/functions |
| |
| |
| |
| .. attribute:: UPDATE_FUNCTION |
| :annotation: = /system/functions |
| |
| |
| |
| |
| .. method:: get_conn(self) |
| |
| |
| |
| |
| .. method:: deploy_function(self, overwrite_function_if_exist, body) |
| |
| |
| |
| |
| .. method:: invoke_async_function(self, body) |
| |
| |
| |
| |
| .. method:: update_function(self, body) |
| |
| |
| |
| |
| .. method:: does_function_exist(self) |
| |
| |
| |
| |