src/module/module.py
file and we recommend getting familiar with Boilerplate's GitHub repo README.src/module/module.py
and avoid editing other files, so that the module remains in synchronization with weeve system. src/module/module.py
contains a module_main()
function which is responsible for module's logic. A developer should implement all necessary functionality within this function. The received or read data should be transformed into a JSON object assigned to variable input_data
that will be later sent to the next module in weeve edge application as output data. Although a module developer decides about the format of output data, any other changes to ReST API POST call should be avoided.requirements.txt
and docker/Dockerfile
should be also changed accordingly if any port bindings or mounts are required.Module.yml
file.src/module
directory (module.py
and validator.py
) and we recommend getting familiar with Boilerplate's GitHub repo README.src/module/module.py
and avoid editing other files, so that the module remains in synchronization with weeve system. src/module/module.py
contains a module_main()
function which is responsible for module's logic. After data are received by a module, they are validated (more details on validation process can be found in src/module/validator.py
and more requirements can be added by a module developer accordingly) and passed to module_main()
function. A developer should implement all necessary functionality within this function. The function returns [data, str]. Returned data should be in a form that can be later send with ReST API POST request to the next module, i.e. a single JSON object or an array of JSONs. Data returned by module_main()
will be the module's output sent to the next module with send_data()
function in src/api/send_data
in an exact form as they were returned by module's main logic. String returned by module_main()
is an error message that is logged if any error occurs during data processing.requirements.txt
and docker/Dockerfile
should be also changed accordingly if any port bindings or mounts are required.Module.yml
file.test/assets/input.json
are passed to the tested module and its output is compared with expected output data provided in test/assets/expected_output.json
. Hence, to use our automated testing pipeline a module developer needs to provide sample data in abovementioned .json
files. Please navigate to the boilerplate's README Module Testing section for more detail on running the tests.src/module/module.py
file and we recommend getting familiar with Boilerplate's GitLab repo README.src/module/module.py
and avoid editing other files, so that the module remains in synchronization with weeve system. src/module/module.py
contains a module_main()
function which is responsible for module's logic. After data are received by a module, they are validated (more details on validation process can be found in src/module/validator.py
and more requirements can be added by a module developer accordingly) and passed to module_main()
function. A developer should implement all necessary functionality within this function. In a contrast to Input Boilerplate and Processing Boilerplate, this Boilerplate does not have src/api/send_data.py
and its send_data()
function, because it is developer's responsibility to implement functionality outputting data to the final endpoint. Hence, it is a module developer responsible for creating a module that correctly interacts with a chosen endpoint API (including correct JSON body format, API URL address, headers, etc).requirements.txt
and docker/Dockerfile
should be also changed accordingly if any port bindings or mounts are required.Module.yml
file.