You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-central/core/howto-manage-data-export-with-rest-api.md
+89Lines changed: 89 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,6 +233,95 @@ The response to this request looks like the following example:
233
233
}
234
234
```
235
235
236
+
#### Enrichments
237
+
238
+
There are three types of enrichment that you can add to an export: custom strings, system properties, and custom properties:
239
+
240
+
The following example shows how to use the `enrichments` node to add a custom string to the outgoing message:
241
+
242
+
```json
243
+
"enrichments": {
244
+
"My custom string": {
245
+
"value": "My value"
246
+
},
247
+
//...
248
+
}
249
+
```
250
+
251
+
The following example shows how to use the `enrichments` node to add a system property to the outgoing message:
252
+
253
+
```json
254
+
"enrichments": {
255
+
"Device template": {
256
+
"path": "$templateDisplayName"
257
+
},
258
+
//...
259
+
}
260
+
```
261
+
262
+
You can add the following system properties:
263
+
264
+
| Property | Description |
265
+
| -------- | ----------- |
266
+
|`$enabled`| Is the device enabled? |
267
+
|`$displayName`| The device name. |
268
+
|`$templateDisplayName`| The device template name. |
269
+
|`$organizations`| The organizations the device belongs to. |
270
+
|`$provisioned`| Is the device provisioned? |
271
+
|`$simulated`| Is the device simulated? |
272
+
273
+
The following example shows how to use the `enrichments` node to add a custom property to the outgoing message. Custom properties are properties defined in the device template the device is associated with:
You can filter the exported messages based on telemetry or property values.
288
+
289
+
The following example shows how to use the `filter` field to export only messages where the accelerometer-X telemetry value is greater than 0:
290
+
291
+
```json
292
+
{
293
+
"id": "export-001",
294
+
"displayName": "Enriched Export",
295
+
"enabled": true,
296
+
"source": "telemetry",
297
+
"filter": "SELECT * FROM dtmi:azurertos:devkit:gsgmxchip;1 WHERE accelerometerX > 0",
298
+
"destinations": [
299
+
{
300
+
"id": "dest-001"
301
+
}
302
+
],
303
+
"status": "healthy"
304
+
}
305
+
```
306
+
307
+
The following example shows how to use the `filter` field to export only messages where the `temperature` telemetry value is greater than the `targetTemperature` property:
308
+
309
+
```json
310
+
{
311
+
"id": "export-001",
312
+
"displayName": "Enriched Export",
313
+
"enabled": true,
314
+
"source": "telemetry",
315
+
"filter": "SELECT * FROM dtmi:azurertos:devkit:gsgmxchip;1 AS A, dtmi:contoso:Thermostat;1 WHERE A.temperature > targetTemperature",
316
+
"destinations": [
317
+
{
318
+
"id": "dest-001"
319
+
}
320
+
],
321
+
"status": "healthy"
322
+
}
323
+
```
324
+
236
325
### Get an export by ID
237
326
238
327
Use the following request to retrieve details of an export definition from your application:
0 commit comments