Skip to content

Commit

Permalink
chore(release): 2-dev into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
sebtiz13 committed Nov 12, 2024
2 parents 7cbb68c + 8328d57 commit 850583b
Show file tree
Hide file tree
Showing 51 changed files with 2,408 additions and 142 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [2.5.0-dev.1](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.3...v2.5.0-dev.1) (2024-11-08)


### Features

* **measure:** allow measures to be pushed on Assets via API (no devices) ([#344](https://github.com/kuzzleio/kuzzle-device-manager/issues/344)) ([c1073c1](https://github.com/kuzzleio/kuzzle-device-manager/commit/c1073c1f0ccb4cfc7cee64d86c51a4999617fd41))

## [2.4.3](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.2...v2.4.3) (2024-10-25)


Expand Down
88 changes: 88 additions & 0 deletions doc/2/controllers/assets/ingest-measure/index.md
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**.
98 changes: 98 additions & 0 deletions doc/2/controllers/assets/ingest-measures/index.md
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**.
2 changes: 1 addition & 1 deletion doc/2/controllers/models/get-asset/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gets an asset model.
### HTTP

```http
URL: http://kuzzle:7512/_/device-manager/models/asset/:_id
URL: http://kuzzle:7512/_/device-manager/models/asset/:model
Method: GET
```

Expand Down
2 changes: 1 addition & 1 deletion doc/2/controllers/models/get-device/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gets a device model.
### HTTP

```http
URL: http://kuzzle:7512/_/device-manager/models/device/:id
URL: http://kuzzle:7512/_/device-manager/models/device/:model
Method: GET
```

Expand Down
2 changes: 1 addition & 1 deletion doc/2/controllers/models/get-measure/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gets a measure model.
### HTTP

```http
URL: http://kuzzle:7512/_/device-manager/models/measure/:_id
URL: http://kuzzle:7512/_/device-manager/models/measure/:type
Method: GET
```

Expand Down
6 changes: 5 additions & 1 deletion doc/2/controllers/models/write-asset/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,8 @@ Method: POST

## Errors

Writing an asset with metadata mappings can cause conflicts, in this case a [ MappingsConflictsError ](../../../errors/mappings-conflicts/index.md) will be thrown with the HTTP code **409**.
| error | code | cause |
| ------------------------------------------------------------------------------ | ------- | --------------------------------------------------- |
| [ MappingsConflictsError ](../../../errors/mappings-conflicts/index.md) | **409** | Writing an asset with conflicting metadata mappings |
| [ MeasuresNamesDuplicatesError ](../../../errors/measures-duplicates/index.md) | **400** | Defining a measure name more than once |

5 changes: 5 additions & 0 deletions doc/2/controllers/models/write-measure/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Method: POST
// Optional
"valuesDetails":{
// Values details and translation
},
// Optional
"validationSchema": {
// Valid JSON Schema
}
}
}
Expand All @@ -46,6 +50,7 @@ Method: POST
- `model`: Measure model name
- `valuesMappings`: Mappings of the measure values in Elasticsearch format
- `valuesDetails`: (optional) Measurement translations and units
- `validationSchema`: (optional) Measurement validation JSON schema

---

Expand Down
2 changes: 1 addition & 1 deletion doc/2/errors/mappings-conflicts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
code: false
type: page
title: Mappings Conflicts
description: Mappings Conflicts
description: Mappings Conflicts | Kuzzle Documentation
---

# Mappings Conflicts
Expand Down
61 changes: 61 additions & 0 deletions doc/2/errors/measure-validation/index.md
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.
18 changes: 18 additions & 0 deletions doc/2/errors/measures-duplicates/index.md
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 |
Loading

0 comments on commit 850583b

Please sign in to comment.