forked from FIWARE/tutorials.PEP-Proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision-groups
executable file
·113 lines (107 loc) · 3.58 KB
/
provision-groups
1
2
3
4
5
6
7
8
9
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
#
# curl commands to reload the data from the previous tutorial
#
#
set -e
printf "⏳ Provisioning IoT Service Groups "
#
# Create a service groups for all UltraLight IoT devices
#
curl -s -o /dev/null -X POST \
'http://iot-agent:4041/iot/services' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"services": [
{
"apikey": "1068318794",
"cbroker": "http://orion:1026",
"entity_type": "Motion",
"resource": "/iot/d",
"protocol": "PDI-IoTA-UltraLight",
"transport": "HTTP",
"timezone": "Europe/Berlin",
"attributes": [
{ "object_id": "c", "name":"count", "type":"Integer"}
],
"static_attributes": [
{"name": "category", "type":"Text", "value": ["sensor"]},
{"name": "controlledProperty", "type": "Text", "value": "motion"},
{"name": "function", "type": "Text", "value":["sensing"]},
{"name": "supportedProtocol", "type": "Text", "value": ["ul20"]},
{"name": "supportedUnits", "type": "Text", "value": "C62"}
]
},
{
"apikey": "3020035",
"cbroker": "http://orion:1026",
"entity_type": "Bell",
"resource": "/iot/d",
"protocol": "PDI-IoTA-UltraLight",
"transport": "HTTP",
"timezone": "Europe/Berlin",
"commands": [
{
"name": "ring",
"type": "command"
}
],
"static_attributes": [
{"name": "category", "type":"Text", "value": ["actuator"]},
{"name": "controlledProperty", "type": "Text", "value": "noiseLevel"},
{"name": "function", "type": "Text", "value":["onOff"]},
{"name": "supportedProtocol", "type": "Text", "value": ["ul20"]}
]
},
{
"apikey": "3314136",
"cbroker": "http://orion:1026",
"entity_type": "Lamp",
"resource": "/iot/d",
"protocol": "PDI-IoTA-UltraLight",
"transport": "HTTP",
"timezone": "Europe/Berlin",
"commands": [
{"name": "on","type": "command"},
{"name": "off","type": "command"}
],
"attributes": [
{"object_id": "s", "name": "state", "type":"Text"},
{"object_id": "l", "name": "luminosity", "type":"Integer"}
],
"static_attributes": [
{"name": "category", "type":"Text", "value": ["actuator","sensor"]},
{"name": "controlledProperty", "type": "Text", "value": "light"},
{"name": "function", "type": "Text", "value":["onOff", "sensing"]},
{"name": "supportedProtocol", "type": "Text", "value": ["ul20"]},
{"name": "supportedUnits", "type": "Text", "value": "CDL"}
]
},
{
"apikey": "3089326",
"cbroker": "http://orion:1026",
"entity_type": "Door",
"resource": "/iot/d",
"protocol": "PDI-IoTA-UltraLight",
"transport": "HTTP",
"timezone": "Europe/Berlin",
"commands": [
{"name": "unlock","type": "command"},
{"name": "open","type": "command"},
{"name": "close","type": "command"},
{"name": "lock","type": "command"}
],
"attributes": [
{"object_id": "s", "name": "state", "type":"Text"}
],
"static_attributes": [
{"name": "category", "type":"Text", "value": ["actuator", "sensor"]},
{"name": "controlledProperty", "type": "Text", "value": "state"},
{"name": "function", "type": "Text", "value":["openClose", "eventNotification"]},
{"name": "supportedProtocol", "type": "Text", "value": ["ul20"]}
]
}
]
}'