forked from telefonicaid/fiware-cygnus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request telefonicaid#1762 from telefonicaid/task/NGSIv2
Task/ngsiv2
- Loading branch information
Showing
21 changed files
with
1,334 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Fix: Changing cygnus port does not work (#1698) | ||
[cygnus-commons][MongoBackend] Proper processing of mongo errors in create index operations (#1756) | ||
[cygnus-ngsi] Support for NGSIv2 notifications (#953) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
cygnus-ngsi/resources/ngsi-examples/NGSIv2/notification-json-compound.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/sh | ||
# Copyright 2016 Telefonica Investigacion y Desarrollo, S.A.U | ||
# | ||
# This file is part of fiware-cygnus. | ||
# | ||
# fiware-cygnus 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. | ||
# | ||
# fiware-cygnus 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 fiware-cygnus. If not, see http://www.gnu.org/licenses/. | ||
# | ||
# For those usages not covered by this license please contact with | ||
# [email protected] | ||
|
||
# This script is aimed to Cygnus debugging. | ||
|
||
URL=$1 | ||
|
||
if [ "$2" != "" ] | ||
then | ||
SERVICE=$2 | ||
else | ||
SERVICE=default | ||
fi | ||
|
||
if [ "$3" != "" ] | ||
then | ||
SERVICE_PATH=$3 | ||
else | ||
SERVICE_PATH=/ | ||
fi | ||
|
||
curl $URL -v -s -S --header 'Content-Type: application/json; charset=utf-8' --header 'Accept: application/json' --header 'User-Agent: orion/0.10.0' --header "Fiware-Service: $SERVICE" --header "Fiware-ServicePath: $SERVICE_PATH" --header "ngsiv2-attrsformat: normalized" -d @- <<EOF | ||
{ | ||
"subscriptionId" : "51c0ac9ed714fb3b37d7d5a8", | ||
"data" : [ | ||
{ | ||
"field1" : { | ||
"type" : "type1", | ||
"value" : { "a": "1", "b": "2" }, | ||
"metadata": {} | ||
}, | ||
"field2" : { | ||
"type" : "type2", | ||
"value" : [ "v1", "v2" ], | ||
"metadata": {} | ||
}, | ||
"type" : "Room", | ||
"id" : "Room2" | ||
} | ||
] | ||
} | ||
EOF |
67 changes: 67 additions & 0 deletions
67
cygnus-ngsi/resources/ngsi-examples/NGSIv2/notification-json-geom.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/sh | ||
# Copyright 2016 Telefonica Investigacion y Desarrollo, S.A.U | ||
# | ||
# This file is part of fiware-cygnus. | ||
# | ||
# fiware-cygnus 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. | ||
# | ||
# fiware-cygnus 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 fiware-cygnus. If not, see http://www.gnu.org/licenses/. | ||
# | ||
# For those usages not covered by this license please contact with | ||
# [email protected] | ||
|
||
# This script is aimed to Cygnus debugging. | ||
|
||
URL=$1 | ||
|
||
if [ "$2" != "" ] | ||
then | ||
SERVICE=$2 | ||
else | ||
SERVICE=default | ||
fi | ||
|
||
if [ "$3" != "" ] | ||
then | ||
SERVICE_PATH=$3 | ||
else | ||
SERVICE_PATH=/ | ||
fi | ||
|
||
curl $URL -v -s -S --header 'Content-Type: application/json; charset=utf-8' --header 'Accept: application/json' --header 'User-Agent: orion/0.10.0' --header "Fiware-Service: $SERVICE" --header "Fiware-ServicePath: $SERVICE_PATH" --header "ngsiv2-attrsformat: normalized" -d @- <<EOF | ||
{ | ||
"subscriptionId" : "51c0ac9ed714fb3b37d7d5a8", | ||
"data" : [ | ||
{ | ||
"temperature" : | ||
{ | ||
"type" : "centigrade", | ||
"value" : "26.5", | ||
"metadata": {} | ||
}, | ||
"the_geom" : | ||
{ | ||
"type" : "geometry", | ||
"value" : "$4, $5", | ||
"metadata": { | ||
"location": { | ||
"type": "string", | ||
"value": "WGS84" | ||
} | ||
} | ||
}, | ||
"type" : "Car", | ||
"id" : "Car1" | ||
} | ||
] | ||
} | ||
EOF |
70 changes: 70 additions & 0 deletions
70
cygnus-ngsi/resources/ngsi-examples/NGSIv2/notification-json-md.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/sh | ||
# Copyright 2016 Telefonica Investigacion y Desarrollo, S.A.U | ||
# | ||
# This file is part of fiware-cygnus. | ||
# | ||
# fiware-cygnus 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. | ||
# | ||
# fiware-cygnus 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 fiware-cygnus. If not, see http://www.gnu.org/licenses/. | ||
# | ||
# For those usages not covered by this license please contact with | ||
# [email protected] | ||
|
||
# This script is aimed to Cygnus debugging. | ||
|
||
URL=$1 | ||
|
||
if [ "$2" != "" ] | ||
then | ||
SERVICE=$2 | ||
else | ||
SERVICE=default | ||
fi | ||
|
||
if [ "$3" != "" ] | ||
then | ||
SERVICE_PATH=$3 | ||
else | ||
SERVICE_PATH=/ | ||
fi | ||
|
||
curl $URL -v -s -S --header 'Content-Type: application/json: charset=utf-8' --header 'Accept: application/json' --header 'User-Agent: orion/0.10.0' --header "Fiware-Service: $SERVICE" --header "Fiware-ServicePath: $SERVICE_PATH" --header "ngsiv2-attrsformat: normalized" -d @- <<EOF | ||
{ | ||
"subscriptionId" : "51c0ac9ed714fb3b37d7d5a8", | ||
"data" : [ | ||
{ | ||
"temperature": { | ||
"type" : "centigrade", | ||
"value" : "26.5", | ||
"metadata": {} | ||
}, | ||
"pressure": { | ||
"type" : "mmhg", | ||
"value" : "720", | ||
"metadata": { | ||
"ID": { | ||
"type": "string", | ||
"value": "ground" | ||
} | ||
} | ||
}, | ||
"humidity": { | ||
"type" : "percentage", | ||
"value" : "42", | ||
"metadata": {} | ||
}, | ||
"type" : "Room", | ||
"id" : "Room1" | ||
} | ||
] | ||
} | ||
EOF |
123 changes: 123 additions & 0 deletions
123
cygnus-ngsi/resources/ngsi-examples/NGSIv2/notification-json-modelentity.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#!/bin/sh | ||
# Copyright 2016 Telefonica Investigacion y Desarrollo, S.A.U | ||
# | ||
# This file is part of fiware-cygnus. | ||
# | ||
# fiware-cygnus 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. | ||
# | ||
# fiware-cygnus 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 fiware-cygnus. If not, see http://www.gnu.org/licenses/. | ||
# | ||
# For those usages not covered by this license please contact with | ||
# [email protected] | ||
|
||
# This script is aimed to Cygnus debugging. | ||
|
||
URL=$1 | ||
|
||
if [ "$2" != "" ] | ||
then | ||
SERVICE=$2 | ||
else | ||
SERVICE=default | ||
fi | ||
|
||
if [ "$3" != "" ] | ||
then | ||
SERVICE_PATH=$3 | ||
else | ||
SERVICE_PATH=/ | ||
fi | ||
|
||
curl $URL -v -s -S --header 'Content-Type: application/json; charset=utf-8' --header 'Accept: application/json' --header 'User-Agent: orion/0.10.0' --header "Fiware-Service: $SERVICE" --header "Fiware-ServicePath: $SERVICE_PATH" --header "ngsiv2-attrsformat: normalized" -d @- <<EOF | ||
{ | ||
"subscriptionId" : "51c0ac9ed714fb3b37d7d5a8", | ||
"data" : [ | ||
{ | ||
"id": "netrisModel", | ||
"type": "model", | ||
"TimeInstant": { | ||
"type": "ISO8601", | ||
"value": "2014-03-20T14:21:14Z", | ||
"metadata": {} | ||
}, | ||
"ModelProp1": { | ||
"type": "String", | ||
"value": "abc", | ||
"metadata": {} | ||
}, | ||
"ModelProp2": { | ||
"type": "String", | ||
"value": "def", | ||
"metadata": {} | ||
}, | ||
"et": { | ||
"type": "compound", | ||
"value": | ||
{ | ||
"name": "external temperature", | ||
"phenomenon": "temperature", | ||
"type": "Quantity", | ||
"uom": "Cel", | ||
"persistence": [ "sth", "ckan" ] | ||
}, | ||
"metadata": {} | ||
}, | ||
"internal temperature": { | ||
"type": "compound", | ||
"value": [ | ||
{ | ||
"name": "internal temperature", | ||
"phenomenon": "temperature", | ||
"type": "Quantity", | ||
"uom": "Cel" | ||
} | ||
], | ||
"metadata": {} | ||
}, | ||
"h": { | ||
"type": "compound", | ||
"value": [ | ||
{ | ||
"name": "house humidity", | ||
"phenomenon": "humidity", | ||
"type": "Quantity", | ||
"uom": "%" | ||
} | ||
], | ||
"metadata": {} | ||
}, | ||
"reset": { | ||
"type": "compound", | ||
"value": [ | ||
{ | ||
"type": "action", | ||
"input_params": "reqTimeInstant,correlatorID,param_a,param_b", | ||
"output_params": "result,resTimeIntant,param_c,param_d" | ||
} | ||
], | ||
"metadata": {} | ||
}, | ||
"color": { | ||
"type": "compound", | ||
"value": [ | ||
{ | ||
"type": "action", | ||
"input_params": "reqTimeInstant,correlatorID", | ||
"output_params": "result,resTimeInstant" | ||
} | ||
], | ||
"metadata": {} | ||
} | ||
} | ||
] | ||
} | ||
EOF |
Oops, something went wrong.