watering_01_create_entity.sh 1.42 KB
Newer Older
1
#!/usr/bin/env bash
2 3 4 5 6 7 8

[[ -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 -iX POST \
    "http://$ORION_HOST:1026/v2/entities/" \
    --header "Fiware-Service: carouge" \
9
    --header "Fiware-ServicePath: /Watering" \
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
    --header "Content-Type: application/json" \
    --data '{
        "id": "urn:ngsi-ld:FlowerBed:FlowerBed-345",
        "type": "FlowerBed",
        "category": {
            "type": "Property",
            "value": ["urbanTreeSpot"]
        },
        "soilMoistureVwc": {
            "type": "Property",
            "value": 0.85
        },
        "dateLastWatering": {
            "type": "Property",
            "value": {
                "@type": "DateTime",
                "@value": "2020-02-11T08:00:00Z"
            }
        },
        "soilTemperature": {
            "type": "Property",
            "value": 17
        },
        "address": {
            "type": "Property",
            "value": {
                "addressCountry": "Switzerland",
                "streetAddress": "Place de Sardaigne",
                "adressLocality": "Carouge",
                "type": "PostalAddress"
            }
        },
        "location": {
            "type": "GeoProperty",
            "value": {
                "type": "Point",
                "coordinates": [46.184255,6.1378375]
            }
        }
    }
'