airflow.providers.openfaas.hooks.openfaas

Module Contents

Classes

OpenFaasHook

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

Attributes

OK_STATUS_CODE

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

Bases: airflow.hooks.base.BaseHook

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

Parameters
  • function_name – 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, Connection Type : Http

GET_FUNCTION = /system/function/[source]
INVOKE_ASYNC_FUNCTION = /async-function/[source]
INVOKE_FUNCTION = /function/[source]
DEPLOY_FUNCTION = /system/functions[source]
UPDATE_FUNCTION = /system/functions[source]
get_conn()[source]

Returns connection for the hook.

deploy_function(overwrite_function_if_exist, body)[source]

Deploy OpenFaaS function

invoke_async_function(body)[source]

Invoking function asynchronously

invoke_function(body)[source]

Invoking function synchronously, will block until function completes and returns

update_function(body)[source]

Update OpenFaaS function

does_function_exist()[source]

Whether OpenFaaS function exists or not

Was this entry helpful?