Create a custom operation which will map the operation to a thin-edge.io workflow (operation).
The following components must be installed for the scripts to work.
- jq
- tedge (>= 1.3.1-88-g09c1d4c)
The following steps describe the flow from the cloud to the device:
tedge-mapper-c8y
receives an operation on thec8y/devicecontrol/notifications
topic (as json)tedge-mapper-c8y
executes theexec.command
command on any cloud operation definitions that match on the givenon_fragment
(e.g. in this example, and operation with thec8y_Command
fragment will trigger the/etc/tedge/operations/c8y/c8y_Command
operation definition)create_workflow_command.sh
is executed (passing the operation json payload as the first argument). The script then maps the cloud operation data format to a local format (which is defined by the given workflow, e.g./etc/tedge/operations/shell_execute.toml
.create_workflow_command.sh
will wait until the workflow has finished processing, and then exit.
- In thin-edge.io 1.4.0, the need for the
create_workflow_command.sh
script will go away, as thin-edge.io will be capable of mapping the incoming cloud operation to a workflow for the targeted device (so it works for both main and child devices).