From 1fadbafd1c157b72e88d58f32f080b3654777059 Mon Sep 17 00:00:00 2001 From: chetan-NEC Date: Fri, 12 May 2023 09:40:02 +0530 Subject: [PATCH 01/25] Fix return servicePath in the entity response --- CHANGES_NEXT_RELEASE | 1 + src/lib/common/globals.h | 1 + src/lib/mongoBackend/MongoGlobal.cpp | 5 + .../servicePath_in_entity_response.test | 141 ++++++++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 7cdb2e021d..605573b7b0 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +1,4 @@ +- Add: servicePath field to builtin attributes, so return ServicePath in the entity response (#2877) - Add: subject.condition.notifyOnMetadataChange field to subscriptions, so only-metadata changes doesn't trigger notifications (#3727) - Add: new simplifiedNormalized and simplifiedKeyvalues for attrsFormat (#4286) - Add: -mqttTimeout (env var ORION_MQTT_TIMEOUT) for MQTT broker connection timeout diff --git a/src/lib/common/globals.h b/src/lib/common/globals.h index c328782e7f..6f243a425b 100644 --- a/src/lib/common/globals.h +++ b/src/lib/common/globals.h @@ -96,6 +96,7 @@ #define DATE_EXPIRES "dateExpires" #define ALTERATION_TYPE "alterationType" #define ALL_ATTRS "*" +#define SERVICE_PATH "servicePath" diff --git a/src/lib/mongoBackend/MongoGlobal.cpp b/src/lib/mongoBackend/MongoGlobal.cpp index 5813561550..fd8221f052 100644 --- a/src/lib/mongoBackend/MongoGlobal.cpp +++ b/src/lib/mongoBackend/MongoGlobal.cpp @@ -1305,6 +1305,11 @@ void addBuiltins(ContextElementResponse* cerP, const std::string& alterationType addIfNotPresentAttr(&cerP->entity, ALTERATION_TYPE, DEFAULT_ATTR_STRING_TYPE, alterationType); } + // servicePath + if (!cerP->entity.servicePath.empty()) + { + addIfNotPresentAttr(&cerP->entity, SERVICE_PATH, DEFAULT_ATTR_STRING_TYPE, cerP->entity.servicePath); + } for (unsigned int ix = 0; ix < cerP->entity.attributeVector.size(); ix++) { diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test new file mode 100644 index 0000000000..66be4cf5ec --- /dev/null +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test @@ -0,0 +1,141 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +return ServicePath in entity response + +--SHELL-INIT-- +dbInit CB +brokerStart CB + +--SHELL-- + +# +# 01. POST /v2/entities, to create entity E1 with attr A1 and metadata M1 +# 02. POST /v2/entities, to create entity E2 with attr A2 and metadata M2 +# 05. GET all entities, with service path +# + + +echo "01. POST /v2/entities, to create entity E1 with attr A1 and metadata M1" +echo "=======================================================================" +payload='{ + "id": "E1", + "type": "Thing", + "A1": { + "value": 26.5, + "type": "Float", + "metadata": { + "M1": { + "value": 0.77, + "type": "Float" + } + } + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "02. POST /v2/entities, to create entity E2 with attr A2 and metadata M2" +echo "=======================================================================" +payload='{ + "id": "E2", + "type": "Thing", + "A2": { + "value": 21.5, + "type": "Float", + "metadata": { + "M2": { + "value": 11.5, + "type": "Float" + } + } + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "03. GET all entities, with service path" +echo "====================================================" +orionCurl --url /v2/entities?attrs=servicePath +echo +echo + + +--REGEXPECT-- +01. POST /v2/entities, to create entity E1 with attr A1 and metadata M1 +======================================================================= +HTTP/1.1 201 Created +Content-Length: 0 +Location: /v2/entities/E1?type=Thing +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Date: REGEX(.*) + + + +02. POST /v2/entities, to create entity E2 with attr A2 and metadata M2 +======================================================================= +HTTP/1.1 201 Created +Content-Length: 0 +Location: /v2/entities/E2?type=Thing +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Date: REGEX(.*) + + + +03. GET all entities, with service path +==================================================== +HTTP/1.1 200 OK +Content-Length: 167 +Content-Type: application/json +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Date: REGEX(.*) + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/" + }, + "type": "Thing" + }, + { + "id": "E2", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/" + }, + "type": "Thing" + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB \ No newline at end of file From f777aa61c1854b2e9dc18b1abf2aea4961a6edd1 Mon Sep 17 00:00:00 2001 From: chetan-NEC Date: Thu, 8 Jun 2023 14:08:10 +0530 Subject: [PATCH 02/25] Add return servicePath in entity response test --- ...h_as_a_wildcard_and_multiple_elements.test | 369 ++++++++++++++++++ .../servicePath_in_entity_response.test | 22 +- 2 files changed, 380 insertions(+), 11 deletions(-) create mode 100644 test/functionalTest/cases/2877_return_ServicePath_in_entity_response/get_entities_with_servicepath_as_a_wildcard_and_multiple_elements.test diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/get_entities_with_servicepath_as_a_wildcard_and_multiple_elements.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/get_entities_with_servicepath_as_a_wildcard_and_multiple_elements.test new file mode 100644 index 0000000000..ca01185745 --- /dev/null +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/get_entities_with_servicepath_as_a_wildcard_and_multiple_elements.test @@ -0,0 +1,369 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +get entities with servicepath as a wildcard and multiple elements + +--SHELL-INIT-- +dbInit CB +brokerStart CB + +--SHELL-- + +# +# 01. Create entity E1 in servicePath /Madrid/A +# 02. Create entity E2 in servicePath /Madrid/B +# 03. Create entity E3 in servicePath /Barcelona/C +# 04. Create entity E4 in servicePath /Barcelona/D +# 05. GET entities with servicePath /# +# 06. GET entities with servicePath /Madrid/# +# 07. GET entities with servicePath /Madrid/A,/Barcelona/C +# 08. GET entities with servicePath /Madrid/A,/Barcelona/# +# 09. GET entities with servicePath /Madrid/#,/Barcelona/# +# + + +echo "01. Create entity E1" +echo "====================" +payload='{ + "id": "E1", + "type": "T", + "A": { + "value":11.5, + "type": "Float" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/A +echo +echo + + +echo "02. Create entity E2" +echo "====================" +payload='{ + "id": "E2", + "type": "T", + "B": { + "value": 12.5, + "type": "Float" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/B +echo +echo + + +echo "03. Create entity E3" +echo "====================" +payload='{ + "id": "E3", + "type": "T", + "C": { + "value": 13.5, + "type": "Float" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Barcelona/C +echo +echo + + +echo "04. Create entity E4" +echo "====================" +payload='{ + "id": "E4", + "type": "T", + "D": { + "value": 14.5, + "type": "Float" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Barcelona/D +echo +echo + + +echo "05. GET entities with servicePath /#" +echo "====================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /# +echo +echo + + +echo "06. GET entities with servicePath /Madrid/A" +echo "===========================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /Madrid/A +echo +echo + + +echo "07. GET entities with servicePath /Madrid/A,/Barcelona/C" +echo "========================================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /Madrid/A,/Barcelona/C +echo +echo + + +echo "08. GET entities with servicePath /Madrid/A,/Barcelona/#" +echo "========================================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /Madrid/A,/Barcelona/# +echo +echo + + +echo "09. GET entities with servicePath /Madrid/#,/Barcelona/#" +echo "========================================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /Madrid/#,/Barcelona/# +echo +echo + + +--REGEXPECT-- +01. Create entity E1 +==================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=T +Content-Length: 0 + + + +02. Create entity E2 +==================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E2?type=T +Content-Length: 0 + + + +03. Create entity E3 +==================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E3?type=T +Content-Length: 0 + + + +04. Create entity E4 +==================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E4?type=T +Content-Length: 0 + + + +05. GET entities with servicePath /# +==================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 355 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + }, + { + "id": "E2", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/B" + }, + "type": "T" + }, + { + "id": "E3", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/C" + }, + "type": "T" + }, + { + "id": "E4", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/D" + }, + "type": "T" + } +] + + +06. GET entities with servicePath /Madrid/A +=========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 88 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + } +] + + +07. GET entities with servicePath /Madrid/A,/Barcelona/C +======================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 178 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + }, + { + "id": "E3", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/C" + }, + "type": "T" + } +] + + +08. GET entities with servicePath /Madrid/A,/Barcelona/# +======================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 268 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + }, + { + "id": "E3", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/C" + }, + "type": "T" + }, + { + "id": "E4", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/D" + }, + "type": "T" + } +] + + +09. GET entities with servicePath /Madrid/#,/Barcelona/# +======================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 355 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + }, + { + "id": "E2", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/B" + }, + "type": "T" + }, + { + "id": "E3", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/C" + }, + "type": "T" + }, + { + "id": "E4", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/D" + }, + "type": "T" + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test index 66be4cf5ec..1ac4a3247c 100644 --- a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test @@ -32,7 +32,7 @@ brokerStart CB # # 01. POST /v2/entities, to create entity E1 with attr A1 and metadata M1 # 02. POST /v2/entities, to create entity E2 with attr A2 and metadata M2 -# 05. GET all entities, with service path +# 03. GET all entities, with service path # @@ -89,30 +89,30 @@ echo 01. POST /v2/entities, to create entity E1 with attr A1 and metadata M1 ======================================================================= HTTP/1.1 201 Created -Content-Length: 0 -Location: /v2/entities/E1?type=Thing -Fiware-Correlator: REGEX([0-9a-f\-]{36}) Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=Thing +Content-Length: 0 02. POST /v2/entities, to create entity E2 with attr A2 and metadata M2 ======================================================================= HTTP/1.1 201 Created -Content-Length: 0 -Location: /v2/entities/E2?type=Thing -Fiware-Correlator: REGEX([0-9a-f\-]{36}) Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E2?type=Thing +Content-Length: 0 03. GET all entities, with service path ==================================================== HTTP/1.1 200 OK -Content-Length: 167 -Content-Type: application/json -Fiware-Correlator: REGEX([0-9a-f\-]{36}) Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 167 [ { @@ -138,4 +138,4 @@ Date: REGEX(.*) --TEARDOWN-- brokerStop CB -dbDrop CB \ No newline at end of file +dbDrop CB From c9457a5d0573a5e5978074659ad669ef8baaf1f7 Mon Sep 17 00:00:00 2001 From: chetan-NEC Date: Tue, 20 Jun 2023 14:50:46 +0530 Subject: [PATCH 03/25] Add test case --- ...tin_attribute_return_in_notifications.test | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test new file mode 100644 index 0000000000..18edb1c80a --- /dev/null +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test @@ -0,0 +1,184 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +servicePath as a builtin attribute return in notifications + +--SHELL-INIT-- +dbInit CB +brokerStart CB +accumulatorStart --pretty-print + +--SHELL-- + +# +# 01. POST /v2/entities, to create entity E1 +# 02. POST /v2/subscriptions, to create a subscription for E1 with notification.attrs as [ "*", "servicePath"] +# 03. Update entity E1 +# 04. Dump accumulator and see two notifications +# + + +echo "01. POST /v2/entities, to create entity E1" +echo "==========================================" +payload='{ + "id": "E1", + "type": "Thing", + "A1": { + "value": 26.5, + "type": "Float" + }, + "B1": { + "value": 720, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/A +echo +echo + + +echo "02. POST /v2/subscriptions, to create a subscription for E1 with notification.attrs as [ "*", "servicePath"]" +echo "============================================================================================================" +payload='{ + "description": "A subscription to get info about E1", + "subject": { + "entities": [ + { + "id": "E1", + "type": "Thing" + } + ], + "condition": { + "attrs": [ + "A1" + ] + } + }, + "notification": { + "http": { + "url": "http://localhost:'$LISTENER_PORT'/notify" + }, + "attrs": [ + "*", + "servicePath" + ] + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +subId=$(echo "$_responseHeaders" | grep Location | awk -F/ '{ print $4 }' | tr -d "\r\n") +echo +echo + + +echo "03. Update entity E1" +echo "====================" +payload='{ + "A1": { + "value": 31.7, + "type": "Float" + } +}' +orionCurl --url /v2/entities/E1/attrs --payload "$payload" -X PATCH --servicePath /Madrid/A +echo +echo + + +echo "04. Dump accumulator and see two notifications" +echo "==============================================" +accumulatorDump +echo +echo + + +--REGEXPECT-- +01. POST /v2/entities, to create entity E1 +========================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=Thing +Content-Length: 0 + + + +02. POST /v2/subscriptions, to create a subscription for E1 with notification.attrs as [ *, servicePath] +============================================================================================================ +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +03. Update entity E1 +==================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +04. Dump accumulator and see two notifications +============================================== +POST http://localhost:REGEX(\d+)/notify +Fiware-Servicepath: /Madrid/A +Content-Length: 244 +User-Agent: orion/3.10.0-next libcurl/7.68.0 +Ngsiv2-Attrsformat: normalized +Host: localhost:9997 +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A1": { + "metadata": {}, + "type": "Float", + "value": 31.7 + }, + "B1": { + "metadata": {}, + "type": "Integer", + "value": 720 + }, + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "Thing" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= + + +--TEARDOWN-- +brokerStop CB +dbDrop CB +accumulatorStop From 96733b41f07385331221a4a32b37d9445d559082 Mon Sep 17 00:00:00 2001 From: chetan-NEC Date: Tue, 20 Jun 2023 15:25:44 +0530 Subject: [PATCH 04/25] Fix test case --- ...vicePath_as_a_builtin_attribute_return_in_notifications.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test index 18edb1c80a..2db9f17ffe 100644 --- a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test @@ -144,7 +144,7 @@ Fiware-Correlator: REGEX([0-9a-f\-]{36}) POST http://localhost:REGEX(\d+)/notify Fiware-Servicepath: /Madrid/A Content-Length: 244 -User-Agent: orion/3.10.0-next libcurl/7.68.0 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) Ngsiv2-Attrsformat: normalized Host: localhost:9997 Accept: application/json From a15800ad120b9e01eaadb189c99486fa5076d1ae Mon Sep 17 00:00:00 2001 From: chetan-NEC Date: Tue, 20 Jun 2023 16:34:02 +0530 Subject: [PATCH 05/25] Fix test --- ...vicePath_as_a_builtin_attribute_return_in_notifications.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test index 2db9f17ffe..6996c26a54 100644 --- a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test @@ -21,7 +21,7 @@ # VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh --NAME-- -servicePath as a builtin attribute return in notifications +return servicePath as a builtin attribute in notifications --SHELL-INIT-- dbInit CB From c3eec3746ba9a2929207c3a57da4948fd3cec89a Mon Sep 17 00:00:00 2001 From: chetan-NEC Date: Fri, 23 Jun 2023 14:39:10 +0530 Subject: [PATCH 06/25] Fix the suggested changes --- CHANGES_NEXT_RELEASE | 2 +- src/lib/common/globals.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 8d2eb7e44a..f85bfe8d8f 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,2 @@ -- Add: servicePath field to builtin attributes, so return ServicePath in the entity response (#2877) +- Add: servicePath field to builtin attributes (#2877) - Fix: logDeprecate not working correctly (`geo:json` wrongly considered as deprecated) diff --git a/src/lib/common/globals.h b/src/lib/common/globals.h index 1b1467f43f..73c68c7187 100644 --- a/src/lib/common/globals.h +++ b/src/lib/common/globals.h @@ -95,8 +95,8 @@ #define DATE_MODIFIED "dateModified" #define DATE_EXPIRES "dateExpires" #define ALTERATION_TYPE "alterationType" -#define ALL_ATTRS "*" #define SERVICE_PATH "servicePath" +#define ALL_ATTRS "*" From 98f7d17f753c5c522c026ec7d9051465ba25e92c Mon Sep 17 00:00:00 2001 From: chetan-NEC Date: Wed, 28 Jun 2023 12:13:07 +0530 Subject: [PATCH 07/25] Add test case --- ...servicePath_behave_with_q_and_orderBy.test | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test new file mode 100644 index 0000000000..c9444977c0 --- /dev/null +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test @@ -0,0 +1,218 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +servicepath behave with q and orderBy + +--SHELL-INIT-- +dbInit CB +brokerStart CB + +--SHELL-- + +# +# 01. Create entity E1 with temperature = 35 in servicePath /Madrid/A +# 02. Create entity E2 with temperature = 25 in servicePath /Barcelona/B +# 03. Create entity E3 with temperature = 30 in servicePath /Madrid/A +# 04. Create entity E4 with temperature = 40 in servicePath /Barcelona/B +# 05. GET entities with q parameter and servicePath /Madrid/A +# 06. GET entities with orderBy servicePath +# + + +echo "01. Create entity E1 with temperature = 35 in servicePath /Madrid/A" +echo "===================================================================" +payload='{ + "id": "E1", + "type": "T", + "temperature": { + "value":35, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/A +echo +echo + + +echo "02. Create entity E2 with temperature = 25 in servicePath /Barcelona/B" +echo "======================================================================" +payload='{ + "id": "E2", + "type": "T", + "temperature": { + "value": 25, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Barcelon/B +echo +echo + + +echo "03. Create entity E3 with temperature = 30 in servicePath /Madrid/A" +echo "===================================================================" +payload='{ + "id": "E3", + "type": "T", + "temperature": { + "value": 30, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/A +echo +echo + + +echo "04. Create entity E4 with temperature = 40 in servicePath /Barcelona/B" +echo "======================================================================" +payload='{ + "id": "E4", + "type": "T", + "temperature": { + "value": 40, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Barcelona/B +echo +echo + + +echo "05. GET entities with q parameter and servicePath /Madrid/A" +echo "===========================================================" +orionCurl --url /v2/entities?q=servicePath:/Madrid/A +echo +echo + + +echo "06. GET entities with orderBy servicePath" +echo "=========================================" +orionCurl --url /v2/entities?orderBy=servicePath +echo +echo + + +--REGEXPECT-- +01. Create entity E1 with temperature = 35 in servicePath /Madrid/A +=================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=T +Content-Length: 0 + + + +02. Create entity E2 with temperature = 25 in servicePath /Barcelona/B +====================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E2?type=T +Content-Length: 0 + + + +03. Create entity E3 with temperature = 30 in servicePath /Madrid/A +=================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E3?type=T +Content-Length: 0 + + + +04. Create entity E4 with temperature = 40 in servicePath /Barcelona/B +====================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E4?type=T +Content-Length: 0 + + + +05. GET entities with q parameter and servicePath /Madrid/A +=========================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 2 + +[] + + +06. GET entities with orderBy servicePath +========================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 325 + +[ + { + "id": "E1", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 35 + }, + "type": "T" + }, + { + "id": "E2", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 25 + }, + "type": "T" + }, + { + "id": "E3", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 30 + }, + "type": "T" + }, + { + "id": "E4", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 40 + }, + "type": "T" + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB From 4658b26860d242ed8f38d3d6c9fc130823209995 Mon Sep 17 00:00:00 2001 From: Matts966 <28551465+Matts966@users.noreply.github.com> Date: Tue, 18 Jul 2023 20:28:07 +0900 Subject: [PATCH 08/25] Update README.jp.md --- docker/README.jp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.jp.md b/docker/README.jp.md index e8e006546b..efce59448a 100644 --- a/docker/README.jp.md +++ b/docker/README.jp.md @@ -43,7 +43,7 @@ Orion Context Broker を試してみたいし、データベースについて > `--nojournal` に関しては、それはプロダクション利用では推奨されていませんが、Orion コンテナが高速で、DB が見つからず準備ができていない場合に、mongo コンテナの起動を高速化し、いくつかの競合状態の問題を回避します。 -数秒後に、Context broker を実行し、ポート1026でリッスンする必要があります。 +数秒後、Context Broker が実行され、ポート 1026 をリッスンします。 以下を実行し、動作することを確認します。 From 0a6e0e335e29f9c34bb01e11730af7f962d022c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Canad=C3=A9s?= <83498869+oriolcanadesin2@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:33:26 +0200 Subject: [PATCH 09/25] Update README.md Fix Accumulator Server Dockerfile configuration --- test/functionalTest/README.md | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/test/functionalTest/README.md b/test/functionalTest/README.md index 97b91b5f21..04b19dc493 100644 --- a/test/functionalTest/README.md +++ b/test/functionalTest/README.md @@ -62,6 +62,49 @@ CMD ["--port", "1028", "--url", "/accumulate", "--host", "0.0.0.0", "-v"] **Important note**: copy the accumulator-server.py to the same directory in which Dockerfile is, before running your `docker build` command. +**Probably error**: If during the building of docker image you get a similar error: +``` + > [5/8] RUN pip install Flask==2.3.0 #2.0.2: +#0 0.446 error: externally-managed-environment +#0 0.446 +#0 0.446 × This environment is externally managed +#0 0.446 ╰─> To install Python packages system-wide, try apt install +#0 0.446 python3-xyz, where xyz is the package you are trying to +#0 0.446 install. +#0 0.446 +#0 0.446 If you wish to install a non-Debian-packaged Python package, +#0 0.446 create a virtual environment using python3 -m venv path/to/venv. +#0 0.446 Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make +#0 0.446 sure you have python3-full installed. +#0 0.446 +#0 0.446 If you wish to install a non-Debian packaged Python application, +#0 0.446 it may be easiest to use pipx install xyz, which will manage a +#0 0.446 virtual environment for you. Make sure you have pipx installed. +#0 0.446 +#0 0.446 See /usr/share/doc/python3.11/README.venv for more information. +#0 0.446 +#0 0.446 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. +#0 0.446 hint: See PEP 668 for the detailed specification. +``` +This is produced by the current Dockerfile configuration because tis behavior is specific to the Debian-based container we are using. If you get this error, just change the Dockerfile for: +``` +FROM debian:stable +RUN apt-get update -y +RUN apt-get install -y python3 python3-venv python3-pip + +# Create a virtual environment +RUN python3 -m venv /venv +ENV PATH="/venv/bin:$PATH" + +# Install required packages within the virtual environment +RUN pip install Flask==2.0.2 paho-mqtt==1.6.1 + +COPY . /app +WORKDIR /app +ENTRYPOINT [ "python3", "./accumulator-server.py"] +CMD ["--port", "1028", "--url", "/accumulate", "--host", "0.0.0.0", "-v"] +``` + Once build (let's say with name 'accum') you can run it with: ``` From 9e924969a938413d3695f1681c6c387a1ae19e1c Mon Sep 17 00:00:00 2001 From: chetan-NEC Date: Wed, 19 Jul 2023 13:41:53 +0530 Subject: [PATCH 10/25] Fix servicePath with q and orderBy --- src/lib/mongoBackend/MongoGlobal.cpp | 5 ++ src/lib/rest/StringFilter.cpp | 4 + ...servicePath_behave_with_q_and_orderBy.test | 83 ++++++++++++++++++- 3 files changed, 88 insertions(+), 4 deletions(-) diff --git a/src/lib/mongoBackend/MongoGlobal.cpp b/src/lib/mongoBackend/MongoGlobal.cpp index 29decbb9b1..e996aba9e2 100644 --- a/src/lib/mongoBackend/MongoGlobal.cpp +++ b/src/lib/mongoBackend/MongoGlobal.cpp @@ -836,6 +836,11 @@ static std::string sortCriteria(const std::string& sortToken) return ENT_MODIFICATION_DATE; } + if (sortToken == SERVICE_PATH) + { + return std::string("_id.") + ENT_SERVICE_PATH; + } + if (sortToken == ENT_ENTITY_ID) { return std::string("_id.") + ENT_ENTITY_ID; diff --git a/src/lib/rest/StringFilter.cpp b/src/lib/rest/StringFilter.cpp index 52da7d858b..9ac0a26c76 100644 --- a/src/lib/rest/StringFilter.cpp +++ b/src/lib/rest/StringFilter.cpp @@ -1835,6 +1835,10 @@ bool StringFilter::mongoFilterPopulate(std::string* errorStringP) { k = ENT_MODIFICATION_DATE; } + else if (left == SERVICE_PATH) + { + k = std::string("_id.") + ENT_SERVICE_PATH; + } else if (left == itemP->attributeName + "." + ENT_ATTRS_MD "." + NGSI_MD_DATECREATED) { k = std::string(ENT_ATTRS) + "." + itemP->attributeName + "." + ENT_ATTRS_CREATION_DATE; diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test index c9444977c0..dd55accdfa 100644 --- a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test @@ -36,6 +36,7 @@ brokerStart CB # 04. Create entity E4 with temperature = 40 in servicePath /Barcelona/B # 05. GET entities with q parameter and servicePath /Madrid/A # 06. GET entities with orderBy servicePath +# 07. GET entities with orderBy !servicePath # @@ -113,6 +114,13 @@ echo echo +echo "07. GET entities with orderBy !servicePath" +echo "==========================================" +orionCurl --url /v2/entities?orderBy=!servicePath +echo +echo + + --REGEXPECT-- 01. Create entity E1 with temperature = 35 in servicePath /Madrid/A =================================================================== @@ -160,9 +168,28 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 2 +Content-Length: 163 -[] +[ + { + "id": "E1", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 35 + }, + "type": "T" + }, + { + "id": "E3", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 30 + }, + "type": "T" + } +] 06. GET entities with orderBy servicePath @@ -174,6 +201,24 @@ Content-Type: application/json Content-Length: 325 [ + { + "id": "E2", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 25 + }, + "type": "T" + }, + { + "id": "E4", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 40 + }, + "type": "T" + }, { "id": "E1", "temperature": { @@ -184,11 +229,32 @@ Content-Length: 325 "type": "T" }, { - "id": "E2", + "id": "E3", "temperature": { "metadata": {}, "type": "Integer", - "value": 25 + "value": 30 + }, + "type": "T" + } +] + + +07. GET entities with orderBy !servicePath +========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 325 + +[ + { + "id": "E1", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 35 }, "type": "T" }, @@ -209,6 +275,15 @@ Content-Length: 325 "value": 40 }, "type": "T" + }, + { + "id": "E2", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 25 + }, + "type": "T" } ] From 203a0bc524ca244d285d1d670177597ca6d1f056 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jul 2023 13:27:15 +0000 Subject: [PATCH 11/25] Bump pygments from 2.9.0 to 2.15.0 in /doc Bumps [pygments](https://github.com/pygments/pygments) from 2.9.0 to 2.15.0. - [Release notes](https://github.com/pygments/pygments/releases) - [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES) - [Commits](https://github.com/pygments/pygments/compare/2.9.0...2.15.0) --- updated-dependencies: - dependency-name: pygments dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 6a0c8dce19..e3e604003a 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,4 @@ mkdocs==1.2.3 -Pygments==2.9.0 +Pygments==2.15.0 Markdown==3.3.4 jinja2==3.0.0 \ No newline at end of file From 6ab6f448061caa85280220b658d91500f26e679d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Canad=C3=A9s?= <83498869+oriolcanadesin2@users.noreply.github.com> Date: Mon, 7 Aug 2023 07:59:12 +0200 Subject: [PATCH 12/25] Update README.md --- test/functionalTest/README.md | 42 ++--------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/test/functionalTest/README.md b/test/functionalTest/README.md index 04b19dc493..be195dbce6 100644 --- a/test/functionalTest/README.md +++ b/test/functionalTest/README.md @@ -47,46 +47,6 @@ accumulator-server.py -u You can use the following Dockerfile to build the accumulator: -``` -FROM debian:stable -RUN apt-get update -y -RUN apt-get install -y python3 -RUN apt-get install -y python3-pip -RUN pip install Flask==2.0.2 -RUN pip install paho-mqtt==1.6.1 -COPY . /app -WORKDIR /app -ENTRYPOINT [ "python3", "./accumulator-server.py"] -CMD ["--port", "1028", "--url", "/accumulate", "--host", "0.0.0.0", "-v"] -``` - -**Important note**: copy the accumulator-server.py to the same directory in which Dockerfile is, before running your `docker build` command. - -**Probably error**: If during the building of docker image you get a similar error: -``` - > [5/8] RUN pip install Flask==2.3.0 #2.0.2: -#0 0.446 error: externally-managed-environment -#0 0.446 -#0 0.446 × This environment is externally managed -#0 0.446 ╰─> To install Python packages system-wide, try apt install -#0 0.446 python3-xyz, where xyz is the package you are trying to -#0 0.446 install. -#0 0.446 -#0 0.446 If you wish to install a non-Debian-packaged Python package, -#0 0.446 create a virtual environment using python3 -m venv path/to/venv. -#0 0.446 Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make -#0 0.446 sure you have python3-full installed. -#0 0.446 -#0 0.446 If you wish to install a non-Debian packaged Python application, -#0 0.446 it may be easiest to use pipx install xyz, which will manage a -#0 0.446 virtual environment for you. Make sure you have pipx installed. -#0 0.446 -#0 0.446 See /usr/share/doc/python3.11/README.venv for more information. -#0 0.446 -#0 0.446 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. -#0 0.446 hint: See PEP 668 for the detailed specification. -``` -This is produced by the current Dockerfile configuration because tis behavior is specific to the Debian-based container we are using. If you get this error, just change the Dockerfile for: ``` FROM debian:stable RUN apt-get update -y @@ -105,6 +65,8 @@ ENTRYPOINT [ "python3", "./accumulator-server.py"] CMD ["--port", "1028", "--url", "/accumulate", "--host", "0.0.0.0", "-v"] ``` +**Important note**: copy the accumulator-server.py to the same directory in which Dockerfile is, before running your `docker build` command. + Once build (let's say with name 'accum') you can run it with: ``` From 5b7bfa19052440c832042f8506748e0ea45ad521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 9 Aug 2023 11:32:17 +0200 Subject: [PATCH 13/25] ADD servicePath builtin attr to orion-api.md --- doc/manuals/orion-api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/manuals/orion-api.md b/doc/manuals/orion-api.md index cc7aecc57e..5d42c96685 100644 --- a/doc/manuals/orion-api.md +++ b/doc/manuals/orion-api.md @@ -674,6 +674,8 @@ the subscriptions based in alteration type features (see [Subscription based in * `entityChange` if the update that triggers the notification was an update with an actual change or not an actual change but with `forcedUpdate` in use * `entityDelete` if the update that triggers the notification was a entity delete operation +* `servicePath` (type: `Text`): specifies the [service path](#service-path) to which the entity belongs. + Like regular attributes, they can be used in `q` filters and in `orderBy` (except `alterationType`). However, they cannot be used in resource URLs. From 281ab9d20d574382bf5e916bbd9b2fdf0c869615 Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Wed, 9 Aug 2023 20:07:10 +0900 Subject: [PATCH 14/25] (JP) ADD servicePath builtin attr to orion-api.md (#4389) --- doc/manuals.jp/orion-api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/manuals.jp/orion-api.md b/doc/manuals.jp/orion-api.md index 23280882ff..b013b2c7f8 100644 --- a/doc/manuals.jp/orion-api.md +++ b/doc/manuals.jp/orion-api.md @@ -647,6 +647,8 @@ Orion は階層スコープをサポートしているため、エンティテ [`condition`](#subscriptionsubjectcondition) 内の `attrs` フィールドは無視されます (エンティティを削除する通常 の方法、たとえば `DELETE /v2/entities/E` には属性が含まれないことに注意してください) +- `servicePath` (タイプ: `Text`): エンティティが属する[サービス・パス](#service-path)を指定します。 + 通常の属性と同様に、`q` フィルタと `orderBy` (`alterationType` を除く) で使用できます。 ただし、リソース URLs では使用できません。 From ec7048724b0f70267580272c86de747d83dbce27 Mon Sep 17 00:00:00 2001 From: Kazuhito Suda Date: Wed, 9 Aug 2023 20:12:59 +0900 Subject: [PATCH 15/25] (JP) Fix difference with the English version --- doc/manuals.jp/orion-api.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/manuals.jp/orion-api.md b/doc/manuals.jp/orion-api.md index b013b2c7f8..7ae7a3a8c0 100644 --- a/doc/manuals.jp/orion-api.md +++ b/doc/manuals.jp/orion-api.md @@ -643,9 +643,7 @@ Orion は階層スコープをサポートしているため、エンティテ - `entityUpdate`: 通知をトリガーする更新が更新であったが、実際の変更ではなかった場合 - `entityChange`: 通知をトリガーする更新が実際の変更を伴う更新であった場合、または実際の変更ではなく `forcedUpdate` が使用された場合 - - `entityDelete`: 通知をトリガーする更新がエンティティの削除操作であった場合。この場合、 - [`condition`](#subscriptionsubjectcondition) 内の `attrs` フィールドは無視されます (エンティティを削除する通常 - の方法、たとえば `DELETE /v2/entities/E` には属性が含まれないことに注意してください) + - `entityDelete`: 通知をトリガーする更新がエンティティの削除操作であった場合 - `servicePath` (タイプ: `Text`): エンティティが属する[サービス・パス](#service-path)を指定します。 From 8d9951ceaf9c00c64884262d8e0e66bcbe336189 Mon Sep 17 00:00:00 2001 From: mapedraza <40356341+mapedraza@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:07:45 +0200 Subject: [PATCH 16/25] Switch to telefonicaiot/fiware-orion:ci --- .github/workflows/ciimage.yml | 40 -------------------------- .github/workflows/functional.yml | 2 +- .github/workflows/unit.yml | 2 +- .github/workflows/valgrind-nocache.yml | 2 +- .github/workflows/valgrind.yml | 2 +- ci/README.jp.md | 12 ++++---- ci/README.md | 12 ++++---- 7 files changed, 16 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/ciimage.yml diff --git a/.github/workflows/ciimage.yml b/.github/workflows/ciimage.yml deleted file mode 100644 index 40cd808534..0000000000 --- a/.github/workflows/ciimage.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build CI Image - -## Will only run on pushes to the CI folder -on: - push: - paths: - - ci/deb/** - -env: - IMAGE_NAME: fiware/orion-ci:deb - -jobs: - deploy: - - runs-on: ubuntu-22.04 - if: github.event_name == 'push' - - steps: - - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ci/deb/ - load: true - tags: ${{ env.IMAGE_NAME }} - file: ci/deb/Dockerfile - - - name: Push - run: docker push ${{ env.IMAGE_NAME }} diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 47ef6b7aa5..2ec1f9e42c 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true env: - TEST_IMAGE_NAME: fiware/orion-ci:deb + TEST_IMAGE_NAME: telefonicaiot/fiware-orion:ci jobs: functional: diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 89f0f9a6eb..5354359713 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true env: - TEST_IMAGE_NAME: fiware/orion-ci:deb + TEST_IMAGE_NAME: telefonicaiot/fiware-orion:ci jobs: unit: diff --git a/.github/workflows/valgrind-nocache.yml b/.github/workflows/valgrind-nocache.yml index 4acdc6c9e3..43a1f2effc 100644 --- a/.github/workflows/valgrind-nocache.yml +++ b/.github/workflows/valgrind-nocache.yml @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: true env: - TEST_IMAGE_NAME: fiware/orion-ci:deb + TEST_IMAGE_NAME: telefonicaiot/fiware-orion:ci jobs: valgrind: diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 55fc6c5861..0ea9538f00 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true env: - TEST_IMAGE_NAME: fiware/orion-ci:deb + TEST_IMAGE_NAME: telefonicaiot/fiware-orion:ci jobs: valgrind: diff --git a/ci/README.jp.md b/ci/README.jp.md index d203e05297..20b94bb6b8 100644 --- a/ci/README.jp.md +++ b/ci/README.jp.md @@ -1,13 +1,13 @@ ## 概要 このリポジトリでは GitHub Actions が有効になっているため、マージを許可する前に各プルリクエストがチェックされます。 -このシステムは、新しい PR がマスターに到達するたびにマスターブランチから構築される `fiware/orion-ci:deb` に基づいており、 +このシステムは、新しい PR がマスターに到達するたびにマスターブランチから構築される `telefonicaiot/fiware-orion:ci` に基づいており、 すべてのビルド依存関係がオンボードにあるクリーンな環境を提供します。この Docker のビルドに使用される Dockerfile は、 `ci/deb` ディレクトリにあります。 -テスト対象の PR ブランチが変更されたため、`fiware/orion-ci:deb` は再構築されないことに注意してください。したがって、 +テスト対象の PR ブランチが変更されたため、`telefonicaiot/fiware-orion:ci` は再構築されないことに注意してください。したがって、 新しいライブラリまたはベースシステムを必要とする機能を開発している場合は、そのようなライブラリまたはベースシステムを `ci/deb/build-dep.sh` および/または `Dockerfile` に追加する PR を*最初に*実行する必要があります。その PR がマスターに -マージされ、`fiware/orion-ci:deb` が再構築されると (Docker Hub の https://hub.docker.com/r/fiware/orion-ci/builds +マージされ、`telefonicaiot/fiware-orion:ci` が再構築されると (Docker Hub の https://hub.docker.com/r/fiware/orion-ci/builds で進行状況を確認)、新しい機能は、GitHub アクションでテストする準備ができています。 GitHub Actions チェックは段階に分かれており、 "サポートされているテスト" セクションで説明されています。 @@ -31,7 +31,7 @@ CI の現在のバージョンは以下をサポートします: イメージをダウンロードするには: ``` -docker pull fiware/orion-ci:deb +docker pull telefonicaiot/fiware-orion:ci ``` たとえば、GitHub Actions と同じ方法でイメージを実行するには、次のようにします: @@ -39,7 +39,7 @@ docker pull fiware/orion-ci:deb ``` # Check that MongoDB server is running in your localhost:27017 cd /path/to/fiware-orion -docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/opt/fiware-orion fiware/orion-ci:deb build -miqts functional +docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/opt/fiware-orion telefonicaiot/fiware-orion:ci build -miqts functional ``` インタラクティブな bash を使用してイメージを実行するには: @@ -47,7 +47,7 @@ docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/o ``` # Check that MongoDB server is running in your localhost:27017 cd /path/to/fiware-orion -docker run --network host -ti -v $(pwd):/opt/fiware-orion fiware/orion-ci:deb bash +docker run --network host -ti -v $(pwd):/opt/fiware-orion telefonicaiot/fiware-orion:ci bash ``` bash シェルを起動したら、同様の実行を行うことができます: diff --git a/ci/README.md b/ci/README.md index d6eb527d88..b5faa7bc00 100644 --- a/ci/README.md +++ b/ci/README.md @@ -1,12 +1,12 @@ ## Overview GitHub Actions is enabled in this repository so each pull request is checked before being allowed to merge. -The system is based on `fiware/orion-ci:deb` which is built from master branch each time a new PR lands in master, +The system is based on `telefonicaiot/fiware-orion:ci` which is built from master branch each time a new PR lands in master, providing a clean environment with all build dependencies onboard. The Dockerfile used to build this docker is available in the `ci/deb` directory. -Note that `fiware/orion-ci:deb` is *not* rebuilt due to changes in the PR branch under test. Thus, if you are developing +Note that `telefonicaiot/fiware-orion:ci` is *not* rebuilt due to changes in the PR branch under test. Thus, if you are developing a functionality that requires a new library or base system you need to do *first* a PR adding such library or base system -to `ci/deb/build-dep.sh` and/or `Dockerfile`. Once that PR gets merged into master and `fiware/orion-ci:deb` gets rebuild +to `ci/deb/build-dep.sh` and/or `Dockerfile`. Once that PR gets merged into master and `telefonicaiot/fiware-orion:ci` gets rebuild (checking progress in Dockerhub at: https://hub.docker.com/r/fiware/orion-ci/builds) your PR branch with the new functionality is ready to be tested with GitHub Actions. @@ -30,7 +30,7 @@ the following cheatsheet can be useful: To download the image: ``` -docker pull fiware/orion-ci:deb +docker pull telefonicaiot/fiware-orion:ci ``` To run the image in the same way that GitHub Actions does, for instance: @@ -38,7 +38,7 @@ To run the image in the same way that GitHub Actions does, for instance: ``` # Check that MongoDB server is running in your localhost:27017 cd /path/to/fiware-orion -docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/opt/fiware-orion fiware/orion-ci:deb build -miqts functional +docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/opt/fiware-orion telefonicaiot/fiware-orion:ci build -miqts functional ``` To run the image using an interactive bash on it @@ -46,7 +46,7 @@ To run the image using an interactive bash on it ``` # Check that MongoDB server is running in your localhost:27017 cd /path/to/fiware-orion -docker run --network host -ti -v $(pwd):/opt/fiware-orion fiware/orion-ci:deb bash +docker run --network host -ti -v $(pwd):/opt/fiware-orion telefonicaiot/fiware-orion:ci bash ``` Once have a bash shell, you can do the same execution: From 7b8dd0f82d9e26628b262298c07d718e9af3f5c9 Mon Sep 17 00:00:00 2001 From: mapedraza <40356341+mapedraza@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:33:01 +0200 Subject: [PATCH 17/25] Fix readme dockerhub links --- ci/README.jp.md | 2 +- ci/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/README.jp.md b/ci/README.jp.md index 20b94bb6b8..645730f11e 100644 --- a/ci/README.jp.md +++ b/ci/README.jp.md @@ -7,7 +7,7 @@ テスト対象の PR ブランチが変更されたため、`telefonicaiot/fiware-orion:ci` は再構築されないことに注意してください。したがって、 新しいライブラリまたはベースシステムを必要とする機能を開発している場合は、そのようなライブラリまたはベースシステムを `ci/deb/build-dep.sh` および/または `Dockerfile` に追加する PR を*最初に*実行する必要があります。その PR がマスターに -マージされ、`telefonicaiot/fiware-orion:ci` が再構築されると (Docker Hub の https://hub.docker.com/r/fiware/orion-ci/builds +マージされ、`telefonicaiot/fiware-orion:ci` が再構築されると (Docker Hub の https://hub.docker.com/r/telefonicaiot/fiware-orion/builds で進行状況を確認)、新しい機能は、GitHub アクションでテストする準備ができています。 GitHub Actions チェックは段階に分かれており、 "サポートされているテスト" セクションで説明されています。 diff --git a/ci/README.md b/ci/README.md index b5faa7bc00..5871fa62ce 100644 --- a/ci/README.md +++ b/ci/README.md @@ -7,7 +7,7 @@ in the `ci/deb` directory. Note that `telefonicaiot/fiware-orion:ci` is *not* rebuilt due to changes in the PR branch under test. Thus, if you are developing a functionality that requires a new library or base system you need to do *first* a PR adding such library or base system to `ci/deb/build-dep.sh` and/or `Dockerfile`. Once that PR gets merged into master and `telefonicaiot/fiware-orion:ci` gets rebuild -(checking progress in Dockerhub at: https://hub.docker.com/r/fiware/orion-ci/builds) your PR branch with the new +(checking progress in Dockerhub at: https://hub.docker.com/r/telefonicaiot/fiware-orion/builds) your PR branch with the new functionality is ready to be tested with GitHub Actions. The GitHub Actions checks are divided into stages, which are described in "Supported tests" section. From c82a9f189a7b0121ec97b2fb76d7e8a5a99907e4 Mon Sep 17 00:00:00 2001 From: tzzed Date: Tue, 15 Aug 2023 21:17:15 +0400 Subject: [PATCH 18/25] refacto: set attribute name in error log --- src/lib/mongoBackend/MongoCommonUpdate.cpp | 4 ++-- src/lib/ngsi/ContextAttributeVector.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/mongoBackend/MongoCommonUpdate.cpp b/src/lib/mongoBackend/MongoCommonUpdate.cpp index e0b3f2f1d4..e00218931b 100644 --- a/src/lib/mongoBackend/MongoCommonUpdate.cpp +++ b/src/lib/mongoBackend/MongoCommonUpdate.cpp @@ -316,7 +316,7 @@ static bool attrValueChanges(const orion::BSONObj& attr, ContextAttribute* caP, return caP->valueType != orion::ValueTypeNull; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), caP->name.c_str())); return false; } } @@ -442,7 +442,7 @@ static ChangeType mergeAttrInfo break; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), caP->name.c_str())); } } diff --git a/src/lib/ngsi/ContextAttributeVector.cpp b/src/lib/ngsi/ContextAttributeVector.cpp index 234df01262..d0581a3ba6 100644 --- a/src/lib/ngsi/ContextAttributeVector.cpp +++ b/src/lib/ngsi/ContextAttributeVector.cpp @@ -389,7 +389,7 @@ void ContextAttributeVector::fill break; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), ca.name.c_str())); } } From de76dddb4f95d1e7d912873b9532a128943bf5b0 Mon Sep 17 00:00:00 2001 From: tzzed Date: Tue, 15 Aug 2023 21:35:27 +0400 Subject: [PATCH 19/25] refacto: harmonized logs --- src/lib/ngsi/ContextAttribute.cpp | 8 ++++---- src/lib/ngsi/ContextAttributeVector.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/ngsi/ContextAttribute.cpp b/src/lib/ngsi/ContextAttribute.cpp index 9a8f939c90..0f0e3520f4 100644 --- a/src/lib/ngsi/ContextAttribute.cpp +++ b/src/lib/ngsi/ContextAttribute.cpp @@ -133,7 +133,7 @@ void ContextAttribute::bsonAppendAttrValue break; default: - LM_E(("Runtime Error (unknown attribute type: %d)", valueType)); + LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", valueType, name.c_str())); } } @@ -217,7 +217,7 @@ bool ContextAttribute::calculateOperator return false; default: - LM_E(("Runtime Error (unknown attribute type: %d)", valueType)); + LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", valueType, name.c_str())); return false; } @@ -247,7 +247,7 @@ bool ContextAttribute::calculateOperator return false; default: - LM_E(("Runtime Error (unknown attribute type: %d)", valueType)); + LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", valueType, name.c_str())); return false; } } @@ -258,7 +258,7 @@ bool ContextAttribute::calculateOperator } else { - LM_E(("Runtime Error (uknown operator: %s)", op.c_str())); + LM_E(("Runtime Error (unknown operator: %s)", op.c_str())); return false; } diff --git a/src/lib/ngsi/ContextAttributeVector.cpp b/src/lib/ngsi/ContextAttributeVector.cpp index d0581a3ba6..3d3c70ce05 100644 --- a/src/lib/ngsi/ContextAttributeVector.cpp +++ b/src/lib/ngsi/ContextAttributeVector.cpp @@ -669,7 +669,7 @@ void ContextAttributeVector::applyUpdateOperators(void) break; default: - LM_E(("Runtime Error (unknown attribute type: %d)", upOp->valueType)); + LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); } // Replace old compound value (with $push) with the new one ([]) @@ -705,7 +705,7 @@ void ContextAttributeVector::applyUpdateOperators(void) break; default: - LM_E(("Runtime Error (unknown attribute type: %d)", upOp->valueType)); + LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); } // Replace old compound value (with $push) with the new one ([]) @@ -726,7 +726,7 @@ void ContextAttributeVector::applyUpdateOperators(void) } else { - LM_E(("Runtime Error (uknown operator: %s", op.c_str())); + LM_E(("Runtime Error (unknown operator: %s", op.c_str())); } } } From a8f99c102a142898a57160f0c10320e99e17f2a5 Mon Sep 17 00:00:00 2001 From: mapedraza <40356341+mapedraza@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:26:10 +0200 Subject: [PATCH 20/25] Update roadmap.md 2023-08-22 --- doc/roadmap.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/roadmap.md b/doc/roadmap.md index 3fbfe2ddc2..973a61ca62 100644 --- a/doc/roadmap.md +++ b/doc/roadmap.md @@ -17,7 +17,7 @@ any time. Disclaimer: -* This section has been last updated in March 2022. Please take into account its +* This section has been last updated in August 2023. Please take into account its content could be obsolete. * Note we develop this software in Agile way, so development plan is continuously under review. Thus, this roadmap has to be understood as rough plan of features @@ -33,12 +33,11 @@ The following list of features are planned to be addressed in the short term, and incorporated into the coming release(s) of the product: - Allow multiple types in entity to support UNE 178503 requirements ([#3638](https://github.com/telefonicaid/fiware-orion/issues/3638)) -- ~New subscripition modes (create only, update only, delete only and combinations)~ ([#1494](https://github.com/telefonicaid/fiware-orion/issues/1494) - Pattern/filter batch updates ([#2389](https://github.com/telefonicaid/fiware-orion/issues/2389)) - Notification endpoint alias ([#3655](https://github.com/telefonicaid/fiware-orion/issues/3655)) - Aggregation operations API ([#3816](https://github.com/telefonicaid/fiware-orion/issues/3816)) -- ~Custom notifications: simplifying sending JSON requests~ ([#2560](https://github.com/telefonicaid/fiware-orion/issues/2560)) - +- Rework commands and deprecate registration API +- MQTT Retain flag ## Medium term @@ -46,16 +45,20 @@ The following list of features are planned to be addressed in the medium term, typically within the subsequent release(s) generated in the next **9 months** after next planned release: - -- Advanced query language +- Advanced query language ([4395](https://github.com/telefonicaid/fiware-orion/issues/4395)) - Signed entities - Dynamic / high order attribute values (e.g. an attribute being a sum of two other attributes) supported by a Expressions Language - help wanted ([#4004](https://github.com/telefonicaid/fiware-orion/issues/4004)), ([#3815](https://github.com/telefonicaid/fiware-orion/issues/3815)) -- Rework commands - Service provisioning API (pools, etc.) (based in [#3843](https://github.com/telefonicaid/fiware-orion/issues/3843)) +- Remove registration API +- Advanced subscription management ([4392](https://github.com/telefonicaid/fiware-orion/issues/4392)) + - Custom ID subscription + - Query Subscrition by fields (endpoint, attributes...) + - Configurable statistics consolidation flag (to debug subscriptions) / Debug mode + last 10 subs status? + - Flag to disable metadata in subscriptions ## Long term @@ -71,6 +74,10 @@ you wish to get involved in the implementation or influence the roadmap The following list contains all features that were in the roadmap and have already been implemented. +- ~New subscripition modes (create only, update only, delete only and combinations)~ ([#1494](https://github.com/telefonicaid/fiware-orion/issues/1494) +- ~Custom notifications: simplifying sending JSON requests~ ([#2560](https://github.com/telefonicaid/fiware-orion/issues/2560)) + + - Per sub/reg HTTP timeout ([#3842](https://github.com/telefonicaid/fiware-orion/issues/3842)) ([3.3.0](https://github.com/telefonicaid/fiware-orion/releases/tag/3.3.0)) - Attribute update operators (inc, push, etc.) ([#3814](https://github.com/telefonicaid/fiware-orion/issues/3814)) From b0b45b37b1ebd080b056fba9d1bb5ed57f1605e7 Mon Sep 17 00:00:00 2001 From: tzzed Date: Tue, 22 Aug 2023 14:34:49 +0400 Subject: [PATCH 21/25] apply review suggestion --- CHANGES_NEXT_RELEASE | 1 + src/lib/ngsi/ContextAttribute.cpp | 6 +++--- src/lib/ngsi/ContextAttributeVector.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 528af55d4c..6387d816b3 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ - Fix: logDeprecate not working correctly (`geo:json` wrongly considered as deprecated) +- Fix improve error traces (#4387) diff --git a/src/lib/ngsi/ContextAttribute.cpp b/src/lib/ngsi/ContextAttribute.cpp index 0f0e3520f4..f2aade9e7b 100644 --- a/src/lib/ngsi/ContextAttribute.cpp +++ b/src/lib/ngsi/ContextAttribute.cpp @@ -133,7 +133,7 @@ void ContextAttribute::bsonAppendAttrValue break; default: - LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", valueType, name.c_str())); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); } } @@ -217,7 +217,7 @@ bool ContextAttribute::calculateOperator return false; default: - LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", valueType, name.c_str())); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); return false; } @@ -247,7 +247,7 @@ bool ContextAttribute::calculateOperator return false; default: - LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", valueType, name.c_str())); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); return false; } } diff --git a/src/lib/ngsi/ContextAttributeVector.cpp b/src/lib/ngsi/ContextAttributeVector.cpp index 3d3c70ce05..812f8c9af8 100644 --- a/src/lib/ngsi/ContextAttributeVector.cpp +++ b/src/lib/ngsi/ContextAttributeVector.cpp @@ -669,7 +669,7 @@ void ContextAttributeVector::applyUpdateOperators(void) break; default: - LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); } // Replace old compound value (with $push) with the new one ([]) @@ -705,7 +705,7 @@ void ContextAttributeVector::applyUpdateOperators(void) break; default: - LM_E(("Runtime Error (unknown attribute type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); } // Replace old compound value (with $push) with the new one ([]) From 8a566a9c9fa3cc37f8810cf2f9d117334f6b69ae Mon Sep 17 00:00:00 2001 From: mapedraza <40356341+mapedraza@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:17:00 +0200 Subject: [PATCH 22/25] Add sugestions + Placeholder issues --- doc/roadmap.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/doc/roadmap.md b/doc/roadmap.md index 973a61ca62..bff9a9becd 100644 --- a/doc/roadmap.md +++ b/doc/roadmap.md @@ -32,12 +32,13 @@ Disclaimer: The following list of features are planned to be addressed in the short term, and incorporated into the coming release(s) of the product: +- MQTT Retain flag [#4388](https://github.com/telefonicaid/fiware-orion/issues/4388) - Allow multiple types in entity to support UNE 178503 requirements ([#3638](https://github.com/telefonicaid/fiware-orion/issues/3638)) - Pattern/filter batch updates ([#2389](https://github.com/telefonicaid/fiware-orion/issues/2389)) - Notification endpoint alias ([#3655](https://github.com/telefonicaid/fiware-orion/issues/3655)) - Aggregation operations API ([#3816](https://github.com/telefonicaid/fiware-orion/issues/3816)) -- Rework commands and deprecate registration API -- MQTT Retain flag +- Rework commands (and deprecate registration API) ([4397](https://github.com/telefonicaid/fiware-orion/issues/4397)) + ## Medium term @@ -46,19 +47,19 @@ typically within the subsequent release(s) generated in the next **9 months** after next planned release: - Advanced query language ([4395](https://github.com/telefonicaid/fiware-orion/issues/4395)) -- Signed entities +- Signed entities ([4398](https://github.com/telefonicaid/fiware-orion/issues/4398)) - Dynamic / high order attribute values (e.g. an attribute being a sum of two other attributes) supported by a Expressions Language - help wanted ([#4004](https://github.com/telefonicaid/fiware-orion/issues/4004)), ([#3815](https://github.com/telefonicaid/fiware-orion/issues/3815)) - Service provisioning API (pools, etc.) (based in [#3843](https://github.com/telefonicaid/fiware-orion/issues/3843)) -- Remove registration API -- Advanced subscription management ([4392](https://github.com/telefonicaid/fiware-orion/issues/4392)) - - Custom ID subscription - - Query Subscrition by fields (endpoint, attributes...) - - Configurable statistics consolidation flag (to debug subscriptions) / Debug mode + last 10 subs status? - - Flag to disable metadata in subscriptions +- Advanced subscription management + - Subscription debug mode (precise statistics consolidation, keep recent history of notifications sent, etc.) ([4399](https://github.com/telefonicaid/fiware-orion/issues/4399)) + - Custom ID subscription ([4400](https://github.com/telefonicaid/fiware-orion/issues/4400)) + - Query Subscrition by fields (endpoint, attributes...) ([4392](https://github.com/telefonicaid/fiware-orion/issues/4392)) + - Flag to disable metadata in subscriptions ([4401](https://github.com/telefonicaid/fiware-orion/issues/4401)) +- Remove registration API ([4402](https://github.com/telefonicaid/fiware-orion/pull/4396)) ## Long term From ea3e728589d614494bcc3c8cb01cb7b23fa1a60e Mon Sep 17 00:00:00 2001 From: Tzzed Date: Tue, 22 Aug 2023 17:21:43 +0400 Subject: [PATCH 23/25] Update CHANGES_NEXT_RELEASE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fermín Galán Márquez --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 6387d816b3..8b17f72e51 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,2 @@ - Fix: logDeprecate not working correctly (`geo:json` wrongly considered as deprecated) -- Fix improve error traces (#4387) +- Fix: improve error traces (#4387) From 01d826a1382debc5180785c32957a24f90827dfc Mon Sep 17 00:00:00 2001 From: mapedraza <40356341+mapedraza@users.noreply.github.com> Date: Wed, 23 Aug 2023 09:01:57 +0200 Subject: [PATCH 24/25] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fermín Galán Márquez --- doc/roadmap.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/roadmap.md b/doc/roadmap.md index bff9a9becd..1033980396 100644 --- a/doc/roadmap.md +++ b/doc/roadmap.md @@ -37,7 +37,7 @@ and incorporated into the coming release(s) of the product: - Pattern/filter batch updates ([#2389](https://github.com/telefonicaid/fiware-orion/issues/2389)) - Notification endpoint alias ([#3655](https://github.com/telefonicaid/fiware-orion/issues/3655)) - Aggregation operations API ([#3816](https://github.com/telefonicaid/fiware-orion/issues/3816)) -- Rework commands (and deprecate registration API) ([4397](https://github.com/telefonicaid/fiware-orion/issues/4397)) +- Rework commands (and deprecate registration API) ([#4397](https://github.com/telefonicaid/fiware-orion/issues/4397)) ## Medium term @@ -46,8 +46,8 @@ The following list of features are planned to be addressed in the medium term, typically within the subsequent release(s) generated in the next **9 months** after next planned release: -- Advanced query language ([4395](https://github.com/telefonicaid/fiware-orion/issues/4395)) -- Signed entities ([4398](https://github.com/telefonicaid/fiware-orion/issues/4398)) +- Advanced query language ([#4395](https://github.com/telefonicaid/fiware-orion/issues/4395)) +- Signed entities ([#4398](https://github.com/telefonicaid/fiware-orion/issues/4398)) - Dynamic / high order attribute values (e.g. an attribute being a sum of two other attributes) supported by a Expressions Language - help wanted ([#4004](https://github.com/telefonicaid/fiware-orion/issues/4004)), @@ -55,11 +55,11 @@ after next planned release: - Service provisioning API (pools, etc.) (based in [#3843](https://github.com/telefonicaid/fiware-orion/issues/3843)) - Advanced subscription management - - Subscription debug mode (precise statistics consolidation, keep recent history of notifications sent, etc.) ([4399](https://github.com/telefonicaid/fiware-orion/issues/4399)) - - Custom ID subscription ([4400](https://github.com/telefonicaid/fiware-orion/issues/4400)) - - Query Subscrition by fields (endpoint, attributes...) ([4392](https://github.com/telefonicaid/fiware-orion/issues/4392)) - - Flag to disable metadata in subscriptions ([4401](https://github.com/telefonicaid/fiware-orion/issues/4401)) -- Remove registration API ([4402](https://github.com/telefonicaid/fiware-orion/pull/4396)) + - Subscription debug mode (precise statistics consolidation, keep recent history of notifications sent, etc.) ([#4399](https://github.com/telefonicaid/fiware-orion/issues/4399)) + - Custom ID subscription ([#4400](https://github.com/telefonicaid/fiware-orion/issues/4400)) + - Query Subscrition by fields (endpoint, attributes...) ([#4392](https://github.com/telefonicaid/fiware-orion/issues/4392)) + - Flag to disable metadata in subscriptions ([#4401](https://github.com/telefonicaid/fiware-orion/issues/4401)) +- Remove registration API ([#4402](https://github.com/telefonicaid/fiware-orion/pull/4402)) ## Long term From 1e36d4ffb68f9c776a7d72c3a2d15ce67f5bcc59 Mon Sep 17 00:00:00 2001 From: mapedraza <40356341+mapedraza@users.noreply.github.com> Date: Wed, 23 Aug 2023 09:06:19 +0200 Subject: [PATCH 25/25] Update roadmap.md --- doc/roadmap.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/roadmap.md b/doc/roadmap.md index 1033980396..9dbf7b976f 100644 --- a/doc/roadmap.md +++ b/doc/roadmap.md @@ -75,10 +75,8 @@ you wish to get involved in the implementation or influence the roadmap The following list contains all features that were in the roadmap and have already been implemented. -- ~New subscripition modes (create only, update only, delete only and combinations)~ ([#1494](https://github.com/telefonicaid/fiware-orion/issues/1494) -- ~Custom notifications: simplifying sending JSON requests~ ([#2560](https://github.com/telefonicaid/fiware-orion/issues/2560)) - - +- Custom notifications: simplifying sending JSON requests ([#2560](https://github.com/telefonicaid/fiware-orion/issues/2560)) ([3.8.0](https://github.com/telefonicaid/fiware-orion/releases/tag/3.8.0)) +- New subscripition modes (create only, update only, delete only and combinations) ([#1494](https://github.com/telefonicaid/fiware-orion/issues/1494)) ([3.7.0](https://github.com/telefonicaid/fiware-orion/releases/tag/3.7.0)) - Per sub/reg HTTP timeout ([#3842](https://github.com/telefonicaid/fiware-orion/issues/3842)) ([3.3.0](https://github.com/telefonicaid/fiware-orion/releases/tag/3.3.0)) - Attribute update operators (inc, push, etc.) ([#3814](https://github.com/telefonicaid/fiware-orion/issues/3814))