iotagent-node-lib 2.20.0 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.nyc_output/6e3d7795-bf8c-4a50-bd2f-f8221f27aeae.json +1 -0
  2. package/.nyc_output/processinfo/6e3d7795-bf8c-4a50-bd2f-f8221f27aeae.json +1 -0
  3. package/.nyc_output/processinfo/index.json +1 -1
  4. package/.readthedocs.yml +3 -1
  5. package/CHANGES_NEXT_RELEASE +1 -0
  6. package/README.md +2 -2
  7. package/config +0 -0
  8. package/doc/Contribution.md +3 -3
  9. package/doc/advanced-topics.md +19 -8
  10. package/doc/api.md +14 -3
  11. package/doc/expressionLanguage.md +17 -0
  12. package/doc/northboundinteractions.md +40 -33
  13. package/doc/operations.md +8 -5
  14. package/doc/requirements.txt +4 -0
  15. package/{docs → doc}/roadmap.md +21 -6
  16. package/doc/usermanual.md +4 -4
  17. package/docker/Mosquitto/Dockerfile +28 -12
  18. package/docker/Mosquitto/Dockerfile.debian +38 -0
  19. package/docker/Mosquitto/Dockerfile.debian~ +23 -0
  20. package/docker/Mosquitto/README.md +8 -7
  21. package/docker/Mosquitto/startMosquitto.sh +8 -0
  22. package/lib/fiware-iotagent-lib.js +1 -0
  23. package/lib/jexlTranformsMap.js +3 -1
  24. package/lib/model/Group.js +2 -1
  25. package/lib/model/dbConn.js +4 -0
  26. package/lib/plugins/expressionPlugin.js +56 -21
  27. package/lib/plugins/multiEntity.js +43 -49
  28. package/lib/plugins/multiEntity.js_avg2 +343 -0
  29. package/lib/plugins/pluginUtils.js +16 -0
  30. package/lib/services/commands/commandService.js +29 -2
  31. package/lib/services/common/iotManagerService.js +2 -1
  32. package/lib/services/devices/deviceRegistryMemory.js +13 -2
  33. package/lib/services/devices/deviceRegistryMongoDB.js +15 -7
  34. package/lib/services/devices/deviceService.js +52 -16
  35. package/lib/services/groups/groupRegistryMongoDB.js +13 -12
  36. package/lib/services/ngsi/entities-NGSI-LD.js +13 -4
  37. package/lib/services/ngsi/entities-NGSI-v2.js +64 -13
  38. package/lib/services/ngsi/ngsiService.js +3 -3
  39. package/lib/services/northBound/contextServer-NGSI-LD.js +20 -1
  40. package/lib/services/northBound/contextServer-NGSI-v2.js +39 -30
  41. package/lib/services/northBound/contextServerUtils.js +10 -10
  42. package/lib/services/northBound/deviceProvisioningServer.js +4 -1
  43. package/lib/templates/createDevice.json +13 -2
  44. package/lib/templates/createDeviceLax.json +2 -3
  45. package/lib/templates/updateDevice.json +13 -2
  46. package/package.json +26 -26
  47. package/test/unit/examples/deviceProvisioningRequests/provisionMinimumDevice4.json +14 -0
  48. package/test/unit/mongodb/mongoDBUtils.js +2 -2
  49. package/test/unit/mongodb/mongodb-group-registry-test.js +1 -1
  50. package/test/unit/mongodb/mongodb-registry-test.js +2 -3
  51. package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgentCommands.json +2 -1
  52. package/test/unit/ngsi-ld/examples/contextRequests/updateContextLanguageProperties1.json +15 -0
  53. package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +315 -1
  54. package/test/unit/ngsi-ld/ngsiService/languageProperties-test.js +112 -0
  55. package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +1 -1
  56. package/test/unit/ngsiv2/examples/contextRequests/createMinimumProvisionedDevice4.json +8 -0
  57. package/test/unit/ngsiv2/examples/contextRequests/updateContextCommandStatus2.json +6 -0
  58. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin35.json +2 -0
  59. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin36.json +12 -0
  60. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin17.json +27 -0
  61. package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +72 -9
  62. package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +151 -0
  63. package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +63 -0
  64. package/test/unit/ngsiv2/plugins/multientity-plugin_test.js_avg2 +1224 -0
  65. package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +60 -0
  66. package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +2 -1
  67. package/.nyc_output/76bc24ff-5fac-4b5a-997d-de2799342eb0.json +0 -1
  68. package/.nyc_output/processinfo/76bc24ff-5fac-4b5a-997d-de2799342eb0.json +0 -1
@@ -0,0 +1 @@
1
+ {"parent":null,"pid":14053,"argv":["/usr/bin/node","/home/avega/tid/fiware/iotagent-node-lib/node_modules/.bin/mocha","--recursive","test/**/*.js","--reporter","spec","--timeout","8000","--ui","bdd","--exit","--color","true"],"execArgv":[],"cwd":"/home/avega/tid/fiware/iotagent-node-lib","time":1658386273873,"ppid":14040,"coverageFilename":"/home/avega/tid/fiware/iotagent-node-lib/.nyc_output/6e3d7795-bf8c-4a50-bd2f-f8221f27aeae.json","externalId":"","uuid":"6e3d7795-bf8c-4a50-bd2f-f8221f27aeae","files":["/home/avega/tid/fiware/iotagent-node-lib/lib/fiware-iotagent-lib.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/ngsiService.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/domain.js","/home/avega/tid/fiware/iotagent-node-lib/lib/constants.js","/home/avega/tid/fiware/iotagent-node-lib/lib/errors.js","/home/avega/tid/fiware/iotagent-node-lib/lib/commonConfig.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/ngsiUtils.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/genericMiddleware.js","/home/avega/tid/fiware/iotagent-node-lib/lib/model/dbConn.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/alarmManagement.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/subscriptionService.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/stats/statsRegistry.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/deviceService.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/groups/groupService.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/iotManagerService.js","/home/avega/tid/fiware/iotagent-node-lib/lib/request-shim.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/registrationUtils.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/restUtils.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/expressionPlugin.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/expressionParser.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/jexlParser.js","/home/avega/tid/fiware/iotagent-node-lib/lib/jexlTranformsMap.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/pluginUtils.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/commands/commandService.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/northboundServer.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServer.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServerUtils.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/deviceProvisioningServer.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/deviceGroupAdministrationServer.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/compressTimestamp.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/attributeAlias.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/addEvent.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/timestampProcessPlugin.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/multiEntity.js","/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/bidirectionalData.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/groups/groupRegistryMemory.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/securityServiceKeystone.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/deviceRegistryMemory.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/commands/commandRegistryMemory.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/devices-NGSI-v2.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/entities-NGSI-v2.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-v2.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-v2.js","/home/avega/tid/fiware/iotagent-node-lib/lib/model/Device.js","/home/avega/tid/fiware/iotagent-node-lib/lib/model/Group.js","/home/avega/tid/fiware/iotagent-node-lib/lib/model/Command.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/deviceRegistryMongoDB.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/groups/groupRegistryMongoDB.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/commands/commandRegistryMongoDB.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/devices-NGSI-LD.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/entities-NGSI-LD.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-LD.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-LD.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/securityServiceOAuth2.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/devices-NGSI-mixed.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-mixed.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-mixed.js","/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/entities-NGSI-mixed.js"]}
@@ -1 +1 @@
1
- {"processes":{"76bc24ff-5fac-4b5a-997d-de2799342eb0":{"parent":null,"children":[]}},"files":{"/home/fermin/src/iotagent-node-lib/lib/fiware-iotagent-lib.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/ngsiService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/domain.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/constants.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/errors.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/commonConfig.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/ngsiUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/genericMiddleware.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/model/dbConn.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/alarmManagement.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscriptionService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/stats/statsRegistry.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/groups/groupService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/iotManagerService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/request-shim.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/registrationUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/restUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/commands/commandService.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/northboundServer.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServerUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/deviceProvisioningServer.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/deviceGroupAdministrationServer.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/compressTimestamp.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/pluginUtils.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/attributeAlias.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/addEvent.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/timestampProcessPlugin.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/expressionPlugin.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/expressionParser.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/jexlParser.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/jexlTranformsMap.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/multiEntity.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/plugins/bidirectionalData.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/groups/groupRegistryMemory.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/securityServiceKeystone.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceRegistryMemory.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/commands/commandRegistryMemory.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-v2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-v2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-v2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-v2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/model/Device.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/model/Group.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/model/Command.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/deviceRegistryMongoDB.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/groups/groupRegistryMongoDB.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/commands/commandRegistryMongoDB.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-LD.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-LD.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-LD.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-LD.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/common/securityServiceOAuth2.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/devices/devices-NGSI-mixed.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-mixed.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-mixed.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"],"/home/fermin/src/iotagent-node-lib/lib/services/ngsi/entities-NGSI-mixed.js":["76bc24ff-5fac-4b5a-997d-de2799342eb0"]},"externalIds":{}}
1
+ {"processes":{"6e3d7795-bf8c-4a50-bd2f-f8221f27aeae":{"parent":null,"children":[]}},"files":{"/home/avega/tid/fiware/iotagent-node-lib/lib/fiware-iotagent-lib.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/ngsiService.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/domain.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/constants.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/errors.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/commonConfig.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/ngsiUtils.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/genericMiddleware.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/model/dbConn.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/alarmManagement.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/subscriptionService.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/stats/statsRegistry.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/deviceService.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/groups/groupService.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/iotManagerService.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/request-shim.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/registrationUtils.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/restUtils.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/expressionPlugin.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/expressionParser.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/jexlParser.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/jexlTranformsMap.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/pluginUtils.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/commands/commandService.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/northboundServer.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServer.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServerUtils.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/deviceProvisioningServer.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/deviceGroupAdministrationServer.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/compressTimestamp.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/attributeAlias.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/addEvent.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/timestampProcessPlugin.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/multiEntity.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/plugins/bidirectionalData.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/groups/groupRegistryMemory.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/securityServiceKeystone.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/deviceRegistryMemory.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/commands/commandRegistryMemory.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/devices-NGSI-v2.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/entities-NGSI-v2.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-v2.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-v2.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/model/Device.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/model/Group.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/model/Command.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/deviceRegistryMongoDB.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/groups/groupRegistryMongoDB.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/commands/commandRegistryMongoDB.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/devices-NGSI-LD.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/entities-NGSI-LD.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-LD.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-LD.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/common/securityServiceOAuth2.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/devices/devices-NGSI-mixed.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/subscription-NGSI-mixed.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/northBound/contextServer-NGSI-mixed.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"],"/home/avega/tid/fiware/iotagent-node-lib/lib/services/ngsi/entities-NGSI-mixed.js":["6e3d7795-bf8c-4a50-bd2f-f8221f27aeae"]},"externalIds":{}}
package/.readthedocs.yml CHANGED
@@ -4,4 +4,6 @@ mkdocs:
4
4
  configuration: mkdocs.yml
