airflow.providers.openfaas.hooks.openfaas

Module Contents

airflow.providers.openfaas.hooks.openfaas.OK_STATUS_CODE = 202[source]
class airflow.providers.openfaas.hooks.openfaas.OpenFaasHook(function_name=None, conn_id: str = 'open_faas_default', *args, **kwargs)[source]

Bases: airflow.hooks.base.BaseHook

Interact with OpenFaaS to query, deploy, invoke and update function

Parameters
  • function_name (str) -- Name of the function, Defaults to None

  • conn_id (str) -- openfaas connection to use, Defaults to open_faas_default for example host : http://openfaas.faas.com, Conn Type : Http

GET_FUNCTION = /system/function/[source]
INVOKE_ASYNC_FUNCTION = /async-function/[source]
DEPLOY_FUNCTION = /system/functions[source]
UPDATE_FUNCTION = /system/functions[source]
get_conn(self)[source]
deploy_function(self, overwrite_function_if_exist: bool, body: Dict[str, Any])[source]

Deploy OpenFaaS function

invoke_async_function(self, body: Dict[str, Any])[source]

Invoking function

update_function(self, body: Dict[str, Any])[source]

Update OpenFaaS function

does_function_exist(self)[source]

Whether OpenFaaS function exists or not

Was this entry helpful?