watering_04_retrieve_attribute_value.sh 678 Bytes
Newer Older
1 2 3 4 5 6
#!/usr/bin/env bash

[[ -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}"

curl --location --request GET \
7
    "http://$ORION_HOST:1026/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-1/attrs/soilMoistureVwc/value" \
8
    --header "Fiware-Service: carouge" \
9
    --header "Fiware-ServicePath: /Watering" \
10 11 12 13 14
    | python -mjson.tool

#curl --location --request GET \
#    "http://$ORION_HOST:1026/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-345/attrs/location/value" \
#    --header "Fiware-Service: carouge" \
15
#    --header "Fiware-ServicePath: /Watering" \
16
#    | python -mjson.tool