/
connection.json
383 lines (383 loc) · 17.2 KB
/
connection.json
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Connection",
"type": "object",
"properties": {
"id": {
"$id": "/properties/id",
"type": "string",
"title": "Connection ID",
"description": "The self assigned unique identifier of the connection",
"examples": [
"myConnection"
]
},
"name": {
"$id": "/properties/name",
"type": "string",
"title": "Connection name",
"description": "A name describing the connection",
"examples": [
"My first Connection"
]
},
"connectionType": {
"$id": "/properties/connectionType",
"type": "string",
"enum": [ "amqp-091", "amqp-10", "mqtt", "kafka", "http-push" ],
"title": "Connection type",
"description": "The type determining the connection's underlying transport protocol",
"examples": [
"amqp-10"
]
},
"connectionStatus": {
"$id": "/properties/connectionStatus",
"type": "string",
"enum": [ "open", "closed" ],
"title": "Connection status",
"description": "The persisted/desired status of the connection",
"examples": [
"open"
]
},
"uri": {
"$id": "/properties/uri",
"type": "string",
"format": "uri",
"title": "Connection URI",
"description": "The URI defining the connections remote endpoint",
"examples": [
"amqps://user:password@localhost:5671"
]
},
"ca": {
"$id": "/properties/ca",
"type": "string",
"title": "Trusted certificates",
"description": "Certificates to trust as DER in PEM-format",
"examples": [
"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"
]
},
"credentials": {
"$id": "/properties/credentials",
"type": "object",
"title": "Credentials",
"description": "Credentials with which Ditto authenticates itself at the connection URI",
"properties": {
"type": {
"$id": "/properties/credentials/properties/type",
"type": "string",
"enum": [ "client-cert" ],
"title": "Type of credentials",
"description": "Type of credentials",
"examples": [
"client-cert"
]
},
"cert": {
"$id": "/properties/credentials/properties/cert",
"type": "string",
"title": "Client certificate for type client-cert",
"description": "Client certificate for type client-cert as DER in PEM-format",
"examples": [
"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"
]
},
"key": {
"$id": "/properties/credentials/properties/key",
"type": "string",
"title": "Client private key for type client-cert",
"description": "Unencrypted client private for type client-cert as PKCS8 in PEM-format",
"examples": [
"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
]
}
}
},
"sources": {
"$id": "/properties/sources",
"type": "array",
"title": "The subscription sources of this connection",
"description": "The subscription sources of this connection",
"uniqueItems": true,
"items": {
"$id": "/properties/sources/items",
"type": "object",
"title": "Source",
"description": "A subscription source subscribed by this connection",
"properties": {
"addresses": {
"$id": "/properties/sources/properties/addresses",
"type": "array",
"uniqueItems": true,
"title": "Array of source addresses",
"description": "The source addresses this connection consumes messages from.",
"items": {
"$id": "/properties/sources/items/addresses/items",
"type": "string",
"title": "Source address",
"description": "A source address to consume messages from."
}
},
"consumerCount": {
"$id": "/properties/sources/items/properties/consumerCount",
"type": "integer",
"title": "Consumer count",
"description": "The number of consumers that should be attached to each source address.",
"default": 1
},
"authorizationContext": {
"$id": "/properties/sources/items/properties/authorizationContext",
"type": "array",
"title": "The authorization context",
"description": "The authorization context defines all authorization subjects associated for this source. ",
"uniqueItems": true,
"items": {
"$id": "/properties/authorizationContext/items",
"type": "string",
"title": "Authorization Subject",
"description": "An authorization subject associated with this source. You can either use a fixed subject or use a placeholder that resolves header values from incoming messages. For example to use the `device_id` header in the subject, you can specify the placeholder `{{ header:device_id }}` which is then replaced by Ditto when a message from this source is processed. By using a placeholder you can access any header value: `{{ header:<any-header-name> }}`.",
"examples": [
"ditto:myAuthorizationSubject",
"device:{{ header:device-id }}"
]
}
},
"enforcement": {
"$id": "/properties/sources/items/properties/enforcement",
"type": "object",
"title": "Enforcement configuration",
"description": "Configuration of enforcement for this source",
"properties": {
"input": {
"$id": "/properties/sources/items/properties/enforcement/input",
"type": "string",
"title": "Input value of enforcement",
"description": "The input value of the enforcement that should identify the origin of the message (e.g. a device id). Placeholders can be used within this field depending on the connection type. E.g. for AMQP 1.0 connections you can use `{{ header:[any-header-name] }}` to resolve the value from a message header.",
"examples": ["{{ header:device_id }}", "{{ source:address }}"]
},
"filters": {
"$id": "/properties/sources/items/properties/enforcement/filters",
"type": "array",
"uniqueItems": true,
"title": "Array of enforcement filters",
"description": "An array of filters. One of the defined filters must match the input value from the message otherwise the message is rejected.",
"items": {
"$id": "/properties/sources/items/enforcement/filters/items",
"type": "string",
"title": "Enforcement filter string",
"description": "A filter that must match the input value for a message to be accepted. You can use the placeholders `{{ thing:id }}`, `{{ thing:name }}` or `{{ thing:namespace }}` in a filter."
}
}
}
},
"headerMapping": {
"$id": "/properties/sources/items/properties/headerMapping",
"type": "object",
"title": "Header mapping configuration",
"description": "Headers to map for each incoming message (after the optional payload transformation) from the source's protocol headers to internal DittoHeaders.",
"additionalProperties": false,
"patternProperties":
{
"^.+$":
{
"title": "header value",
"description": "The key is the internal DittoHeader key to set, the value can make use of placeholders in order to access external header values via `{{ header:[any-header-name] }}`, the Thing ID via `{{ thing:id }}` or to access the DittoProtocol topic via `{{ topic:[topic-placeholder-attr] }}`.",
"type": "string"
}
}
},
"payloadMapping": {
"$id": "/properties/sources/items/properties/payloadMapping",
"type": "array",
"title": "Payload mapping reference",
"description": "References the IDs of payload mappers defined in the payload mapping definitions that are applied to messages received via this source.",
"patternProperties": {
"^.+$": {
"title": "Payload mapping reference",
"description": "References the IDs of payload mappers defined in the payload mapping definitions that are applied to messages received via this source.",
"type": "string"
}
}
}
}
}
},
"targets": {
"$id": "/properties/targets",
"type": "array",
"title": "The publish targets of this connection",
"description": "The publish targets of this connection",
"uniqueItems": true,
"items": {
"$id": "/properties/targets/items",
"type": "object",
"title": "Target",
"description": "A publish target served by this connection",
"properties": {
"address": {
"$id": "/properties/targets/properties/address",
"type": "string",
"title": "Target address",
"description": "The target address where events, commands and messages are published to. The following placeholders are allowed within the target address:\n * Thing ID: `{{ thing:id }}`\n * Thing Namespace: `{{ thing:namespace }}`\n * Thing Name: `{{ thing:name }}` (the part of the ID without the namespace)"
},
"topics": {
"$id": "/properties/targets/items/properties/topics",
"type": "array",
"title": "Topics",
"description": "The topics to which this target is registered for.",
"uniqueItems": true,
"items": {
"type": "string",
"title": "Subscribed topics.",
"description": "Contains the type of messages that are delivered to this target. You can receive\n * Thing events: `_/_/things/twin/events` (notification about twin change) \n * Live events: `_/_/things/live/events`\n * Live commands: `_/_/things/live/commands`\n * Live messages: `_/_/things/live/messages`\n\nYou can specify an additional namespace and/or event filter (URL encoded)",
"examples": [
"_/_/things/twin/events",
"_/_/things/twin/events?namespaces=org.eclipse.ditto.one,org.eclipse.foo",
"_/_/things/twin/events?namespaces=org.eclipse.ditto&filter=eq(attributes/counter,42)",
"_/_/things/live/commands",
"_/_/things/live/commands?namespaces=org.eclipse.ditto.one",
"_/_/things/live/events",
"_/_/things/live/events?filter=eq(attributes/counter,42)",
"_/_/things/live/messages",
"_/_/things/live/messages?namespaces=org.eclipse.ditto"
]
}
},
"authorizationContext": {
"$id": "/properties/targets/items/properties/authorizationContext",
"type": "array",
"title": "The authorization context",
"description": "The authorization context defines all authorization subjects associated for this target. ",
"uniqueItems": true,
"items": {
"$id": "/properties/authorizationContext/items",
"type": "string",
"title": "Authorization Subject",
"description": "An authorization subject associated with this target.",
"examples": [
"ditto:myAuthorizationSubject"
]
}
},
"headerMapping": {
"$id": "/properties/targets/items/properties/headerMapping",
"type": "object",
"title": "Header mapping configuration",
"description": "Headers to map for each outgoing message (after the optional payload transformation) from the internal DittoHeaders to the targets's protocol headers.",
"additionalProperties": false,
"patternProperties":
{
"^.+$":
{
"title": "header value",
"description": "The key is the external header key to set, the value can make use of placeholder in order to access DittoHeader values via `{{ header:[any-header-name] }}`, the Thing ID via `{{ thing:id }}` or to access the DittoProtocol topic via `{{ topic:[topic-placeholder-attr] }}`.",
"type": "string"
}
}
},
"payloadMapping": {
"$id": "/properties/targets/items/properties/payloadMapping",
"type": "array",
"title": "Payload mapping reference",
"description": "References the IDs of payload mappers defined in the payload mapping definitions that are applied to messages received via this target.",
"patternProperties": {
"^.+$": {
"title": "Payload mapping reference",
"description": "References the IDs of payload mappers defined in the payload mapping definitions that are applied to messages received via this source.",
"type": "string"
}
}
}
}
}
},
"clientCount": {
"$id": "/properties/clientCount",
"type": "integer",
"title": "Client count",
"description": "The client count defines how many clients are instantiated for this connection. Each client opens a separate 'physical' connection and thus raises the overall availability and throughput of the connection. Clients are always instantiated on separate AKKA cluster nodes while having only a single client per node. Therefore the max client count is limited by the number of cluster nodes.",
"default": 1,
"minimum": 1,
"maximum": "#clusterNodes",
"examples": [
1,2,3
]
},
"failoverEnabled": {
"$id": "/properties/failoverEnabled",
"type": "boolean",
"title": "Failover enabled",
"description": "Defines if this connection uses automatic reconnect/recovery mechanisms when an active open connection fails",
"default": true
},
"validateCertificates": {
"$id": "/properties/validateCertificates",
"type": "boolean",
"title": "Validate certificates",
"description": "Defines if SSL certificate validation is enabled for this connection",
"default": true
},
"processorPoolSize": {
"$id": "/properties/processorPoolSize",
"type": "integer",
"title": "Processor pool size",
"description": "The processor pool size determines how many mapping processors are instantiated per client, therefore the total amount of mapping processors depends on the configured client count. By increasing the processor count, you can scale the message throughput in mapping scenarios.",
"default": 5,
"minimum": 1,
"examples": [
1,2,3,5,8
]
},
"specificConfig": {
"$id": "/properties/specificConfig",
"type": "object",
"title": "Specific config",
"description": "Depending on the configured connection type, there might be protocol specific configuration options or tuning settings available. These can be configured in the specific config object. The specific config object is interpreted as a key value based map of setting properties.",
"additionalProperties": false,
"patternProperties":
{
"^.+$":
{
"title": "Setting value",
"description": "Setting value",
"type": "string"
}
}
},
"mappingDefinitions": {
"$id": "/properties/mappingDefinitions",
"type": "object",
"additionalProperties": {
"type": "object",
"description": "The payload mapping definitions.",
"properties": {
"mappingEngine": {
"$id": "/properties/mappingDefinitions/properties/mappingEngine",
"type": "string",
"title": "Mapping engine",
"description": "The Mapping engine defines which kind of mapping processor is instantiated for this connection. Currently you can choose between `Ditto`, `JavaScript`, `Normalized` and `ConnectionStatus`. The payload mapper documentation provides a detailed description of available mappers or how to bring your own mapper."
},
"options": {
"$id": "/properties/mappingDefinitions/properties/options",
"type": "object",
"title": "Options",
"description": "The mapping options contain specific configuration settings for the selected mapping engine. The options object is interpreted as a key value based map of setting properties.",
"additionalProperties": false,
"patternProperties": {
"^.+$": {
"title": "Setting value",
"description": "Setting value",
"type": "string"
}
}
}
}
}
}
},
"additionalProperties": false,
"required": [ "id", "connectionType", "connectionStatus", "uri", "authorizationContext"]
}