HookWorker API¶
Rest API¶
-
class
HookWorker.api.
WorkerAPI
(prefix='/hook', secret='', workers=5, redis='127.0.0.1', hooktest_path='./', app=None, name=None)[source]¶ Worker API for Capitains Hook
Parameters: - prefix – Prefix for the WorkerAPI
- secret – Salt to use in encrypting the body
- workers – Number of workers to use in HookTest
- redis – Redis Connection URL
- hooktest_path – Path where to clone the data
- app – Application object
- name – Name of the Blueprint
Variables: routes – Liste of tuples to store routes (url, function name, [Methods])
-
WorkerAPI.
init_app
(app)[source]¶ Register the blueprint to the app
Parameters: app – Flask Application Returns: Blueprint for HookWorker registered in app Return type: Blueprint
Controller¶
Routes¶
Server Helper¶
-
HookWorker.api.
set_logging
(level, name, path, logger)[source]¶ Reroute logging of tornado into specified file with a RotatingFileHandler
Parameters: - level (str) – Level of logging
- name – Name of logs file
- path – Path where to store the logs file
- logger – logging.logger object of Tonardo
-
HookWorker.api.
run
(secret='', debug=False, port=5000, path='./hook.worker.api.log/', level='WARNING', git='./hooktest', workers=5)[source]¶ Set up a Tornado process around a flask app for quick run of the WorkerAPI Blueprint
Parameters: - secret – Salt to use in encrypting the body
- debug – Set Flask App in debug Mode
- port – Port to use for Flask App
- path – Path where to store the logs
- level – Level of Log
- git – Pather where to clone the data
- workers – Number of worker to use for HookTest runs