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

[[ -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 \
7
    "http://$ORION_HOST:1026/v2/entities/?options=keyValues" \
8
    --header "Fiware-Service: carouge" \
9
    --header "Fiware-ServicePath: /Watering" \
10 11
    --header "Content-Type: application/json" \
    --data '{
12
        "id": "urn:ngsi-ld:FlowerBed:FlowerBed-1",
13
        "type": "FlowerBed",
14 15 16 17
        "dateModified":"2017-03-31T08:00",
        "category": ["urbanTreeSpot"],
        "dateLastWatering": "2017-03-31T08:00",
        "nextWateringDeadline":"2017-04-31T08:00",
18
        "address": {
19 20 21
            "streetAddress": "Place de Sardaigne",
            "adressLocality": "Carouge",
            "addressCountry": "Switzerland"
22
        },
23 24
        "soilTemperature": 17,
        "soilMoistureVwc": 0.85
25
    }
26
    '