Repository navigation
Expand file tree
/
Copy pathschema_data.json
More file actions
233 lines (233 loc) · 9.83 KB
/
Copy pathschema_data.json
File metadata and controls
233 lines (233 loc) · 9.83 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Bastard schema",
"description": "Interface message specification in json format",
"oneOf" : [
{ "$ref": "#/definitions/network" },
{ "$ref": "#/definitions/device" },
{ "$ref": "#/definitions/service" },
{ "$ref": "#/definitions/value" },
{ "$ref": "#/definitions/status" }
],
"definitions": {
"network": {
"type": "object",
"required": [":type", ":id"],
"properties": {
":id": {
"description": "The unique identifier for a network object",
"type": "string",
"pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
},
":type": {
"description": "uniform resource name",
"type": "string",
"enum": ["urn:seluxit:xml:bastard:network-1.0"]
}
"name": {
"description": "Name of the current Device",
"type": "string"
},
}
},
"device": {
"type": "object",
"required": [":type", ":id"],
"properties": {
":id": {
"description": "The unique identifier for a device object",
"type": "string",
"pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
},
":type": {
"description": "Shadoway type - resource name",
"type": "string",
"enum": ["urn:seluxit:xml:bastard:device-1.0"]
},
"name": {
"description": "Name of the current Device",
"type": "string"
},
"manufacturer": {
"description": "Name of the company that create the Device",
"type": "string"
},
"product": {
"description": "Type of the Device",
"type": "string"
},
"version" : {
"description": "Version of the Device",
"type": "string"
},
"serial" : {
"description": "Serial of the Device",
"type": "string"
},
"description" : {
"description": "A description of this Device",
"type": "string"
},
"protocol" : {
"description": "Communication protocol used by the Device",
"type": "string"
},
"communication" : {
"description": "Status of the communication of the Device",
"type": "string"
},
"included" : {
"description": "If the Device is included in your Network (1) or not (0)",
"type": "string"
}
},
"additionalProperties": false
},
"service": {
"type": "object",
"required": [":type", ":id"],
"oneOf": [
{ "required": ["number"] },
{ "required": ["string"] },
{ "required": ["xml"] },
{ "required": ["blob"] }
],
"properties": {
":id": {
"description": "The unique identifier for a value object",
"type": "string",
"pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
},
":type": {
"description": "Shadoway type - resource name",
"type": "string",
"enum": ["urn:seluxit:xml:bastard:service-1.0"]
},
"name": {
"description": "Name of the current service",
"type": "string"
},
"permission": {
"description": "Permissions of write and reading, it can be 'r' (read only), 'w' (write only), 'rw' or 'wr' (read and write)",
"type": "string",
"enum" : ["r", "rw", "w", "wr"]
},
"type": {
"description": "Indicate the type of the Service, i.e. 'Humidity', 'Temperature', etc.",
"type": "string"
},
"number": {
"description": "Contains some limitations of the data that we can receive in our device, as the minimum value, the maximum value, the steps-size between the values and the unit of the value. The unit is in the Internat ional System of Units (SI) format.",
"type": "object",
"properties": {
"min": { "type": "number" },
"max": { "type": "number" },
"step": { "type": "number" },
"unit": { "type": "number" }
},
"required": ["min", "max", "step"],
"additionalProperties": false
},
"string": {
"description": "Contains the max length of the string and the used encoding",
"type": "object",
"properties": {
"max": { "type": "number" },
"encoding": { "type": "string" }
},
"additionalProperties": false
},
"blob": {
"description": "Contains the max length of the blob and the used encoding",
"type": "object",
"properties": {
"max": { "type": "number" },
"encoding": { "type": "string" }
},
"additionalProperties": false
},
"xml": {
"description": "Contains the xsd of the xml we want to user and its namespace",
"type": "object",
"properties": {
"xsd": { "type": "string" },
"namespace": { "type": "string" }
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"value": {
"type": "object",
"required": [":type", ":id", "timestamp", "data"],
"properties": {
":id": {
"description": "The unique identifier for a state object",
"type": "string",
"pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
},
":type": {
"description": "Shadoway type - resource name",
"type": "string",
"enum": ["urn:seluxit:xml:bastard:value-1.0"]
},
"type": {
"description": "Indicate the type of the State",
"type": "string",
"enum": ["Report", "Control"]
},
"timestamp": {
"description": "Denotes the time when backend receive the last data from the Device",
"type": "string",
"format": "date-time"
},
"data": {
"description": "The data received or sent to the device. A data can have min, max and step in relation of its Service. If the Value is not included in the min-max range, then it is capped to be with in this range. If the Value do not conform the step size, then it is rounded down",
"type": "string"
}
},
"additionalProperties": false
},
"status": {
"type": "object",
"required": [":type", ":id", "level", "message", "timestamp"],
"properties": {
":id": {
"description": "The unique identifier for a status object",
"type": "string",
"pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
},
":type": {
"description": "Shadoway type - resource name",
"type": "string",
"enum": ["urn:seluxit:xml:bastard:status-1.0"]
},
"level": {
"description": "The level of importance of the status.",
"type": "string",
"enum": ["important", "error", "warning", "info", "debug"]
},
"type": {
"description": "The type of the status.",
"type": "string",
"enum": ["public key", "memory information", "device description", "value description", "value", "partner information", "action", "calculation", "timer", "calendar", "statemachine", "firmware update", "configuration", "exi", "system", "application", "gateway"]
},
"message": {
"description": "Message of the status",
"type": "string"
},
"timestamp": {
"description": "Time of when the status occur",
"type": "string",
"format": "date-time"
},
"data": {
"description": "Data of the status",
"type": "string"
}
},
"additionalProperties": false
}
}
}