Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
naiades
naiades-platform-poc
Commits
4ba792a9
Commit
4ba792a9
authored
Oct 05, 2020
by
Federico Sismondi
Browse files
Merge branch 'admin_scripts' into 'master'
Add() scripts for orion entities administration See merge request
!12
parents
cc65e678
e7080cd9
Changes
5
Hide whitespace changes
Inline
Side-by-side
scripts
/
admin
_get_all_orion
_susbcriptions.sh
→
scripts
-
admin
/discover_all
_susbcriptions.sh
View file @
4ba792a9
...
...
@@ -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
scripts
/
admin
_
historic_get_tables.sh
→
scripts
-
admin
/
historic_
api_
get_tables.sh
View file @
4ba792a9
...
...
@@ -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"
\
...
...
scripts-admin/historic_api_subscribe_to_device.sh
0 → 100755
View file @
4ba792a9
#!/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"]
}
}'
scripts-admin/historic_api_subscribe_to_flower_bed.sh
0 → 100755
View file @
4ba792a9
#!/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"]
}
}'
scripts
/
admin
_susbcription_for_historic_data_weather
.sh
→
scripts
-
admin
/historic_api_subscribe_to_weather_observed
.sh
View file @
4ba792a9
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment