Commit fee9d200 authored by Federico Sismondi's avatar Federico Sismondi

Update() watering scripts using orion LD API

parent d7c95bb3
...@@ -3,14 +3,8 @@ ...@@ -3,14 +3,8 @@
[[ -z "$ORION_HOST" ]] && echo "Please set ORION_HOST env var. E.g. export ORION_HOST=127.0.0.1" && exit [[ -z "$ORION_HOST" ]] && echo "Please set ORION_HOST env var. E.g. export ORION_HOST=127.0.0.1" && exit
echo "Querying context broker at: ${ORION_HOST}" echo "Querying context broker at: ${ORION_HOST}"
curl --location --request GET \ curl -X GET \
"http://$ORION_HOST:1026/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-345/attrs/soilMoistureVwc" \ "http://$ORION_HOST:1026/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-345" \
--header "Fiware-Service: carouge" \ -H 'Accept: application/json' \
--header "Fiware-ServicePath: /watering" \ -H 'Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
| python -mjson.tool
#curl --location --request GET \
# "http://$ORION_HOST:1026/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-345/attrs/location" \
# --header "Fiware-Service: carouge" \
# --header "Fiware-ServicePath: /watering" \
# | python -mjson.tool
\ No newline at end of file
...@@ -9,5 +9,5 @@ curl --location --request PATCH \ ...@@ -9,5 +9,5 @@ curl --location --request PATCH \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"type": "Property", "type": "Property",
"value": 8 "value": 23
}' }'
...@@ -18,7 +18,7 @@ curl --location --request POST \ ...@@ -18,7 +18,7 @@ curl --location --request POST \
"entities": [{"type": "FlowerBed"}], "entities": [{"type": "FlowerBed"}],
"notification": { "notification": {
"attributes": ["soilMoistureVwc"], "attributes": ["soilMoistureVwc"],
"format": "keyValues", "format": "normalized",
"endpoint": { "endpoint": {
"uri": "'${SUBSCRIPTION_URL}'", "uri": "'${SUBSCRIPTION_URL}'",
"accept": "application/json" "accept": "application/json"
......
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment