Skip to content

Commit 0fe4018

Browse files
Merge pull request #246013 from dominicbetts/central-cde-api-updates
IoT Central: Add detail to CDE API doc
2 parents faf03a5 + 3fff047 commit 0fe4018

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

articles/iot-central/core/howto-manage-data-export-with-rest-api.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,95 @@ The response to this request looks like the following example:
233233
}
234234
```
235235

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:
274+
275+
```json
276+
"enrichments": {
277+
"Device model": {
278+
"target": "dtmi:azure:DeviceManagement:DeviceInformation;1",
279+
"path": "model"
280+
},
281+
//...
282+
}
283+
```
284+
285+
#### Filters
286+
287+
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+
236325
### Get an export by ID
237326

238327
Use the following request to retrieve details of an export definition from your application:

0 commit comments

Comments
 (0)