|
| 1 | +--- |
| 2 | +code: true |
| 3 | +type: page |
| 4 | +title: ingestMeasures |
| 5 | +description: Kuzzle IoT Platform - Device Manager - Assets Controller |
| 6 | +--- |
| 7 | + |
| 8 | +# ingestMeasures |
| 9 | + |
| 10 | +Ingest measures from a data source into an asset. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Query Syntax |
| 15 | + |
| 16 | +### HTTP |
| 17 | + |
| 18 | +```http |
| 19 | +URL: http://kuzzle:7512/_/device-manager/:engineId/assets/:assetId/_mMeasureIngest |
| 20 | +Method: POST |
| 21 | +``` |
| 22 | + |
| 23 | +### Other protocols |
| 24 | + |
| 25 | +```js |
| 26 | +{ |
| 27 | + "controller": "device-manager/assets", |
| 28 | + "action": "_mMeasureIngest", |
| 29 | + "assetId": "<assetId>", |
| 30 | + "engineId": "<engineId>", |
| 31 | + "body": { |
| 32 | + "dataSource": { |
| 33 | + "id": "<id>", |
| 34 | + // optional: |
| 35 | + "metadata": { |
| 36 | + // ... |
| 37 | + } |
| 38 | + }, |
| 39 | + "measurements": [ |
| 40 | + { |
| 41 | + "slotName": "<measureName>", |
| 42 | + "measuredAt": "<measuredAt>", |
| 43 | + "values": { |
| 44 | + "<valueName>": "<value>", |
| 45 | + // ... |
| 46 | + } |
| 47 | + } |
| 48 | + // ... |
| 49 | + ] |
| 50 | + }, |
| 51 | + |
| 52 | + // optional: |
| 53 | + "engineGroup": "<engine group>" |
| 54 | +} |
| 55 | +``` |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Arguments |
| 60 | + |
| 61 | +- `engineId`: target engine id |
| 62 | +- `assetId`: target asset id |
| 63 | +- `engineGroup`: (optional): target engine group |
| 64 | + |
| 65 | +## Body properties |
| 66 | + |
| 67 | +- `dataSource`: the measures source |
| 68 | +- `measurements`: the list of measurements to ingest |
| 69 | + |
| 70 | +# Datasource properties |
| 71 | + |
| 72 | +- `id`: the measure source unique identifier |
| 73 | +- `metadata`: (optional) additional metadata for the source |
| 74 | + |
| 75 | +# Measurement properties |
| 76 | + |
| 77 | +- `slotName`: target measure slot name |
| 78 | +- `measuredAt`: the timestamp of when the measure was collected |
| 79 | +- `values`: the measure values |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +## Response |
| 84 | + |
| 85 | +```js |
| 86 | +{ |
| 87 | + "status": 200, |
| 88 | + "error": null, |
| 89 | + "controller": "device-manager/assets", |
| 90 | + "action": "mMeasureIngest", |
| 91 | + "requestId": "<unique request identifier>", |
| 92 | + "result": null, |
| 93 | +} |
| 94 | +``` |
| 95 | + |
| 96 | +## Errors |
| 97 | + |
| 98 | +Ingesting measures with incorrect values will throw a [ MeasureValidationError ](../../../errors/measure-validation/index.md) with the HTTP code **400**. |
0 commit comments