writeMeasure #
Write a measure model.
This action acts like a create or replace
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/device-manager/models/measures
Method: POSTOther protocols #
{
"controller": "device-manager/models",
"action": "writeMeasure",
"body": {
"type": "<measure type>",
"valuesMappings": {
// Values mappings
},
// Optional
"engineIds": ["<engineId>", "..."],
"valuesDetails":{
// Values details and translation
},
"validationSchema": {
// Valid JSON Schema
}
}
}Body properties #
type: Measure type namevaluesMappings: Mappings of the measure values in Elasticsearch formatengineIds: (optional) Array of engine IDs to scope this measure model to specific tenants. When omitted, the measure model is global. A measure type cannot be both global and tenant-scoped — creating a tenant-scoped measure when a global one of the same type exists (or vice versa) will be rejectedvaluesDetails: (optional) Measurement translations and unitsvalidationSchema: (optional) Measurement validation JSON schema
Response #
{
"status": 200,
"error": null,
"controller": "device-manager/models",
"action": "writeMeasure",
"requestId": "<unique request identifier>",
"result": {
"_id": "<modelId>",
"_source": {
// Measure model content
},
}
}Errors #
Writing a measure with values mappings can cause conflicts, in this case a MappingsConflictsError will be thrown with the HTTP code 409.