5
5
 
6
6
  python:
7
- version: 3.6
7
+ version: 3.8
8
+ install:
9
+ - requirements: doc/requirements.txt
@@ -1 +1,2 @@
1
1
 
2
+
package/README.md CHANGED
@@ -20,7 +20,7 @@ platform (authentication and authorization of the channel) and provide other com
20
20
  This project is part of [FIWARE](https://www.fiware.org/). For more information check the FIWARE Catalogue entry for the
21
21
  [IoT Agents](https://github.com/Fiware/catalogue/tree/master/iot-agents).
22
22
 
23
- | :books: [Documentation](https://iotagent-node-lib.rtfd.io) | :mortar_board: [Academy](https://fiware-academy.readthedocs.io/en/latest/iot-agents/idas) | :dart: [Roadmap](https://github.com/telefonicaid/iotagent-node-lib/blob/master/docs/roadmap.md) |
23
+ | :books: [Documentation](https://iotagent-node-lib.rtfd.io) | :mortar_board: [Academy](https://fiware-academy.readthedocs.io/en/latest/iot-agents/idas) | :dart: [Roadmap](https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/roadmap.md) |
24
24
  | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
25
25
 
26
26
 
@@ -304,7 +304,7 @@ deleted upon startup.
304
304
 
305
305
  The IoT Agent Node Library is licensed under [Affero General Public License (GPL) version 3](./LICENSE).
306
306
 
307
- © 2019 Telefonica Investigación y Desarrollo, S.A.U
307
+ © 2022 Telefonica Investigación y Desarrollo, S.A.U
308
308
 
309
309
  ### Are there any legal issues with AGPL 3.0? Is it safe for me to use?
310
310
 
package/config ADDED
File without changes
@@ -33,7 +33,7 @@ contributions are done using a pull request (PR). The detailed "protocol" used i
33
33
 
34
34
  * Direct commits to master branch (even single-line modifications) are not allowed. Every modification has to come as a PR
35
35
  * In case the PR is implementing/fixing a numbered issue, the issue number has to be referenced in the body of the PR at creation time
36
- * Anybody is welcome to provide comments to the PR (either direct comments or using the review feature offered by Github)
36
+ * Anybody is welcome to provide comments to the PR (either direct comments or using the review feature offered by GitHub)
37
37
  * Use *code line comments* instead of *general comments*, for traceability reasons (see comments lifecycle below)
38
38
  * Comments lifecycle
39
39
  * Comment is created, initiating a *comment thread*
@@ -142,7 +142,7 @@ point to each of the released versions of the project, they are permanent and th
142
142
 
143
143
  ## Change log
144
144
 
145
- The project contains a version changelog, called CHANGES_NEXT_RELEASE, that can be found in the root of the project.
145
+ The project contains a version change log, called CHANGES_NEXT_RELEASE, that can be found in the root of the project.
146
146
  Whenever a new feature or bug fix is going to be merged with `master`, a new entry should be added to this changelog.
147
147
  The new entry should contain the reference number of the issue it is solving (if any).
148
148
 
@@ -159,7 +159,7 @@ The process of making a release consists of the following steps:
159
159
  new target version (without any sufix), and PR into `master`. Also, in this task, the contents of the Change log are
160
160
  copied to the RPM spec.
161
161
  2. Create a tag from the last version of `master` named with the version number and push it to the repository.
162
- 3. Create the release in Github, from the created tag. In the description, add the contents of the Change log.
162
+ 3. Create the release in GitHub, from the created tag. In the description, add the contents of the Change log.
163
163
  4. Create a release branch from the last version of `master` named with the version number.
164
164
  5. Create a new task for preparing the next release, adding the sufix `-next` to the current version number (to signal
165
165
  this as the development version), and flush the contents of the CHANGES_NEXT_RELEASE file.
@@ -197,7 +197,7 @@ e.g.:
197
197
  When provisioning devices for an NGSI-LD Context Broker, `type` values should typically correspond to one of the
198
198
  following:
199
199
 
200
- - `Property`, `Relationship`, `Geoproperty`
200
+ - `Property`, `Relationship`, `GeoProperty`, `LanguageProperty`
201
201
  - Native JSON types (e.g. `String`, `Boolean`, `Float` , `Integer` `Number`)
202
202
  - Temporal Properties (e.g. `Datetime`, `Date` , `Time`)
203
203
  - GeoJSON types (e.g `Point`, `LineString`, `Polygon`, `MultiPoint`, `MultiLineString`, `MultiPolygon`)
@@ -305,8 +305,8 @@ stored in the Context Broker by adding a new attribute to the entity with the sa
305
305
  element. By adding the field `explicitAttrs` with `true` value to device or group provision, the IoTAgent rejects the
306
306
  measure elements that are not defined in the mappings of device or group provision, persisting only the one defined in
307
307
  the mappings of the provision. If `explicitAttrs` is provided both at device and group level, the device level takes
308
- precedence. Additionally `explicitAttrs` can be used to define which meassures defined in JSON/JEXL array will be
309
- propagated to NGSI interface.
308
+ precedence. Additionally `explicitAttrs` can be used to define which meassures (identified by their attribute names, not
309
+ by their object_id) defined in JSON/JEXL array will be propagated to NGSI interface.
310
310
 
311
311
  The different possibilities are summarized below:
312
312
 
@@ -332,11 +332,22 @@ Case 3:
332
332
  "explicitAttrs": "['attr1','atrr2']"
333
333
  ```
334
334
 
335
- just measures defined in the array will be will be propagated to NGSI interface (note that in this case the value of
336
- `explicitAttrs` is not a JSON but a string that looks likes a JSON).
335
+ just NGSI attributes defined in the array (identified by their attribute names, not by their object_id, plus
336
+ conditionally TimeInstant) will be propagated to NGSI interface (note that in this case the value of `explicitAttrs` is
337
+ not a JSON but a JEXL Array that looks likes a JSON).
337
338
 
338
339
  Case 4:
339
340
 
341
+ ```
342
+ "explicitAttrs": "['attr1','atrr2',{object_id:'active_id'}]"
343
+ ```
344
+
345
+ just NGSI attributes defined in the array (identified by their attribute names and/or by their object_id) will be
346
+ propagated to NGSI interface (note that in this case the value of `explicitAttrs` is not a JSON but a JEXL Array/Object
347
+ that looks likes a JSON). This is necessary when same attribute names are used within multiple entities.
348
+
349
+ Case 5:
350
+
340
351
  ```
341
352
  "explicitAtttr": "<JEXL expression resulting in bool or array>"
342
353
  ```
@@ -346,8 +357,8 @@ depending on the JEXL expression evaluation:
346
357
  - If it evaluates to `true` every measure will be propagated to NGSI interface (as in case 1)
347
358
  - If it evaluates to `false` just measures defined in active, static (plus conditionally TimeInstant) will be
348
359
  propagated to NGSI interface (as in case 2)
349
- - If it evaluates to an array just measures defined in the array will be will be propagated to NGSI interface (as in
350
- case 3)
360
+ - If it evaluates to an array just measures defined in the array (identified by their attribute names, not by their
361
+ object_id) will be will be propagated to NGSI interface (as in case 3)
351
362
 
352
363
  ### Configuring operation to persist the data in Context Broker (appendMode)
353
364
 
@@ -440,7 +451,7 @@ events in the IoT Agent with the configured type name will be marked as events.
440
451
 
441
452
  ##### Timestamp Processing Plugin (timestampProcess)
442
453
 
443
- This plugin processes the entity attributes looking for a `TimeInstant` attribute. If one is found, for NGSIv2, the
454
+ This plugin processes the entity attributes looking for a `TimeInstant` attribute. If one is found, for NGSI v2, the
444
455
  plugin adds a `TimeInstant` attribute as metadata for every other attribute in the same request. With NGSI-LD, the
445
456
  Standard `observedAt` property-of-a-property is used instead.
446
457
 
package/doc/api.md CHANGED
@@ -92,6 +92,7 @@ correspondence between the API resource fields and the same fields in the databa
92
92
  | `internal_attributes` | `internalAttributes` | optional section with free format, to allow specific IoT Agents to store information along with the devices in the Device Registry. |
93
93
  | `expressionLanguage` | `expresionLanguage` | optional boolean value, to set expression language used to compute expressions, possible values are: legacy or jexl. When not set or wrongly set, `legacy` is used as default value. |
94
94
  | `explicitAttrs` | `explicitAttrs` | optional field to support selective ignore of measures so that IOTA doesn’t progress. See details in [specific section](advanced-topics.md#explicitly-defined-attributes-explicitattrs) |
95
+ | `entityNameExp` | `entityNameExp` | optional field to allow use expressions to define entity name, instead default `id` and `type` |
95
96
  | `ngsiVersion` | `ngsiVersion` | optional string value used in mixed mode to switch between **NGSI-v2** and **NGSI-LD** payloads. Possible values are: `v2` or `ld`. The default is `v2`. When not running in mixed mode, this field is ignored. |
96
97
  | `defaultEntityNameConjunction` | `defaultEntityNameConjunction` | optional string value to set default conjunction string used to compose a default `entity_name` when is not provided at device provisioning time. |
97
98
  | `autoprovision` | `autoprovision` | optional boolean: If `false`, autoprovisioned devices (i.e. devices that are not created with an explicit provision operation but when the first measure arrives) are not allowed in this group. Default (in the case of omitting the field) is `true`. |
@@ -247,15 +248,15 @@ the API resource fields and the same fields in the database model.
247
248
 
248
249
  #### Attribute lists
249
250
 
250
- In the device model there are three list of attributes that can be declared: attributes, lazy and commands. All of them
251
- have the same syntax, an object containing the following attributes:
251
+ In the group/device model there are three list of attributes that can be declared: attributes, lazy and commands. All of
252
+ them have the same syntax, an object containing the following attributes:
252
253
 
253
254
  - **object_id** (optional): name of the attribute as coming from the device.
254
255
  - **name** (mandatory): ID of the attribute in the target entity in the Context Broker.
255
256
  - **type** (mandatory): name of the type of the attribute in the target entity.
256
257
  - **metadata** (optional): additional static metadata for the attribute in the target entity. (e.g. `unitCode`)
257
258
 
258
- Some transformation plugins also allow the use of the following optional attributes:
259
+ Some transformation plugins also allow the use of the following optional fields:
259
260
 
260
261
  - **expression**: indicates that the value of the target attribute will not be the plain value or the measurement, but
261
262
  an expression based on a combination of the reported values. See the
@@ -268,6 +269,16 @@ Some transformation plugins also allow the use of the following optional attribu
268
269
  - **reverse**: add bidirectionality expressions to the attribute. See the **bidirectionality** transformation plugin
269
270
  in the [Data Mapping Plugins section](advanced-topics.md#bidirectionality-plugin-bidirectional) for details.
270
271
 
272
+ Additionally for commands (which are attributes of type `command`) the following fields are optional:
273
+
274
+ - **expression** indicates that the value of the target command will not be the plain value or the command, but an
275
+ expression based on a combination of the returned values. See the
276
+ [Expression Language definition](expressionLanguage.md) for details
277
+ - **payloadType**: indicates how command payload will be transformed before be sent to device. Please have a look to
278
+ particular IOTAs documentation for allowed values of this field in each case.
279
+ - **contentType**: `content-type` header used when send command by HTTP transport (ignored in other kinds of
280
+ transports)
281
+
271
282
  See the transformation plugins Section for more details.
272
283
 
273
284
  #### Advice on Attribute defintions
@@ -342,6 +342,21 @@ Will now generate the following NGSI v2 payload:
342
342
  }
343
343
  ```
344
344
 
345
+ ## Available keys for all Expressions
346
+
347
+ Apart from measurement transformations (including multientity cases), expressions can be used in the following cases:
348
+
349
+ - Default EntityName defined at group level and used for provision and autoprovision of devices
350
+ - Commands (push and pull)
351
+ - Endpoint of push http commands
352
+
353
+ In all of them the following device data is available to all expressions
354
+
355
+ - `id`: device ID
356
+ - `type`: device type
357
+ - `service`: device service
358
+ - `subservice`: device subservice
359
+
345
360
  ## JEXL Based Transformations
346
361
 
347
362
  The recommended expression language for the IoTAgent Library is [JEXL](https://github.com/TomFrost/jexl). To use JEXL,
@@ -474,6 +489,8 @@ Current common transformation set:
474
489
  | slice: (arr, init, end) | `arr.slice(init,end);` |
475
490
  | addset: (arr, x) | <code>{ return Array.from((new Set(arr)).add(x)) }</code> |
476
491
  | removeset: (arr, x) | <code>{ let s = new Set(arr); s.delete(x); return Array.from(s) }</code> |
492
+ | touppercase: (val) | `String(val).toUpperCase()` |
493
+ | tolowercase: (val) | `String(val).toLowerCase()` |
477
494
 
478
495
  You have available this [JEXL interactive playground][99] with all the transformations already loaded, in which you can
479
496
  test all the functions described above.
@@ -163,16 +163,15 @@ The equivalent **NGSI-LD** payload is associated to an update operation (PATCH `
163
163
 
164
164
  ```json
165
165
  {
166
- "temperature": {
167
- "type": "Property",
168
- "value": "23"
169
- },
170
- "pressure" :{
171
- "type": "Property",
172
- "value": "720"
173
- }
166
+ "temperature": {
167
+ "type": "Property",
168
+ "value": "23"
169
+ },
170
+ "pressure": {
171
+ "type": "Property",
172
+ "value": "720"
173
+ }
174
174
  }
175
-
176
175
  ```
177
176
 
178
177
  #### R1 - UpdateContext (response)
@@ -285,7 +284,8 @@ This is an **NGSI-LD** response to `/ngsi-ld/v1/entities/<entity>`
285
284
  ```
286
285
 
287
286
  In this case, the response to the QueryContext is a list of responses, one for each requested entity, indicating whether
288
- the information has been retrieved successfully (in the HTTP Status code) and the requested Context information in the body of the response.
287
+ the information has been retrieved successfully (in the HTTP Status code) and the requested Context information in the
288
+ body of the response.
289
289
 
290
290
  Application level errors can be specified for each entity in this payload.
291
291
 
@@ -305,7 +305,7 @@ Context Element, but with the request as a whole.
305
305
 
306
306
  ### Scenario 1: active attributes
307
307
 
308
- ![General ](./img/scenario1.png "Scenario 1: active attributes")
308
+ ![General ](./img/scenario1.png 'Scenario 1: active attributes')
309
309
 
310
310
  In this scenario, the interaction is started by the device, that is going to actively send a piece of data to the
311
311
  platform. When the IoTAgent receives the data, it sends it to the Context Broker through a P1 request. The Context
@@ -319,7 +319,7 @@ updating process, and can occur at any time (they are to completely different pr
319
319
 
320
320
  ### Scenario 2: lazy attributes
321
321
 
322
- ![General ](./img/scenario2.png "Scenario 2: lazy attributes")
322
+ ![General ](./img/scenario2.png 'Scenario 2: lazy attributes')
323
323
 
324
324
  This scenario requires that the attributes that are going to be requested are marked as provided by the IoT Agent,
325
325
  through a registration process (NGSIv9). Examples of this registration process will be provided in the practical section
@@ -345,7 +345,7 @@ queries (and thus P2 and R2 payloads).
345
345
 
346
346
  ### Scenario 3: commands
347
347
 
348
- ![General ](./img/scenario3.png "Scenario 3: commands")
348
+ ![General ](./img/scenario3.png 'Scenario 3: commands')
349
349
 
350
350
  This scenario requires that the attributes that are going to be requested are marked as provided by the IoT Agent,
351
351
  through a registration process (NGSIv9). Examples of this registration process will be provided in the practical section
@@ -359,15 +359,26 @@ use three kinds of attributes:
359
359
  - An attribute will be used as the _input attribute_ (the attribute registered in the Context Provider). This input
360
360
  attribute can be thought of as a command issued to the IoTAgent (from here the name of the scenario) whose value is
361
361
  the set of arguments of the command. Only updateContext operations will be used to interact with this attributes.
362
+ Typically this attribute is of type `command`.
362
363
 
363
364
  - Another attribute will be used as the _result attribute_. This attribute will be updated from the IoTAgent, and its
364
365
  value stored in the Context Broker. This attribute will contain the result of the command (this result can be
365
366
  information in case the command was a "information retrieval" command or the result of an action if it was an
366
- "actuator command"). Typically, the name of this attribute will be the same of the input attribute, with an
367
- additional sufix (`_info`).
367
+ "actuator command"). Initially its value is empty. Typically, the name of this attribute will be the same of the
368
+ input attribute, with an additional sufix (`_info`) and the type is `commandResult`.
368
369
 
369
370
  - Another attribute with the same characteristics as the later will be used to indicate whether the command has ended
370
- successfully or whether an error has been reported.
371
+ successfully or whether an error has been reported. Typically, the name of this attribute will be the same of the
372
+ input attribute, with an additional sufix (`_status`) and the type is `commandStatus`. The possible values of this
373
+ attribute are: `ERROR`, `EXPIRED`, `PENDING`, `DELIVERED`, `UNKNOWN` with the following meanings:
374
+ - ERROR: There is a kind of error.
375
+ - EXPIRED: This meens that pull command has been expired without be delivered to device according with
376
+ `pollingExpiration` time defined by config.
377
+ - PENDING: In a PUSH command means that command has been sent to device but not device has still not respond. In a
378
+ PULL command means that command has been stored and device still has no ask for it.
379
+ - DELIVERED: The command has been delivered to phisical device.
380
+ - OK: The command has been delivered and device has respond.
381
+ - UNKNOWN: This is the initial value.
371
382
 
372
383
  In this scenario, the interaction is also initiated by the User. The user starts the scenario by sending an update
373
384
  request P1 to the Context Broker, to the input attribute (1). The Context Broker redirects this same payload to the
@@ -835,7 +846,6 @@ The IoT Agent detects the selected attribute is a command, and replies to the Co
835
846
  ```json
836
847
  [
837
848
  {
838
-
839
849
  "type": "device",
840
850
  "id": "Dev0001",
841
851
  "switch": {
@@ -854,7 +864,6 @@ The Context Broker, forwards the same response to the user, thus replying the or
854
864
  ```json
855
865
  [
856
866
  {
857
-
858
867
  "type": "device",
859
868
  "id": "Dev0001",
860
869
  "switch": {
@@ -882,11 +891,11 @@ curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -
882
891
  "isPattern": "false",
883
892
  "id": "Dev0001",
884
893
  "switch_info": {
885
- "type": "command_info",
894
+ "type": "commandResult",
886
895
  "value": "Switched successfully!"
887
896
  },
888
897
  "switch_status": {
889
- "type": "command_status",
898
+ "type": "commandStatus",
890
899
  "value": "OK"
891
900
  }
892
901
  }
@@ -906,11 +915,11 @@ The Context Broker replies to the IoT Agent with a R1 payload (200 OK):
906
915
  "type": "device",
907
916
  "id": "Dev0001",
908
917
  "switch_info": {
909
- "type": "command_info",
918
+ "type": "commandResult",
910
919
  "value": ""
911
920
  },
912
- "switch_status": {
913
- "type": "command_status",
921
+ "switch_status": {
922
+ "type": "commandStatus",
914
923
  "value": ""
915
924
  }
916
925
  }
@@ -936,8 +945,8 @@ curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -
936
945
  }
937
946
  ],
938
947
  "attributes": [
939
- "switch_info",
940
- "switch_status"
948
+ "switch_info",
949
+ "switch_status"
941
950
  ]
942
951
  }' "https://<platform-ip>:10027/v2/op/query"
943
952
  ```
@@ -947,20 +956,18 @@ The Context Broker replies with all the desired data, in R2 format (200 OK):
947
956
  ```json
948
957
  [
949
958
  {
950
-
951
959
  "type": "device",
952
960
  "id": "Dev0001",
953
961
  "switch_info": {
954
- "type": "command_info",
962
+ "type": "commandResult",
955
963
  "value": "Switched successfully!"
956
964
  },
957
965
  "switch_status": {
958
- "type": "command_status",
966
+ "type": "commandStatus",
959
967
  "value": "OK"
960
968
  }
961
969
  }
962
970
  ]
963
-
964
971
  ```
965
972
 
966
973
  ### Scenario 3: commands (error)
@@ -978,11 +985,11 @@ curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -
978
985
  "isPattern": "false",
979
986
  "id": "Dev0001",
980
987
  "switch_info":{
981
- "type": "command_info",
988
+ "type": "commandResult",
982
989
  "value": "The switch could not be switched due to the following error: switch blocked"
983
990
  },
984
991
  "switch_status":{
985
- "type": "command_status",
992
+ "type": "commandStatus",
986
993
  "value": "ERROR"
987
994
  }
988
995
  }
@@ -999,11 +1006,11 @@ In this case, the Context Broker reply with the following response (200 OK):
999
1006
  "type": "device",
1000
1007
  "id": "Dev0001",
1001
1008
  "switch_info": {
1002
- "type": "command_info",
1009
+ "type": "commandResult",
1003
1010
  "value": ""
1004
1011
  },
1005
1012
  "switch_status": {
1006
- "type": "command_status",
1013
+ "type": "commandStatus",
1007
1014
  "value": ""
1008
1015
  }
1009
1016
  }
package/doc/operations.md CHANGED
@@ -99,11 +99,11 @@ The following table shows the alarms that can be raised in the IoTAgent library.
99
99
  log starting with the prefix "Raising [%s]:" (where %s is the alarm name). All the alarms are released by an info log
100
100
  with the prefix "Releasing [%s]". These texts appear in the `msg=` field of the generic log record format.
101
101
 
102
- | Alarm name | Severity | Description |
103
- | :---------- | :----------- | :------------------------------------------------------- |
104
- | MONGO-ALARM | **Critical** | Indicates an error in the MongoDB connectivity |
105
- | ORION-ALARM | **Critical** | Indicates a persistent error accesing the Context Broker |
106
- | IOTAM-ALARM | **Critical** | Indicates a persistent error accessing the IoTAM |
102
+ | Alarm name | Severity | Description |
103
+ | :------------- | :----------- | :------------------------------------------------------- |
104
+ | MONGO-ALARM_XX | **Critical** | Indicates an error in the MongoDB connectivity |
105
+ | ORION-ALARM | **Critical** | Indicates a persistent error accesing the Context Broker |
106
+ | IOTAM-ALARM | **Critical** | Indicates a persistent error accessing the IoTAM |
107
107
 
108
108
  while the 'Severity' criterium is as follows:
109
109
 
@@ -111,6 +111,9 @@ while the 'Severity' criterium is as follows:
111
111
  - **Major** - The system has a problem that degrades the service and must be addressed
112
112
  - **Warning** - It is happening something that must be notified
113
113
 
114
+ In order to identify the internal flow which origins a mongo alarm, there is a suffix `_XX` which identifies from `01` to
115
+ `11` each flow.
116
+
114
117
  ## Error naming code
115
118
 
116
119
  Every error has a code composed of a prefix and an ID, codified with the following table:
@@ -0,0 +1,4 @@
1
+ mkdocs==1.2.3
2
+ Pygments==2.9.0
3
+ Markdown==3.3.4
4
+ jinja2==3.0.0
@@ -13,7 +13,7 @@ only, and this section may be revised to provide newer information at any time.
13
13
 
14
14
  Disclaimer:
15
15
 
16
- - This section has been last updated in March 2020. Please take into account its content could be obsolete.
16
+ - This section has been last updated in March 2022. Please take into account its content could be obsolete.
17
17
  - Note we develop this software in Agile way, so development plan is continuously under review. Thus, this roadmap has
18
18
  to be understood as rough plan of features to be done along time which is fully valid only at the time of writing
19
19
  it. This roadmap has not be understood as a commitment on features and/or dates.
@@ -25,19 +25,17 @@ Disclaimer:
25
25
  The following list of features are planned to be addressed in the short term, and incorporated in a release of the
26
26
  product:
27
27
 
28
- - Selectively ignore measure in the southbound interface (community)
29
- - JEXL support in expressions (community)
30
28
  - cgroup literal in configuration groups management API (community)
31
29
  - Metadata processing improvements
32
- - Add MongoDB authentication support
30
+ - Improve command functionalities (binary data + expression + mapping)
33
31
 
34
32
  ### Medium term
35
33
 
36
34
  The following list of features are planned to be addressed in the medium term, typically within the subsequent
37
35
  release(s) generated in the next 9 months after the next planned release:
38
36
 
39
- - Support for "delta" measures (i.e. "temperature _increased_ in 5 degress" instead of "temperature _is_ 25")
40
- - Removal support for NGSIv1 (which currently is deprecated)
37
+ - Accept JEXL Expressions for entity name in autoprovisioned devices (#1145)
38
+ - Refactor entities-NGSI-v2.js module (#1166)
41
39
 
42
40
  ### Long term
43
41
 
@@ -48,3 +46,20 @@ us if you wish to get involved in the implementation or influence the roadmap:
48
46
  - Incremental introduccion of ECMAScript6 syntax (previous analysis of which sub-set of interesting aspect we want to
49
47
  take)
50
48
  - Use the lightweight ingestion mechanism for connection oriented updates implemented in Context Broker
49
+ - Add support to other transport protocols (BacNET, Modbus, etc)
50
+
51
+ ### Features already completed
52
+
53
+ The following list contains all features that were in the roadmap and have already been implemented.
54
+
55
+ - Support for "delta" measures (i.e. "temperature _increased_ in 5 degress" instead of "temperature _is_ 25")
56
+ - Allow to handle binary messages ([iota-ul#530](https://github.com/telefonicaid/iotagent-ul/issues/530))
57
+ - Removal support for NGSIv1 (#966) ([2.18.0](https://github.com/telefonicaid/iotagent-node-lib/releases/tag/2.18.0))
58
+ - Selectively ignore measure in the southbound interface
59
+ ([iotagent-json#416](https://github.com/telefonicaid/iotagent-json/issues/416),
60
+ [iotagent-ul#372](https://github.com/telefonicaid/iotagent-ul/issues/372))
61
+ ([2.13.0](https://github.com/telefonicaid/iotagent-node-lib/releases/tag/2.13.0))
62
+ - JEXL support in expressions (#801, #687, #868)
63
+ ([2.13.0](https://github.com/telefonicaid/iotagent-node-lib/releases/tag/2.13.0))
64
+ - Add MongoDB authentication support (#844)
65
+ ([2.12.0](https://github.com/telefonicaid/iotagent-node-lib/releases/tag/2.12.0))
package/doc/usermanual.md CHANGED
@@ -209,8 +209,8 @@ function setCommandResult(entityName, resource, apikey, commandName, commandResu
209
209
  ###### Description
210
210
 
211
211
  Update the result of a command in the Context Broker. The result of the command has two components: the result of the
212
- command itself will be represented with the suffix `_result` in the entity while the status is updated in the attribute
213
- with the `_info` suffix.
212
+ command itself will be represented with the suffix `_info` in the entity while the status is updated in the attribute
213
+ with the `_status` suffix.
214
214
 
215
215
  ###### Params
216
216
 
@@ -258,7 +258,7 @@ function setDataUpdateHandler(newHandler)
258
258
  ###### Description
259
259
 
260
260
  Sets the new user handler for Entity update requests. This handler will be called whenever an update request arrives
261
- with the following parameters: (id, type, service, subservice, attributes, callback). The handler is in charge of
261
+ with the following parameters: (`id`, `type`, `service`, `subservice`, `attributes`, `callback`). The handler is in charge of
262
262
  updating the corresponding values in the devices with the appropriate protocol.
263
263
 
264
264
  Once all the updates have taken place, the callback must be invoked with the updated Context Element. E.g.:
@@ -296,7 +296,7 @@ function setDataQueryHandler(newHandler)
296
296
  ###### Description
297
297
 
298
298
  Sets the new user handler for Entity query requests. This handler will be called whenever a query request arrives, with
299
- the following parameters: (id, type, service, subservice, attributes, callback). The handler must retrieve all the
299
+ the following parameters: (`id`, `type`, `service`, `subservice`, `attributes`, `callback`). The handler must retrieve all the
300
300
  corresponding information from the devices and return a NGSI entity with the requested values.
301
301
 
302
302
  The callback must be invoked with the updated Context Element, using the information retrieved from the devices. E.g.: