-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
2,408 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: ingestMeasure | ||
description: Kuzzle IoT Platform - Device Manager - Assets Controller | ||
--- | ||
|
||
# ingestMeasure | ||
|
||
Ingest a single measure into an asset. | ||
|
||
--- | ||
|
||
## Query Syntax | ||
|
||
### HTTP | ||
|
||
```http | ||
URL: http://kuzzle:7512/_/device-manager/:engineId/assets/:assetId/measures/:slotName | ||
Method: POST | ||
``` | ||
|
||
### Other protocols | ||
|
||
```js | ||
{ | ||
"controller": "device-manager/assets", | ||
"action": "measureIngest", | ||
"assetId": "<assetId>", | ||
"engineId": "<engineId>", | ||
"slotName": "<slotName>" | ||
"body": { | ||
"dataSource": { | ||
"id": "<id>", | ||
// optional: | ||
"metadata": { | ||
// ... | ||
} | ||
}, | ||
"measuredAt": "<measuredAt>" | ||
"values": { | ||
"<valueName>": "<value>", | ||
// ... | ||
} | ||
}, | ||
|
||
// optional: | ||
"engineGroup": "<engine group>" | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Arguments | ||
|
||
- `engineId`: target engine id | ||
- `assetId`: target asset id | ||
- `slotName`: target measure slot name | ||
- `engineGroup` (optional): target engine group | ||
|
||
## Body properties | ||
- `dataSource`: the measure source | ||
- `measuredAt`: the timestamp of when the measure was collected | ||
- `values`: the measure values | ||
|
||
# Datasource properties | ||
|
||
- `id`: the measure source unique identifier | ||
- `metadata`: (optional) additional metadata for the source | ||
|
||
--- | ||
|
||
## Response | ||
|
||
```js | ||
{ | ||
"status": 200, | ||
"error": null, | ||
"controller": "device-manager/assets", | ||
"action": "measureIngest", | ||
"requestId": "<unique request identifier>", | ||
"result": null, | ||
} | ||
``` | ||
|
||
## Errors | ||
|
||
Ingesting a measure with incorrect values will throw a [ MeasureValidationError ](../../../errors/measure-validation/index.md) with the HTTP code **400**. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: ingestMeasures | ||
description: Kuzzle IoT Platform - Device Manager - Assets Controller | ||
--- | ||
|
||
# ingestMeasures | ||
|
||
Ingest measures from a data source into an asset. | ||
|
||
--- | ||
|
||
## Query Syntax | ||
|
||
### HTTP | ||
|
||
```http | ||
URL: http://kuzzle:7512/_/device-manager/:engineId/assets/:assetId/_mMeasureIngest | ||
Method: POST | ||
``` | ||
|
||
### Other protocols | ||
|
||
```js | ||
{ | ||
"controller": "device-manager/assets", | ||
"action": "_mMeasureIngest", | ||
"assetId": "<assetId>", | ||
"engineId": "<engineId>", | ||
"body": { | ||
"dataSource": { | ||
"id": "<id>", | ||
// optional: | ||
"metadata": { | ||
// ... | ||
} | ||
}, | ||
"measurements": [ | ||
{ | ||
"slotName": "<measureName>", | ||
"measuredAt": "<measuredAt>", | ||
"values": { | ||
"<valueName>": "<value>", | ||
// ... | ||
} | ||
} | ||
// ... | ||
] | ||
}, | ||
|
||
// optional: | ||
"engineGroup": "<engine group>" | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Arguments | ||
|
||
- `engineId`: target engine id | ||
- `assetId`: target asset id | ||
- `engineGroup`: (optional): target engine group | ||
|
||
## Body properties | ||
|
||
- `dataSource`: the measures source | ||
- `measurements`: the list of measurements to ingest | ||
|
||
# Datasource properties | ||
|
||
- `id`: the measure source unique identifier | ||
- `metadata`: (optional) additional metadata for the source | ||
|
||
# Measurement properties | ||
|
||
- `slotName`: target measure slot name | ||
- `measuredAt`: the timestamp of when the measure was collected | ||
- `values`: the measure values | ||
|
||
--- | ||
|
||
## Response | ||
|
||
```js | ||
{ | ||
"status": 200, | ||
"error": null, | ||
"controller": "device-manager/assets", | ||
"action": "mMeasureIngest", | ||
"requestId": "<unique request identifier>", | ||
"result": null, | ||
} | ||
``` | ||
|
||
## Errors | ||
|
||
Ingesting measures with incorrect values will throw a [ MeasureValidationError ](../../../errors/measure-validation/index.md) with the HTTP code **400**. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
code: false | ||
type: page | ||
title: Measure Validation | ||
description: Measure Validation | Kuzzle Documentation | ||
--- | ||
|
||
# Measure Validation | ||
|
||
A `MeasureValidationError` is thrown when the provided measures values could not be validated by the JSON schema. It can occur on creation of a measure. | ||
|
||
**HTTP status**: 400 | ||
|
||
**Additional Properties:** | ||
|
||
| property | type | description | | ||
| -------- | ---------------- | ---------------------------------------------------- | | ||
| `errors` | array of objects | List of invalid data from measures, by measures names. | | ||
|
||
Here is an example of a `errors` field: | ||
```js | ||
[ | ||
{ | ||
"measureName": "magiculeExt", | ||
"validationErrors": [ | ||
{ | ||
"instancePath": "/magicule", | ||
"schemaPath": "#/properties/magicule/type", | ||
"keyword": "type", | ||
"params": { | ||
"type": "integer" | ||
}, | ||
"message": "must be integer" | ||
} | ||
] | ||
}, | ||
{ | ||
"measureName": "magiculeInt", | ||
"validationErrors": [ | ||
{ | ||
"instancePath": "/magicule", | ||
"schemaPath": "#/properties/magicule/type", | ||
"keyword": "type", | ||
"params": { | ||
"type": "integer" | ||
}, | ||
"message": "must be integer" | ||
} | ||
] | ||
} | ||
] | ||
``` | ||
|
||
Errors fields: | ||
| field | type | description | | ||
| -------------------- | ---------------- | ------------------------------------------------ | | ||
| `measureName` | string | The measure name where validation errors occured | | ||
| `validationErrors` | array of objects | The list of validation errors (AJV formated) | | ||
|
||
|
||
The validation errors array contain standard AJV errors, please refer to their documentation about [errors](https://ajv.js.org/api.html#error-objects) for more informations. `instancePath`, in our case, refer to the model name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
code: false | ||
type: page | ||
title: Measures Names Duplicates | ||
description: Measures Names Duplicates | Kuzzle Documentation | ||
--- | ||
|
||
# Measures Duplicates | ||
|
||
A `MeasuresNamesDuplicatesError` is thrown when one or multiple measures names is defined more than once inside the same model. | ||
|
||
**HTTP status**: 400 | ||
|
||
**Additional Properties:** | ||
|
||
| property | type | description | | ||
| ------------ | --------------- | --------------------------------- | | ||
| `duplicates` | array of string | List of duplicated measures names | |
Oops, something went wrong.