You can find:
- [highly recommended] Eclipse Ditto v 2.4 documentation here to understand the operations carried out below but also to understand how to do other operations.
- Eclipse Ditto repository here.
- Examples of using Eclipse Ditto here.
- Open a new terminal and go in
AI_WATCH_B1/ditto_kafka/commands
- Create a new policy
curl -X PUT 'http://localhost:8080/api/2/policies/aiwatch:policy' -u 'ditto:ditto' -H 'Content-Type: application/json' -d @policy.json
- Create a new digital twin
curl -X PUT 'http://localhost:8080/api/2/things/digitaltwin:Laboratorio_Corridoio' -u 'ditto:ditto' -H 'Content-Type: application/json' -d @digitaltwin.json
- Create a new kafka connection source from user "nginx:ditto" (A1 Module - Tracker)
curl -X POST 'http://localhost:8080/devops/piggyback/connectivity?timeout=10' -u 'devops:foobar' -H 'Content-Type: application/json' -d @create_connectionSource.json
- Create a new kafka connection target to user "ditto:observer" (Software streaming anomaly detector)
curl -X POST 'http://localhost:8080/devops/piggyback/connectivity?timeout=10' -u 'devops:foobar' -H 'Content-Type: application/json' -d @create_connectionTarget.json
Below is shown on several lines the mapping function "mapToDittoProtocolMsg()" in javascript of the file connectionSource.json
AI_Watch_B1/ditto_kafka/commands/[VIEW ONLY] mappingsource.js
Lines 3 to 15 in 8be8fbd
Below is shown on several lines the mapping function "mapFromDittoProtocolMsg()" in javascript of the file connectionTarget.json
AI_Watch_B1/ditto_kafka/commands/[VIEW ONLY] mappingtarget.js
Lines 3 to 9 in 8be8fbd