Commit e7080cd9 authored by Federico Sismondi's avatar Federico Sismondi

Add() scripts for orion entities administration

parent 8826b276
......@@ -3,8 +3,24 @@
[[ -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 "--"
echo "Carouge suscriptions:"
curl --location --request GET \
"http://$ORION_HOST:1026/v2/subscriptions/" \
--header "Fiware-Service: carouge" \
| python -mjson.tool
echo "--"
echo "Braila suscriptions:"
curl --location --request GET \
"http://$ORION_HOST:1026/v2/subscriptions/" \
--header "Fiware-Service: braila" \
| python -mjson.tool
echo "--"
echo "Alicante suscriptions:"
curl --location --request GET \
"http://$ORION_HOST:1026/v2/subscriptions/" \
--header "Fiware-Service: alicante" \
| python -mjson.tool
......@@ -4,7 +4,7 @@
echo "Querying historical data at: ${CRATE_HOST}"
curl --location --request POST \
"http://CRATE_HOST:4200/_sql" \
"http://$CRATE_HOST:4200/_sql" \
--header "Fiware-Service: carouge" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
......
#!/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}"
# API NOTES:
# "condition": { "attrs": [] } -> means monitor all the attributes in the entity
curl --location --request POST \
"http://$ORION_HOST:1026/v2/subscriptions/" \
--header "Fiware-Service: carouge" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{
"description": "Notify QuantumLeap, the historic API, of some Device entity changes",
"subject": {
"entities": [
{
"idPattern": ".*",
"type": "Device"
}
],
"condition": {
"attrs": ["value","serialNumber","name","location","rssi"]
}
},
"notification": {
"http": {
"url": "http://172.18.1.7:8668/v2/notify"
},
"attrs": ["value","serialNumber","name","location","rssi"],
"metadata": ["dateCreated", "dateModified"]
}
}'
#!/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}"
# API NOTES:
# "condition": { "attrs": [] } -> means monitor all the attributes in the entity
curl --location --request POST \
"http://$ORION_HOST:1026/v2/subscriptions/" \
--header "Fiware-Service: carouge" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{
"description": "Notify QuantumLeap, the historic API, of all FlowerBed changes",
"subject": {
"entities": [
{
"idPattern": ".*",
"type": "FlowerBed"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"http": {
"url": "http://172.18.1.7:8668/v2/notify"
},
"attrs": [],
"attrsFormat" : "keyValues",
"metadata": ["dateCreated", "dateModified"]
}
}'
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