Commit 91c2b2ec authored by Federico Sismondi's avatar Federico Sismondi
Browse files

Merge branch 'authenticated_requests' into 'master'

Authenticated requests

See merge request !2
parents ca913f1f 1afce8da
#!/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 \
"http://$ORION_HOST:1026/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-345/attrs/soilMoistureVwc/value" \
--header "Fiware-Service: carouge" \
--header "Fiware-ServicePath: /watering" \
| 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" \
# --header "Fiware-ServicePath: /watering" \
# | python -mjson.tool
\ No newline at end of file
#!/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 \
"http://$ORION_HOST:1026/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-345/attrs/soilMoistureVwc" \
--header "Fiware-Service: carouge" \
--header "Fiware-ServicePath: /watering" \
| 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
#!/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 PUT \
"http://$ORION_HOST:1026/v2/entities/urn:ngsi-ld:FlowerBed:FlowerBed-345/attrs/soilMoistureVwc/value"\
--header "Fiware-Service: carouge" \
--header "Fiware-ServicePath: /watering" \
--header "Content-Type: text/plain" \
-d $(( RANDOM % 10 ))
#!/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}"
[[ -z "$SUBSCRIPTION_URL" ]] && echo "Please set SUBSCRIPTION_URL env var. E.g. export SUBSCRIPTION_URL=http://172.18.1.11:5000/on_change_soilMoistureVwc" && exit
echo "Callback URL for subscriptions is: ${SUBSCRIPTION_URL}"
curl --location --request POST \
"http://$ORION_HOST:1026/v2/subscriptions/" \
--header "Fiware-Service: carouge" \
--header "Fiware-ServicePath: /watering" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{
"description": "A subscription to subscribe to FlowerBed.soilMoistureVwc",
"subject": {
"entities": [
{
"id": "urn:ngsi-ld:FlowerBed:FlowerBed-345",
"type": "FlowerBed"
}
],
"condition": {
"attrs": [
"soilMoistureVwc"
]
}
},
"notification": {
"http": {
"url": "'${SUBSCRIPTION_URL}'"
},
"attrs": [
"soilMoistureVwc"
],
"attrsFormat": "keyValues"
},
"throttling": 5
}'
#!/bin/sh
[[ -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 \
"http://$ORION_HOST:1026/v2/subscriptions/" \
--header "Fiware-Service: carouge" \
--header "Fiware-ServicePath: /watering" \
| python -mjson.tool
Supports Markdown
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