Function overview

Generate overview of your scripts
  • Create a new script file that has the contents of the above script in your 'myfunctions' folder.
  • In the root of your project create a script overview.py. This script will give us an overview of all our created scripts.
  • The contents of your overview.py should be as follows:
#!/bin/env python
from openobd import *
from openobd.functions.function_launcher import FunctionLauncher

arguments = Arguments(modules=['myfunctions'])
launcher = FunctionLauncher(arguments)

logging.info(launcher.function_executor)
  • When you have no shell, click the tab 'Tools & files' and search for 'shell', click on 'shell'
  • Now make sure that your overview.py is executable. In your console type: chmod 755 overview.py.
  • Execute the overview.py script by entering it on the console as follows ./overview.py

Overview

  • The output should show you an overview of the scripts in your myfunctions folder.
Generate fresh signatures for your scripts
  • Create a new script file that has the contents of the above script in your 'myfunctions' folder.
  • In the root of your project create a script fresh_signatures.py. This script will always generate fresh signatures of all our created scripts.
  • The contents of your fresh_signatures.py should be as follows, it only adds the 'unique=True' flag to indicate that it needs unique new id's and signatures:
#!/bin/env python
from openobd import *
from openobd.functions.function_launcher import FunctionLauncher

arguments = Arguments(modules=['myfunctions'], unique=True)
launcher = FunctionLauncher(arguments)

logging.info(launcher.function_executor)
  • When you have no shell, click the tab 'Tools & files' and search for 'shell', click on 'shell'
  • Now make sure that your fresh_signatures.py is executable. In your console type: chmod 755 fresh_signatures.py.
  • Execute the fresh_signatures.py script by entering it on the console as follows ./fresh_signatures.py
  • For any of your created scripts you can now use the freshly generated id and signatures. These are needed to 'serve' your functions to the function broker The function broker will check the validity when you try to register them to the broker.