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-c8yreceives an operation on thec8y/devicecontrol/notificationstopic (as json)tedge-mapper-c8yexecutes theexec.commandcommand on any cloud operation definitions that match on the givenon_fragment(e.g. in this example, and operation with thec8y_Commandfragment will trigger the/etc/tedge/operations/c8y/c8y_Commandoperation definition)create_workflow_command.shis 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.shwill wait until the workflow has finished processing, and then exit.
- In thin-edge.io 1.4.0, the need for the
create_workflow_command.shscript 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).